View previous topic :: View next topic |
Author |
Message |
Ridrok Tux's lil' helper
Joined: 26 Jan 2014 Posts: 116 Location: France
|
Posted: Thu Dec 12, 2024 8:41 pm Post subject: Issues with grub trying to move to EFI |
|
|
Hello,
I try to move to EFI, I currently use CSM (Asus) bios compatible mode.
Reading the Handbook for EFI, I get into a problem.
If I follow the handbook and reinstall grub with the entry GRUB_PLATFORMS="efi-64" in make.conf, then when running grub-install --efi-directory=/efi, I get
Code: | grub-install : error : /usr/lib/grub/i386-pc/modinfo.sh does not exist. Please use --target or --directory. |
Having this entry in make.conf removes the pc use flag from grub
If I remove this entry, recompile grub with efi-64 and pc (uses automatically added) I get another message
Code: | Installing for i386-pc platform.
grub-install: error: install device isn't specified. |
So I am a bit lost on how to generate the required EFI files in /efi mount point to the ESP partition. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1950
|
Posted: Thu Dec 12, 2024 8:47 pm Post subject: |
|
|
Ridrok wrote: | If I follow the handbook and reinstall grub with the entry GRUB_PLATFORMS="efi-64" in make.conf, then when running grub-install --efi-directory=/efi, I get
Code: | grub-install : error : /usr/lib/grub/i386-pc/modinfo.sh does not exist. Please use --target or --directory. |
|
If you see this, then the system was not booted via a UEFI enabled loader such that the UEFI settings cannot be modified.
The best option is to boot with a live environment which supports doing so with UEFI and not CSM (Legacy BIOS).
Otherwise, an alternative is to use the --removable option to grub-install to bypass the modifying the boot settings and put the EFI executable into a default location (which may overwrite any existing default EFI executable). |
|
Back to top |
|
|
Ridrok Tux's lil' helper
Joined: 26 Jan 2014 Posts: 116 Location: France
|
Posted: Thu Dec 12, 2024 8:55 pm Post subject: |
|
|
For sure I did not boot in UEFI, my gentoo has been installed with MBR so many years ago.
I cannot boot it with EFI, that is why I try to make it EFI
So egg and chicken here.
Then ok, will try a live UEFI boot |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 668
|
Posted: Fri Dec 13, 2024 9:58 pm Post subject: |
|
|
Ridrok wrote: | So egg and chicken here. | The egg came first, layed by a proto-chicken.
Ridrok wrote: | Then ok, will try a live UEFI boot | It's not really necessary https://wiki.gentoo.org/wiki/Handbook:AMD64/Blocks/Bootloader#Debugging_GRUB wrote: | grub-install --target=x86_64-efi --efi-directory=/efi --removable | UEFI needs to be able to "self identify" bootable media, or USB disks etc. would never work. Once it's booted after running the above command you can run it again without --removable. |
|
Back to top |
|
|
Ridrok Tux's lil' helper
Joined: 26 Jan 2014 Posts: 116 Location: France
|
Posted: Sat Dec 14, 2024 8:21 am Post subject: |
|
|
I managed to do it.
Handbooks and wiki are very confusing I would say.
What I did:
Boot the live Gentoo in EFI while still having CSM activated.
Moved my system to a new disk redoing the partitioning (Moving from SSD to NVME).
I had 2Mo bios grub, 80MB boot, 8GB swap and remaining as EXT4
I now have 1GB EFI, 32GB swap and remaining EXT4, got ride of the bios partition
Then I did mount /efi and /boot to the newly created 1GB partition with fstab (I did not install autofs) and did grub install, then
Code: | grub-mkconfig -o /efi/EFI/Gentoo/grub.cfg |
Then from /usr/src/linux
Then it was able to boot in EFI.
I then converted the windows 10 I have lying on another disk to GPT/EFI, I use it twice a year, but I wanted to keep it in case.
Finally I did deactivate CSM, and after all these years it boots with the console at proper resolution.
Moreover I now have Resizable Bar working.
Code: | ~ % nvidia-smi -q | grep -i bar -A 3
BAR1 Memory Usage
Total : 32768 MiB
Used : 54 MiB
Free : 32714 MiB |
Some settings in bios to have >4GB addressing + Resizable Bar activated in 2 places and this
Code: | ~ % cat /etc/modprobe.d/nvidia-rebar.conf
options nvidia NVreg_EnableResizableBar=1 |
|
|
Back to top |
|
|
|