Thursday 10 January 2013

Recovering LUKS encrypted Arch Linux installation on LVM after overwriting MBR when installing Windows Vista or Windows 8 to the same disk

Commented commands are optional.

Boot up with Arch Live CD
# loadkeys uk
# setfont Lat2-Terminus16
# vgscan
vgchange -ay
cryptsetup luksOpen /dev/mapper/[encrypted source] [unencrypted target]
mount /dev/mapper/[unencrypted target] /mnt
mount /dev/mapper/[lvm boot device] /mnt/boot
arch-chroot /mnt /bin/bash
grub-install --target=i386-pc --recheck /dev/sdX
exit
umount /mnt/boot
umount /mnt
reboot

Boot back in to Arch without Live CD and as root
## It may be sufficient to execute the following commands in the previous chroot environment.
# cp /boot/grub/grub.cfg /boot/grub/grub.cfg.old
grub-mkconfig -o /boot/grub/grub.cfg
reboot
Requires GRUB2 OS-Prober to detect Windows installation(s).

Enjoy!

References
https://wiki.archlinux.org/index.php/Beginners'_Guide
https://wiki.archlinux.org/index.php/LVM
https://wiki.archlinux.org/index.php/Dm-crypt_with_LUKS
https://wiki.archlinux.org/index.php/GRUB2

No comments:

Post a Comment