Lost Grub after full system upgrade + reboot with full disk encryption on work laptop [help]

Hello,

I have been using Marjaro for a few years now and think its best Linux distro I have ever used. I have had almost no issues and any issue I did have I was able to find the answer to very easily.

Starting towards the end of last year I started a new job that required full disk encryption. Full disk encryption is new to me, but I was successful in install Manjaro Linux with full disk encryption on my Dell Inspiron.

I decided to do a full system upgrade like I have run many times before followed by a grup-update and a reboot. There was very little output from the grub-update but no errors (should have been concentrating more here, was working at the same time).

This where I think I went wrong, should have rebooted and then run the grub-update.

So now when rebooted I ended up in a grub> recovery console.

I have looked at a bunch of other posts and wiki pages on the topic but I am confused about how to handle the encryption.

I would really appreciate some help on how I can recover my system. Would really like to avoid having to format and re-install.

So a just a little follow up for when a much smarter than me person decides to look help (:pray:)

This is what I have learned about my system so far.

Note when you see ... it's just me not typing everything on the screen (man do I miss copy+paste)

grub> ls
(crypto0) (proc) (hd0) (hd1) (hd1,gpt3) (hd1,gpt2)  (hd1,gpt1)
grub> ls (hd1,gpt1)/
efi/
grub> ls (hd1,gpt1)/efi/
Manjaro/ boot/ Dell/
grub> ls (hd1,gpt1)/efi/boot/
grub> ls (crypto0)
Device crypto0: Filesystem type ext*- Last mod... UUID 1468-... Sector size 541B - Total size 240...
grub> ls (crypto0)/
lost+found/  boot/ proc/ sys/ dev/ ...
grub> ls (crypto0)/boot
efi/ grub/ memtest86+/ linux419-x86.kver intel-ucode.img initramfs-4.19-x86_64.img initramfs-4.19-x86_64-fallback.img
grub> ls (crypto0)/boot/grub
x86_64-efi/ grubenv themes/ fonts/ grub.cfg
grub> ??? what next

So what next, do I need to do things differently because I am on an encrypted disk. Looks like the disk is decrypting fine.

Try

 search.file /etc/manjaro-release  root
 configfile /boot/grub/grub.cfg
 boot

In grub rescue does that boot you into manjaro?

Edit, I'm not sure about the encyption, but the worst this can do is not work.

This is the grub commands to boot into a encrypted system.
But you must know the UUID's for the partition. Not just the UUID of the raw partition but also the UUID of the decrypted same partition. They are listed in /etc/crypttab.

A disclaimer - I do not have a encrypted system and I won't be able to help further if you have still have any questions or need help. Sorry.

But, hope after you fixed this, suggest you use this to have a grub rescue facility in case you face a similar situation. Include a working grub.cfg with this grub-rescue cd (or burn iso to a usb).

1 Like

@10yearslate
Thanks, but unfortunately no, I had a look a the grub.cfg and it only mentions mem test, and when I try to boot it gives me an error. See below.

@gohlip
I think I found my UUIDs like you said using some exploring, see below.


The one thing I found confusing is that in my /boot I only see 2 initramfs, with the fallback being very large at 30MB. But no vmlinuz.

FYI: I am learning about grub and setting ENV as I go. I included this in the below example out for complete reference in case anybody else is also needing to learn this for the first time as well and anybody that does have grub experience can more easily help.

Still trying to figure out where to from here?

  1. Can I try boot with just an initramfs
    1. if so should I try the fallback first.
    2. if not, can I copy a kernel from another machine in some magical way use it on this machine
  2. It seems I am able to browse my root, so it must be decrypted do I need to do anything else

grub> echo $grub_platform
efi


grub> search.file /etc/manjaro-release  root
grub> echo $root
crypto0


grub> configfile /boot/grub/grub.cfg
grub> boot
you need to load kernel first


grub> help
grub> help probe
grub> probe -u $root
14d6e674-7465-46f...


grub> cat ($root)/etc/crypttab
# /etc/crypttab: mappings for encrypted partitions.
# ...
# ...
luks-9f85d813-...  UUID=9f85d813-...  /crypto_keyfile.bin luks
luks-047de29a-...  UUID=047de29a-...  /crypto_keyfile.bin luks


grub> cat ($root)/etc/fstab
# /etc/fstab: static file system information
# ...
# ...
UUID=C258-FCEC                   /boot/efi     vfat     defaults,noatime  0  2
/dev/mapper/lucks-9f85d813-...   /             ext4     defaults,noatime  0  1
/dev/mapper/lucks-047de29a-...   swap          swap     defaults,noatime  0  2

Okay, I am back in business :tada:

So for those that find looking for answers, the bellow is what I did after booting from USB.

lsblk -f
...
sda
...
nvme0n1
|-nvme0n1
|-nvme0n1p1  vfat           C258-FCEC
|-nvme0n1p2  crypto_LUCKs   9f85d813-...
|-nvme0n1p3  crypto_LUCKs   047de29a-...

sudo cryptsetup open --type luks /dev/nvme0n1p2 crypto_LUKS
Enter passphrase for /dev/nvme0n1p2

ls /dev/mapper
control  crypto_LUKS
mount /dev/mapper/crypto_LUKS  /mnt
ls /mnt
bin boot crypto_keyfile.bin dev etc home ...
ls /mnt/boot
efi/ grub/ memtest86+/ linux419-x86.kver intel-ucode.img initramfs-4.19-x86_64.img initramfs-4.19-x86_64-fallback.img

whoami
manjaro

sudo manjaro-chroot /mnt
ls /boot
efi/ grub/ memtest86+/ linux419-x86.kver intel-ucode.img initramfs-4.19-x86_64.img initramfs-4.19-x86_64-fallback.img

whoami
root

mhwd-kernel -l
available kernels:
 * linux316
 * linux414
 * linux419
 * linux44
 * ...
 * linux419-rt
 * linux54-rt

mhwd-kernel -i linux419
Error: You can't reinstall your current kernel. Please use 'pacman -Syu' instead to update

CTRL+d

sudo /mnt/boot_mk
sudo cp -R /mnt/boot/* /mnt/boot_bk
ls /mnt/boot_bk
efi/ grub/ memtest86+/ linux419-x86.kver intel-ucode.img initramfs-4.19-x86_64.img initramfs-4.19-x86_64-fallback.img

sudo manjaro-chroot /mnt
pacman -S linux419 linux419-headers
warning: linux419.19.98-1 is up to date -- reinstalling
resolving dependencies
....
===> Image generated successfully
(4/4) Updating Grub-Bootmenu
Generating grub configuration file ...
Found theme: /usr/..
Found linux image: /boot/vmlinux-4.19-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-x86_64.img
Found initrd fallback image: /boot/initramfs-4.19-x86_64-fallback.img
grub-probe error: cannot find a GRUB driver for /dev/sda1. Check your device.map.
grub-probe error: cannot find a GRUB driver for /dev/sda1. Check your device.map.
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

CTRL+d

reboot
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by