You are not logged in.

#1 2012-03-11 17:55:59

kazimir
Member
Registered: 2012-01-20
Posts: 79

[solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

I've been wondering for a while why my boot menu was not the one I expected since installation but lacked time to investigate until now.

It turns out the boot process uses /boot/efi/efi/grub/grub.cfg while upgrading the system generates a /boot/grub/grub.cfg.
Replacing the former  with the latter made the upgraded boot menu show up, but doesn't fix the issue.

I don't remember exactly what I did during installation, as it was a couple months and I struggled for a couple of days and went through the process a dozen of times to finally manage a working EFI/GRUB2/GPT arch install. I may have missed a step or fumbled somewhere which left reference to the traditional grub-bios location instead of the efi one.

Any idea how to fix my system so the next upgrade will automatically generate grub.cfg at the right location ?


-edit- fixed a mix up between latter and former.

Last edited by kazimir (2012-03-13 21:54:54)

Offline

#2 2012-03-12 00:37:29

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

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

grub.cfg doesn't usually get automatically upgraded so far as I know. At least, not here. Did you do something to make it automatic? If so, edit the config for your automation. Or maybe explain what you mean by "upgrading the system". I'm assuming something like pacman -Syu and for me, that doesn't change grub.cfg that I know of.

Edit: also, I assume you mean "replacing the former with the latter". If not, you are not using UEFI to boot.

Last edited by cfr (2012-03-12 00:38:49)


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

#3 2012-03-12 16:16:51

kazimir
Member
Registered: 2012-01-20
Posts: 79

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

From my previous linux experience with other distros, I assumed that grub.cfg was automatically generated when there is a kernel upgrade, is that not the case with Arch ?

Your edit is absolutely right, I fixed my post.

Offline

#4 2012-03-13 01:18:53

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

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

As far as I know, it doesn't usually need updating on kernel upgrade. Wouldn't that only be needed if the kernels under /boot/ had different names? Or the .img files were renamed? Usually, that won't be the case...

The stuff directly under /boot gets updated because a kernel upgrade automatically triggers mkinitcpio -p linux. But that doesn't change grub.cfg.

I am pretty certain about this because in Arch, you can edit grub2's grub.cfg by hand if you preter. (I don't do this but it is perfectly OK to.) As I understand it, that's fine on Arch because upgrades will never overwrite your changes. On other distros if you do that, your customisations are likely to be wiped when upgrade automatically triggers grub-mkconfig.

To update my grub.cfg, I run (the equivalent of) grub-mkcofig -o /boot/efi/efi/grub.cfg. I then make a new backup of grub.cfg at /boot/efi/efi/grub/grub.cfg.bkup(n+1) where n is the previously highest numbered backup. But I'm paranoid.

Last edited by cfr (2012-03-13 01:20:09)


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

#5 2012-03-13 12:54:15

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

@kazimir: Read the GRUB2 Archwiki article properly. It mentions that the grub.cfg should be located at [BOOT_DIRECTORY]/grub/grub.cfg (--boot-directory option passed to grub-install). So if you passed --boot-directory=/boot/efi/efi , then the file should be /boot/efi/efi/grub/grub.cfg , not /boot/grub/grub.cfg . Also grub-mkconfig is not automatically run by grub2/kernel package updates. You should run it manually.

For grub2 1.99

GRUB_PREFIX="[BOOT_DIRECTORY]/grub" grub-mkconfig -o [BOOT_DIRECTORY]/grub/grub.cfg

For grub2 2.00~beta2

grub-mkconfig -o [BOOT_DIRECTORY]/grub/grub.cfg

For grub2 2.00~beta2, I recommend using --boot-directory=/boot , not /boot/efi/efi . I will change the wiki once the grub2 packages are updated in extra repo.

Offline

#6 2012-03-13 21:54:39

kazimir
Member
Registered: 2012-01-20
Posts: 79

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

I read the wiki article carefully, but I don't remember exactly what I've done because I went through the installation process a dozen times over the course of two days making small changes each time to get arch to work. I think I got it right because it works, but I'm not 100% sure.

So grub is not updated when there's a kernel upgrade, that explains a lot, I made a wrong assumption here. 

And I think I know what I did wrong, I most probably pasted from the grub2 arch wiki recommended way of generating grub.cfg and got my grub.cfg at the wrong place.

I'll mark the topic as solved. Thanks for clearing the confusion.

Last edited by kazimir (2012-03-13 21:56:28)

Offline

#7 2012-03-14 00:04:40

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

Re: [solved] EFI/GRUB2: grub.cfg used during boot is not the updated one.

the.ridikulus.rat wrote:

For grub2 2.00~beta2

grub-mkconfig -o [BOOT_DIRECTORY]/grub/grub.cfg

For grub2 2.00~beta2, I recommend using --boot-directory=/boot , not /boot/efi/efi . I will change the wiki once the grub2 packages are updated in extra repo.

Will this require repartitioning if /boot is currently on the root partition rather than distinct? I thought grub.cfg needed to be on the EFI partition... (But maybe everything will be clear when you issue upgrade instructions and I should just wait! smile)


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