You are not logged in.

#1 2012-06-24 14:21:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Installing GRUB2 for UEFI boot: spurious success; pacman query

I just updated my system and the updates included both an upgrade to grub2 and the latest kernel (3.4.4). This raises a couple of issues.

First, should grub2 packages be marked as SyncFirst in pacman.conf? I ask because upgrading them at the same time as the kernel makes it impossible to install grub2 correctly to disk if efivars has not been modprobed prior to the pacman run. I didn't think of this and ended up with grub2 sort of half updated. Fortunately, it rebooted fine regardless and I was able to install it successfully and reboot a second time. But I worry that next time I might not be so lucky!

Second, grub-install returns success (0) even when the installation has gone badly wrong because the EFI variables are not available. Is this expected? It seems odd... The wiki doesn't mention this as far as I can work out. (At least I couldn't find it in the part where the instructions for running grub-install for UEFI boot are located.)

I'm surprised that the grub2 packages do not print any relevant messages when pacman upgrades them instructing users to reinstall to disk. This is the only package I've come across which does not output relevant instructions concerning the need for manual intervention. This seems especially surprising given how important a bootloader is. Or have I misunderstood the way in which such messages are intended to be used in Arch?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-06-24 20:24:59

check
Member
From: Germany
Registered: 2011-08-26
Posts: 30

Re: Installing GRUB2 for UEFI boot: spurious success; pacman query

If you haven't have another OS running than Linux i would use the Kernel Method instead:
https://wiki.archlinux.org/index.php/UEFI_Bootloaders
As might think the Kernel boots much faster, if there's no Bootloader ;D
And of course you must have a 100 MB FAT 16/32 Partition on which the kernel is
https://wiki.archlinux.org/index.php/UEFI But i think you already have this

Edit:
as  well, read all passages to efibootmgr ;D grub can't install itself into the efi bash stuff
modprobe efivars
efibootmgr --create --gpt --disk /dev/sdX --part Y --write-signature --label "Arch Linux (GRUB2)" --loader '\EFI\arch_grub\grubx64.efi'

Edit 2:
Modprobe efivars, are you sure that the system was booted via Uefi?  If this fails you have to boot via the grub2 uefi bash of Ubuntu or Archboot, if grub was running perfect after upgrade, you shouldn't had have to change it .
..

Last edited by check (2012-06-24 20:58:41)

Offline

#3 2012-06-25 02:09:09

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: Installing GRUB2 for UEFI boot: spurious success; pacman query

I'd rather not try to persuade my system to work without a bootloader given the trouble I had persuading it to work with one. I'm not bothered about shaving seconds off my boot time.

It is sometimes necessary to reinstall grub2 to disk following an upgrade. If you look at the contents of e.g. /boot/grub/x86_64-efi/ and compare it with the versions installed by grub2, you can see that the files under /boot no longer match the ones which have been upgraded. Sometimes not having the upgraded versions will cause problems with booting. (Sometimes not - I guess it depends what's changed.)

It isn't necessary to run efibootmgr again, though. At least, not that I know of. Just grub-install and upgrading the config file if applicable. But you need to modprobe efivars to run grub-install and you can't do that if the system upgrade also included the kernel.

I'm not sure what you mean by "efi bash stuff"?

Yes. My system was and is booted via UEFI. I am perfectly certain of this. modprobe efivars works fine except following a kernel upgrade when it can't be expected to.

The problem is you can't know if grub will still run perfectly without rerunning grub-install until you reboot. It is much easier to just do it. But that can't work if the kernel was also upgraded. (Although grub-install will exit claiming success despite the errors.)

Hence my two questions:
1) should grub2 packages be SyncFirst in pacman.conf?
2) is the success-report-on-failure from grub-install expected?

Last edited by cfr (2012-06-25 02:10:16)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB