Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-install error. efi-directory is ignored
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 133

PostPosted: Sun Oct 20, 2024 3:55 pm    Post subject: grub-install error. efi-directory is ignored Reply with quote

Hi, I am trying to finish my new gentoo installation but grub-install fails and I don't quite understand why.

There are two partitions:
/dev/nvm1n1p1 <- mount point /efi, no encryption, vfat
/dev/nvm1n1p2 <- lvm, encrypted, contains root as xfs

/dev/mapper/vg0-root inside lvm with mount point /

/efi contains my vmlinuz files

The problem
Code:
#grub-install --efi-directory=/efi
Installing for x86_64-efi platform.
grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=y' in file `/etc/default/grub'.


What is going on? /efi is not encrypted. I believe grub-install tries to create something inside /boot because after executing
Code:
#grub-install --efi-directory=/efi

there is a folder grub inside /boot. And /boot is inside /dev/nvm1n1p2 which is encrypted. I assume this is the problem but why isn't the --efi-directory=/efi parameter working or what am I doing wrong?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5222
Location: Bavaria

PostPosted: Sun Oct 20, 2024 4:02 pm    Post subject: Reply with quote

You are doing nothing wrong ... except not believing what grub says: Set `GRUB_ENABLE_CRYPTODISK=y' in file `/etc/default/grub'.

grub consists of two parts: The first part will be copied into your ESP (as \efi\gentoo\grubx64.efi), the second part (together with the grub.cfg) is in /boot/grub/...

When you start your machine, then UEFI will start grubx64.efi from your ESP. This part of grub will start its 2nd part and therfore needs access to /boot. If /boot is part of your root partition and encrypted then grubx64.efi must be able to encrypt the root partition.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nxe9
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jun 2021
Posts: 133

PostPosted: Sun Oct 20, 2024 4:12 pm    Post subject: Reply with quote

Thank you. Now I understand it better and after activating this option, the grub-install works.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5222
Location: Bavaria

PostPosted: Sun Oct 20, 2024 4:13 pm    Post subject: Reply with quote

nxe9 wrote:
Thank you.

You are very Welcome! :D

Have fun with Gentoo! 8)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 512

PostPosted: Mon Oct 21, 2024 9:15 am    Post subject: Re: grub-install error. efi-directory is ignored Reply with quote

nxe9 wrote:
What is going on? /efi is not encrypted.


But /boot is encrypted. Grub needs to read /boot/grub/grub.cfg and later the kernel and initramfs.

If you are using LUKS2, please make sure that you do not use argon as PBKDF, otherwise Grub cannot unlock the LUKS container.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum