Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub does not find the disk
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
bb078pjzqk2m
n00b
n00b


Joined: 10 Jan 2024
Posts: 3

PostPosted: Wed Jan 10, 2024 1:47 am    Post subject: Grub does not find the disk Reply with quote

Hello, this is my first time installing Linux manually - Gentoo with LUKS and OpenRC. I'm a bit confused how to install it properly, because in the handbook I didn't find the correct GRUB configuration with LUKS. I am using Genkernel in generating initramfs with --luks. I dont use LVM

blkid output in chroot
Code:
/dev/nvme0n1p1: UUID="6D53-47C8" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="a1aa3a27-aaba-db45-9b35-3c5ba01ebaab"
/dev/nvme0n1p2: UUID="a10b9866-346d-40ed-b225-f3c63dab0e07" TYPE="crypto_LUKS" PARTUUID="9c3a6be4-4bde-224e-b812-2ad7dcb39e50"
/dev/mapper/encrypted: LABEL="rootfs" UUID="20bdbc5b-36b8-4727-87f8-4734d2c414ec" BLOCK_SIZE="4096" TYPE="ext4"


lsblk output in chroot
Code:
nvme0n1       259:0    0 931.5G  0 disk 
├─nvme0n1p1   259:2    0   512M  0 part  /efi
└─nvme0n1p2   259:3    0   931G  0 part 
  └─root            253:0    0   931G  0 crypt /


/etc/default/grub
Code:
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX="crypt_root=UUID=a10b9866-346d-40ed-b225-f3c63dab0e07:root root=/dev/mapper/root rootfstype=ext4"
GRUB_DISABLE_LINUX_PARTUUID=false


/etc/fstab
Code:

UUID="6D53-47C8"                                    /efi        vfat      defaults            0 2
UUID="20bdbc5b-36b8-4727-87f8-4734d2c414ec"         /           ext4      defaults,noatime    0 1


Grub output with error
Code:
Welcome to GRUB!
error: no such device: 20bdbc5b-36b8-4727-87f8-4734d2c414ec.
error: unknown filesystem.
Entering rescue mode...


Please help me with this problem. I think the problem is in wrong grub configuration
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1695

PostPosted: Wed Jan 10, 2024 2:11 am    Post subject: Reply with quote

Being genkernel, the crypt_root bit is incorrect, it should be:
Code:
GRUB_CMDLINE_LINUX="crypt_root=UUID=a10b9866-346d-40ed-b225-f3c63dab0e07 root=/dev/mapper/root rootfstype=ext4"


Also, since /boot is encrypted, GRUB will need device-mapper USE enabled so it can access its modules and configuration. This should prompt for unlocking the device twice as well.
Back to top
View user's profile Send private message
bb078pjzqk2m
n00b
n00b


Joined: 10 Jan 2024
Posts: 3

PostPosted: Wed Jan 10, 2024 3:03 am    Post subject: Reply with quote

grknight wrote:
Being genkernel, the crypt_root bit is incorrect, it should be:
Code:
GRUB_CMDLINE_LINUX="crypt_root=UUID=a10b9866-346d-40ed-b225-f3c63dab0e07 root=/dev/mapper/root rootfstype=ext4"


Also, since /boot is encrypted, GRUB will need device-mapper USE enabled so it can access its modules and configuration. This should prompt for unlocking the device twice as well.


Thanks, but that didn't solve the problem
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 376

PostPosted: Wed Jan 10, 2024 9:29 am    Post subject: Reply with quote

You are missing

Code:
GRUB_ENABLE_CRYPTODISK=y
in your /etc/default/grub. Then recreate the grub.cfg.
Back to top
View user's profile Send private message
bb078pjzqk2m
n00b
n00b


Joined: 10 Jan 2024
Posts: 3

PostPosted: Wed Jan 10, 2024 1:42 pm    Post subject: Reply with quote

sMueggli wrote:
You are missing

Code:
GRUB_ENABLE_CRYPTODISK=y
in your /etc/default/grub. Then recreate the grub.cfg.


I found the cause of the problem - I was using LUKS2 and GRUB 2.06. I converted the keys from argon2i to pbkdf2 and installed GRUB 2.12. But also why I need to enter the password 2 times. What could this be related to?
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1695

PostPosted: Wed Jan 10, 2024 1:53 pm    Post subject: Reply with quote

bb078pjzqk2m wrote:
But also why I need to enter the password 2 times

You need to enter it once for GRUB so it can find its configuration and the kernel (since /boot is encrypted).
The kernel does not receive anything from GRUB beyond a simple text string.
The kernel then must unlock the device for it to use and all programs started under the kernel.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2965
Location: Edge of marsh USA

PostPosted: Thu Jan 11, 2024 5:28 am    Post subject: Reply with quote

Don't put quote marks around the UUID in /etc/fstab.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 376

PostPosted: Thu Jan 11, 2024 10:31 am    Post subject: Reply with quote

figueroa wrote:
Don't put quote marks around the UUID in /etc/fstab.


Why not? Do you have any link?

And the man page (man 5 fstab) contains examples with double quotes:

Quote:
(e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3")
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2965
Location: Edge of marsh USA

PostPosted: Thu Jan 11, 2024 5:40 pm    Post subject: Reply with quote

sMueggli wrote:
figueroa wrote:
Don't put quote marks around the UUID in /etc/fstab.


Why not? Do you have any link?

And the man page (man 5 fstab) contains examples with double quotes:

Quote:
(e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3")

The entire reference for your example is for using UUID in the mount command:
Code:
Note that mount(8) uses UUIDs as strings. The string representation of
the UUID should be based on lower case characters. But when specifying
the volume ID of FAT or NTFS file systems upper case characters are
used (e.g UUID="A40D-85E7" or UUID="61DB7756DB7779B3").

However, I just did a little experiment, and in back-to-back tests, I discern that quotes around the UUID don't appear to matter for mount or in fstab. Therefore, sorry for the red herring.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1695

PostPosted: Thu Jan 11, 2024 5:49 pm    Post subject: Reply with quote

figueroa wrote:
However, I just did a little experiment, and in back-to-back tests, I discern that quotes around the UUID don't appear to matter for mount or in fstab. Therefore, sorry for the red herring.

Just as a note, please don't do this for a kernel command-line option when passed to genkernel as it cannot parse quotes correctly.
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