Froze during system update, had to reset; got "grub-probe: error: cannot find a GRUB drive"

Hi there, Dell Latitude 3540 laptop user with Manjaro XFCE installed. No EFI or multiboot. Here is how I fixed this system after the latest update froze during an app upgrade (kdenlive), requiring a power-off, which left it unable to boot. Hopefully this can help someone else. USB drive was sdb1 and 2, hard disk was sda1 and 2.

Initially at reboot:

grub-probe: error: cannot find a GRUB drive for /dev/sda1  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sda2  Check your device.map.

This was the result when trying to start any of the installed kernels.

As for what happened; the /boot/*.img and vmlinuz files were missing due to the interrupted update. (Dev note: Seems to me, a better fail-safe approach would be to not delete them, build new alongside them, and only move them when the update was finished.) Anyways perhaps update-grub could be run to rebuild these images. But how to do that if the system can’t boot? Researching, seems like we need to chroot into sda1 from an external boot, and go from there.

I put the latest Manjaro XFCE on USB, booted that, and tried what I could find from here and elsewhere:

[manjaro@manjaro ~]$ manjaro-chroot -a
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
==> Mounting (ManjaroLinux) [/dev/sda1]
 --> mount: [/mnt]
[manjaro /]# 

This chroot is different than others, perhaps due to the OS being a native, non-UEFI install with no other drives, partitions, or OSes installed. In any case, it did mount /sda1, and in this new prompt, we were directly in the sda1 filesystem. So going to / now was the root of the sda1 disk.

Ok now we’re cooking. Tried the first obvious thing:

[manjaro /]# os-prober
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb2.  Check your device.map.

Okay, well this is a red-herring because I don’t care about sdb (USB); the hard disk is sda.

Researching further I tried:

[manjaro /]# grub-mkconfig > /boot/grub/grub.conf
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdb2.  Check your device.map.
Adding boot menu entry for UEFI Firmware Settings ...
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

This was not what I’d hoped to see; it only found sdb again. The laptop was rebooted to see if this did anything useful, but only UEFI Firmware Settings (useless for me) and Memory Tester [memtest86+) were available. update-grub calls grub-mkconfig, so if this wouldn’t rebuild the files, then this result is expected.

Failing this, I realized that the upgrade would have to be completed to rebuild those files. Booted from USB again, manjaro-chroot -a back into sda1, and tried pacman -Syu which reported it was unable to lock the database. Okay, kind-of expected since an ongoing update was interrupted, so it’s database was still locked. In extreme cases it may be necessary to delete the pacman lock file. So, mv /var/lib/pacman/db.lck /var/lib/pacman/db.lck.old and try again: pacman -Syu now wanted to perform the remainder of the GB-size upgrade, yes!

During the upgrade, it complained about the offending package (kdenlive) again but did complete this time, and it rebuilt the missing .img files. That package, for whatever reason, will have to be reinstalled later. It also noted several times that certain tasks were skipped due to the chroot.

Once complete, exit the chroot, reboot, remove USB, and presto, things are working again.

Incidentally, doing a pacman -Syu or octopi or whatever now, will show that there is nothing else that needs done (aside from reinstalling any offending packages.) I had the impression that some sort of follow-up should be necessary due to the skipped steps, but it seems to think everything is fine. Still, I did a fresh update-grub just to be sure:

[me@mylaptop ~]$ sudo update-grub
[sudo] password for me: 
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-5.16-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.16-x86_64.img
Found initrd fallback image: /boot/initramfs-5.16-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

Hope this is helpful. Thoughts welcome.

to rebuild image ( iso or vmlinuz )

mkinitcpio -P

sdb here is from your USB live manjaro ( avoid to modify iso boot EFI manjaro )

never stop during an update ,
if so always go in chroot ,
remove lock , et end pacman -Syyu

2 Likes

Hello. Thank you very much for this info. I’m in the same situation actually. Following various instructions I found online got me to the point where only UEFI settings were available. Unfortunately when I tried entering

mv /var/lib/pacman/db.lck /var/lib/pacman/db.lck.old

I simply received
mv: cannot stat '/var/lib/pacman/db.lck' : No such file or directory

Could I have some advice on how to proceed from here please? Would greatly appreciate it.

Hello. I tried this but received the following output.

==> ERROR: No presets found in /etc/mkinitcpio.d

Any advice on how to proceed please? Would be very grateful for that.

Also thank you @rdtsc for showing that it isn’t too difficult to resolve.

@Abubakar it would be better to start a new thread with your issue, even if it seems similar to this one. You can link to this thread and explain you have been trying these steps, but as an outsider to your setup it is impossible to see how closely your situation aligns with this post from last month.

Thank you very much. I’ve opened another thread here. Would appreciate your input.