Configure Linux kernel and grub on external drive
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm moving my system from an old drive to a new one.
I could boot from a live CD/USB stick and install the system there, but for some weird reason the bios seems unable to do so.
So, how can I change from the old to the new drive and install GRUB and Linux there? Additionally, I would to setup-up this new drive with LUKS and LVM.
boot linux-kernel grub
add a comment |Â
up vote
0
down vote
favorite
I'm moving my system from an old drive to a new one.
I could boot from a live CD/USB stick and install the system there, but for some weird reason the bios seems unable to do so.
So, how can I change from the old to the new drive and install GRUB and Linux there? Additionally, I would to setup-up this new drive with LUKS and LVM.
boot linux-kernel grub
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm moving my system from an old drive to a new one.
I could boot from a live CD/USB stick and install the system there, but for some weird reason the bios seems unable to do so.
So, how can I change from the old to the new drive and install GRUB and Linux there? Additionally, I would to setup-up this new drive with LUKS and LVM.
boot linux-kernel grub
I'm moving my system from an old drive to a new one.
I could boot from a live CD/USB stick and install the system there, but for some weird reason the bios seems unable to do so.
So, how can I change from the old to the new drive and install GRUB and Linux there? Additionally, I would to setup-up this new drive with LUKS and LVM.
boot linux-kernel grub
asked Jan 30 at 14:25
random_user
1266
1266
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
For the first part, you can find the details at: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
It basically boils down to:
- Create a boot partition on /dev/sdb1
- Create a crypt-luks partion
enc
on /dev/sdb2 - Create a LVM
enc_my_lv
logical volume on top of the luks partition. - Create a btrfs (or ext4) on
enc_my_lv
. - Fsync system and user data from old drive to
enc_my_lv
. - Edit fstab and cryptsetup to fit your new system.
Now the additional part not covered there is to manually install Grub and Linux on the boot partition:
Mount enc_my_lv
on /mnt:
mount /dev/your_vg/enc_my_lv /mnt
Mount boot on /mnt/boot:
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
Mount additional devices:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done #(credits: see https://askubuntu.com/a/88432/232047)
Chroot to /mnt and run configs:
chroot /mnt
dpkg -l | grep linux-image-.*-generic | sort -k3 | tail -n1 | awk 'system ("sudo apt-get install --reinstall " $2)' #Reinstall Linux kernel packages there (credits: see https://askubuntu.com/a/298855/232047)
update-initramfs -u
grub-install /dev/sdb
update-grub
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
For the first part, you can find the details at: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
It basically boils down to:
- Create a boot partition on /dev/sdb1
- Create a crypt-luks partion
enc
on /dev/sdb2 - Create a LVM
enc_my_lv
logical volume on top of the luks partition. - Create a btrfs (or ext4) on
enc_my_lv
. - Fsync system and user data from old drive to
enc_my_lv
. - Edit fstab and cryptsetup to fit your new system.
Now the additional part not covered there is to manually install Grub and Linux on the boot partition:
Mount enc_my_lv
on /mnt:
mount /dev/your_vg/enc_my_lv /mnt
Mount boot on /mnt/boot:
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
Mount additional devices:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done #(credits: see https://askubuntu.com/a/88432/232047)
Chroot to /mnt and run configs:
chroot /mnt
dpkg -l | grep linux-image-.*-generic | sort -k3 | tail -n1 | awk 'system ("sudo apt-get install --reinstall " $2)' #Reinstall Linux kernel packages there (credits: see https://askubuntu.com/a/298855/232047)
update-initramfs -u
grub-install /dev/sdb
update-grub
add a comment |Â
up vote
1
down vote
For the first part, you can find the details at: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
It basically boils down to:
- Create a boot partition on /dev/sdb1
- Create a crypt-luks partion
enc
on /dev/sdb2 - Create a LVM
enc_my_lv
logical volume on top of the luks partition. - Create a btrfs (or ext4) on
enc_my_lv
. - Fsync system and user data from old drive to
enc_my_lv
. - Edit fstab and cryptsetup to fit your new system.
Now the additional part not covered there is to manually install Grub and Linux on the boot partition:
Mount enc_my_lv
on /mnt:
mount /dev/your_vg/enc_my_lv /mnt
Mount boot on /mnt/boot:
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
Mount additional devices:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done #(credits: see https://askubuntu.com/a/88432/232047)
Chroot to /mnt and run configs:
chroot /mnt
dpkg -l | grep linux-image-.*-generic | sort -k3 | tail -n1 | awk 'system ("sudo apt-get install --reinstall " $2)' #Reinstall Linux kernel packages there (credits: see https://askubuntu.com/a/298855/232047)
update-initramfs -u
grub-install /dev/sdb
update-grub
add a comment |Â
up vote
1
down vote
up vote
1
down vote
For the first part, you can find the details at: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
It basically boils down to:
- Create a boot partition on /dev/sdb1
- Create a crypt-luks partion
enc
on /dev/sdb2 - Create a LVM
enc_my_lv
logical volume on top of the luks partition. - Create a btrfs (or ext4) on
enc_my_lv
. - Fsync system and user data from old drive to
enc_my_lv
. - Edit fstab and cryptsetup to fit your new system.
Now the additional part not covered there is to manually install Grub and Linux on the boot partition:
Mount enc_my_lv
on /mnt:
mount /dev/your_vg/enc_my_lv /mnt
Mount boot on /mnt/boot:
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
Mount additional devices:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done #(credits: see https://askubuntu.com/a/88432/232047)
Chroot to /mnt and run configs:
chroot /mnt
dpkg -l | grep linux-image-.*-generic | sort -k3 | tail -n1 | awk 'system ("sudo apt-get install --reinstall " $2)' #Reinstall Linux kernel packages there (credits: see https://askubuntu.com/a/298855/232047)
update-initramfs -u
grub-install /dev/sdb
update-grub
For the first part, you can find the details at: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system
It basically boils down to:
- Create a boot partition on /dev/sdb1
- Create a crypt-luks partion
enc
on /dev/sdb2 - Create a LVM
enc_my_lv
logical volume on top of the luks partition. - Create a btrfs (or ext4) on
enc_my_lv
. - Fsync system and user data from old drive to
enc_my_lv
. - Edit fstab and cryptsetup to fit your new system.
Now the additional part not covered there is to manually install Grub and Linux on the boot partition:
Mount enc_my_lv
on /mnt:
mount /dev/your_vg/enc_my_lv /mnt
Mount boot on /mnt/boot:
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
Mount additional devices:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done #(credits: see https://askubuntu.com/a/88432/232047)
Chroot to /mnt and run configs:
chroot /mnt
dpkg -l | grep linux-image-.*-generic | sort -k3 | tail -n1 | awk 'system ("sudo apt-get install --reinstall " $2)' #Reinstall Linux kernel packages there (credits: see https://askubuntu.com/a/298855/232047)
update-initramfs -u
grub-install /dev/sdb
update-grub
edited Jan 30 at 17:04
answered Jan 30 at 14:25
random_user
1266
1266
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420685%2fconfigure-linux-kernel-and-grub-on-external-drive%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password