Monday, June 15, 2015

how to restore grub with encrypted partition (dm-crypt)

If you have an encrypted parition with dm-crypt for "/" and your GRUB
is corrupted (or wiped after installing other operating system onto the
same computer), please follow these tips.

- grub-install and update-grub need to be executed under chroot'ed.

This is the most important tip. You must chroot into the encrypted
partition first.

- cryptsetup luksOpen /dev/sda3 csda3
- mount /dev/mapper/csda3 /mnt/system
- (assuming csda3 is /)
- (assuming sda2 contains an unencrypted /boot for this operating
system)
- mount /dev/sda2 /mnt/system/boot
- mount -o bind /dev/ /mnt/system/dev/
- mount -o bind /proc/ /mnt/system/proc/
- chroot /mnt/system
- grub-install /dev/sda
- update-grub

https://pzolee.blogs.balabit.com/2010/07/grub-helyreallitas-titkositott-es-lvm-particiok-eseten/

0 comments:

Post a Comment