View previous topic :: View next topic |
Author |
Message |
burningserenity n00b
Joined: 18 Jul 2022 Posts: 65
|
Posted: Tue Jul 19, 2022 9:36 pm Post subject: Dracut mounts root incorrectly |
|
|
Working through this: https://forums.gentoo.org/viewtopic.php?p=8728082#8728082 I found that dracut is not mounting my root filesystem correctly.
I am using an encrypted root and I get the prompt to enter the password for it when I boot. Once I do, the system hangs for several minutes until dracut errors out, saying it couldn't find my root fs.
In the dracut rescue console, I see that /dev/mapper doesn't have the root partition mounted like I expect (/dev/mapper/root), but has it mounted as /dev/mapper/luks-<hexcode>.
I tried recreating the initramfs from the Gentoo livecd with the cryptroot mounted exactly as it appears in the dracut console, but the result is the same. The path is now ostensibly correct, but dracut still can't find the decrypted root partition.
Next, I recreated the initramfs with the old partition name, root.
What does work is unmounting and closing the cryptroot, then opening and remounting it as /dev/mapper/root, and exiting the dracut console. From here, OpenRC inits and I can get to my login console.
So my question now is, how can I get dracut to mount the filesystem correctly? I tried setting dracut to use my fstab, also tried booting off of the UUID instead of the path in combination, but dracut never seems to pick up this information. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3882
|
Posted: Tue Jul 19, 2022 11:12 pm Post subject: |
|
|
Just make sure you have an entry in
/etc/crypttab
Code: |
root UUID=<UUID of encrypted partition> none luks,discard,initramfs
|
Likewise in
/etc/default/grub
Code: |
GRUB_CMDLINE_LINUX="cryptdevice=UUID=<UUID of encrypted partition>:root root=/dev/mapper/root..........."
GRUB_PRELOAD_MODULES="part_msdos part_gpt lvm luks"
|
Make sure grub is built with "device-mapper".
Also in fstab you have no luks stuff.
Just
Code: |
/dev/mapper/root / .............etc
|
Rebuilt dracut,update grub and enable dmcrypt@boot. _________________
|
|
Back to top |
|
|
burningserenity n00b
Joined: 18 Jul 2022 Posts: 65
|
Posted: Wed Jul 20, 2022 1:09 am Post subject: |
|
|
I set the root in my grub config to use the UUID instead of the file path, now it works. |
|
Back to top |
|
|
|
|
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
|
|