You are not logged in.

#1 2022-09-01 06:47:05

860lacov
Member
Registered: 2020-05-02
Posts: 497

What is the "good" grub.cfg location?

With the current grub update "alert" I started to check my configuration.

I have ESP partition /dev/sda1 mounted to /efi
I remember that I did this becouse of this tip from wiki:

Tip:

    /efi is a replacement[5] for the previously popular (and possibly still used by other Linux distributions) ESP mountpoint /boot/efi.
    The /efi directory is not available by default, you will need to first create it with mkdir(1) before mounting the ESP to it.


My grub-install looked like:

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

Now I should run grub-mkconfig but.
On the main Arch page we have:

grub-install ...
grub-mkconfig -o /boot/grub/grub.cfg

And on wiki Alternative install method
there is:

grub-mkconfig -o esp/grub/grub.cfg

I've checked and It seems that my grub.cfg file is in /boot/grub/grub.cfg

So should I do
grub-mkconfig -o /boot/grub/grub.cfg
or
grub-mkconfig -o /efi/grub/grub.cfg
?

Offline

#2 2022-09-01 07:32:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,120

Re: What is the "good" grub.cfg location?

The first one. For the second one to work you'd need to adjust your grub-install command so that it checks it's configuration on /efi rather than on /boot/grub/grub.cfg via a --boot-directory= flag.

GRUB works in multiple parts, you install the EFI binary to the ESP to have something to load for the mainboard. Once that has happened, GRUB then looks for it's configuration (... and potentially other stuff like themes and fonts) in the "GRUB boot directory" which defaults to whatever is in /boot (and whichever file system/partition /boot is currently mounted to) loads that and then presents the entries that are configured there.

Last edited by V1del (2022-09-01 07:32:44)

Offline

Board footer

Powered by FluxBB