Can't boot after system upgrade

Hi there!
I the beginning of this summer a made a system upgrade, and after reboot my keyboard and touchpad didn't work. Since I was quite busy at the time I decided to wait till fix til a new upgrade had arrived. So a couple of weeks ago I did a full system upgrade via a live-usb (using manjaro-chroot -a first). Everything went well, but the boot from my normal disk failed. I did some research and conducted the following:

  • mkcpinitcpio -P, which run successfully

  • grub-install, which run successfully

  • update-grub, which gives the following output:

[manjaro-gnome /]# update-grub
Generating grub configuration file ...
Found background: /usr/share/grub/background.png
Found linux image: /boot/vmlinuz-5.0-rt-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.0-rt-x86_64.img
Found initrd fallback image: /boot/initramfs-5.0-rt-x86_64-fallback.img
Found linux image: /boot/vmlinuz-4.19-rt-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-rt-x86_64.img
Found initrd fallback image: /boot/initramfs-4.19-rt-x86_64-fallback.img
Found linux image: /boot/vmlinuz-3.16-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-3.16-x86_64.img
Found initrd fallback image: /boot/initramfs-3.16-x86_64-fallback.img
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/sda1.  Check your device.map.
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done

When trying to boot normaly after this, it works a single time. Restarting the systems again take me to the grub rescue menu/teminal.

I found this tread, and answer from @gohlip:


and it seems like that can be a solution. However, since I am still a newbie, it would be awesome to get some feedback before I might mess it up more. Boot stuff can be sensitive stuff I have discovered. Would you recommend the solution in the tread above, or something else?

Br,
Kallshem

Why not upgrade from the OS itself rather than from usb chroot?
Use this first post. It is more thorough. And don't forget to do the 2 [UEFI - Additional commands]. Check correct partition with 'findmnt /boot/efi'

Hi, I will look in to that post, thanks!
Why? Cause my keyboard and touchpad didn't work.... I realise now when writing this that I could have done it in "tty2"?

Hi again,
It works until the last step when i get:

$ sudo efibootmgr -c -d /dev/nvme0n1p1 -L "manjaro" -l "\EFI\Manjaro\grubx64.efi"
[sudo] password for liblen: 
EFI variables are not supported on this system.

any clues?

Output from findmnt:

$ findmnt /boot/efi
TARGET    SOURCE         FSTYPE OPTIONS
/boot/efi /dev/nvme0n1p1 vfat   rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
[liblen@liblen-pc ~]$ 

I discovered I'd misspelled the command, but I've tried with "-p 1" filled in, and that gives me the same error

Then show us
blkid

$ sudo blkid
/dev/nvme0n1p1: UUID="0395-9092" TYPE="vfat" PARTUUID="2dde77e3-955d-479e-8e25-9c97f5d0a089"
/dev/nvme0n1p2: UUID="746cb16a-ad5c-4061-8bce-be3cf85fcd4d" TYPE="ext4" PARTUUID="7a96844a-19e0-47d3-a20d-71c0159772ed"
/dev/nvme0n1p3: UUID="139962c9-e3f3-427a-80d9-59dbcffbaa06" TYPE="swap" PARTUUID="2bb9ad2a-a2aa-456f-a07d-ecf386787a40"
/dev/sda1: UUID="2019-01-03-18-11-55-00" LABEL="MJRO1802" TYPE="iso9660"
/dev/sda2: SEC_TYPE="msdos" LABEL_FATBOOT="MISO_EFI" LABEL="MISO_EFI" UUID="248D-BD3A" TYPE="vfat"

The two last items should be my USB

It means you did not start your live media in UEFI.
Again, reminder you do not need to boot to liveOS, just go to its boot menu.
But you have to start that live media in UEFI.

And it is not

From the post, it is..

sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "manjaro" -l "\EFI\Manjaro\grubx64.efi"

Type carefully.

If you can handle chroot, you should be able to handle this.
Now, if you did not handle chroot well earlier, you can mess it up the OS and you may need to reinstall. In chroot, it is easy to mess up. Use chroot carefully.

[EDIT] -

To be sure you've started up livecd in the right mode, at grub prompt, check output of

grub> echo $grub_platform

If output is pc, you've booted up in bios-legacy.
If output is efi, you've booted up in uefi.
If you're in the wrong mode, reboot livecd in the right mode.

This is weird,
grub> echo $grub_platform
gives me "efi".

Running grub-install on the right partition (didn't specify any before) gives:

$ sudo grub-install /dev/nvme0n1p1 
[sudo] password for liblen: 
Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
Installation finished. No error reported.

List some other output below:

$ sudo efibootmgr 
EFI variables are not supported on this system.
$ ls /sys/firmware/efi/
config_table  efivars  fw_platform_size  fw_vendor  runtime  systab

But the efivars folder is empty

Does anyone have any idea?
I'm getting quite confused...

When booted to installed OS, installe packages efibootmgr, efivar and dosfstools, if not already installed.
Do all commands again.

You may have chrooted in bios-legacy and did the grub-install command in bios-legacy previously. And now use this long command as follows in grub-install command.

sudo grub-install  --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --boot-directory=/boot  --recheck --debug

If still fail, reinstall OS.

1 Like

This is the wrong "partition". Grub is installed (with auto installation scripts) on a drive, not a partition.
The proper way is as @gohlip shows.

Hi again!
I've run the same live-usb the whole summer, booting it in the same way all the time.

Got the following utput when running:

sudo grub-install  --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --boot directory=/boot  --recheck --debug```
grub-install: info: adding 377 padding fixup entries.
grub-install: info: writing 816 bytes of a fixup block starting at 0xe000.
grub-install: info: reading /usr/lib/grub/x86_64-efi/fshelp.mod.
grub-install: info: reading /usr/lib/grub/x86_64-efi/ext2.mod.
grub-install: info: reading /usr/lib/grub/x86_64-efi/part_gpt.mod.
grub-install: info: kernel_img=0x561708ce9bf0, kernel_size=0x1a000.
grub-install: info: the core size is 0x1e0c0.
grub-install: info: writing 0x21000 bytes.
grub-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/manjaro/grubx64.efi'.
grub-install: info: Registering with EFI: distributor = `manjaro', path = `\EFI\manjaro\grubx64.efi', ESP at hostdisk//dev/nvme0n1,gpt1.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivarfs.
EFI variables are not supported on this system.
grub-install: info: executing efibootmgr -c -d /dev/nvme0n1 -p 1 -w -L manjaro -l \EFI\manjaro\grubx64.efi.
EFI variables are not supported on this system.
Installation finished. No error reported.

(got many lines above the pasted text about relocation entry positions on the memory)

and:

$ sudo update-grub
Generating grub configuration file ...
Found background: /usr/share/grub/background.png
Found linux image: /boot/vmlinuz-5.0-rt-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.0-rt-x86_64.img
Found initrd fallback image: /boot/initramfs-5.0-rt-x86_64-fallback.img
Found linux image: /boot/vmlinuz-4.19-rt-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-rt-x86_64.img
Found initrd fallback image: /boot/initramfs-4.19-rt-x86_64-fallback.img
Found linux image: /boot/vmlinuz-3.16-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-3.16-x86_64.img
Found initrd fallback image: /boot/initramfs-3.16-x86_64-fallback.img
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/sda1.  Check your device.map.
Found Manjaro Linux (18.0.4) on /dev/nvme0n1p2
Found memtest86+ image: /boot/memtest86+/memtest.bin
/usr/bin/grub-probe: warning: unknown device type nvme0n1.
done

So your suggenstion now is reinstallning? :see_no_evil:
Your suggestions under "If grub is really messed up" in your guide/post, isn't an option?

Did you install these packages?
Rebooted?

Provide

pacman -Q efivar
pacman -Q efibootmgr

Sorry, forgott to tell you they were already installed :slightly_smiling_face:

$ pacman -Q efivar
efivar 37-1
$ pacman -Q efibootmgr
efibootmgr 16-1

Okay, modules for kernels in uefi and bios-legacy are built differently.
As said, you had chrooted in bios-legacy and done grub-install.
And without exiting chroot and doing other operations while in chroot will cause problems.
Reinstalling would be best and easiest. But if you want to continue to try, boot up in uefi again.
Install another kernel and see if you can boot to the new kernel (in uefi).

:neutral_face:
Just so that we are one the same page, the measures in Unable to boot won't do anything good?

But anyway, I'll try with a new kernel

when I installed the new kernel I found this in the details dialog

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

Probably not a surprise?

Forum kindly sponsored by Bytemark