Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DorianBDev/7c4b63ecaa244318a11b63850fe7fe5e to your computer and use it in GitHub Desktop.
Save DorianBDev/7c4b63ecaa244318a11b63850fe7fe5e to your computer and use it in GitHub Desktop.
Restore GRUB in UEFI + LVM + LUKS setup (Manjaro)
Setup: UEFI, LVM + LUKS encrypted drive
Bootloader: Grub
Links:
- https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader
-
Restore GRUB (boot into live env):
# get the encrypted partition (crypto_LUKS)
lsblk -f
cryptsetup open --type luks /dev/sda2 lvm
mount /dev/mapper/cryptVG-root /mnt
mount /dev/sda1 /mnt/boot # boot partition
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts/
modprobe efivarfs
chroot /mnt
# I get the "EFI variables are not supported on this system." so do this:
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
pacman -S mtools os-prober # probably not needed
# set use_lvmetad = 0 in /etc/lvm/lvm.conf
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro_grub --recheck
update-grub
# set use_lvmetad to previous value in /etc/lvm/lvm.conf
REBOOT and should work
Note: If initial ramdisk env needs to be updated and boot is unsuccessful do this:
- chroot like here but don't mount the boot partition
- make sure use_lvmetad is set correctly
mkinitcpio -p linux41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment