Mount dm-crypt/LUKS encrypted filesystem and rewrite Grub Bootloader

If Linux (after an update) doesn't boot up anymore it might be necessary to boot into the installation using some distribution which can be booted from a cd/usb-drive (p. x. Ubuntu). The first step would then be to load the encrypted installation and maybe to rewrite the grub bootloader. The following commands can be used to do so:

cryptsetup luksOpen /dev/sda1 dm-0 mount /dev/mapper/dm-0 /mnt/temp
grub-install -- root-directory /dev/sda

Tags:

Add new comment