Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Device naming in Dracut
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
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1688

PostPosted: Mon Oct 28, 2024 7:55 pm    Post subject: Device naming in Dracut Reply with quote

Greetings Gentooers I just stumbled thru my first install using Dracut to generate a initramfs.
Its a Linux router 'appliance', GPT partitioned drive, old dos style BIOS, openRC.
I am wondering why and how Dracut just makes up names for stuff like LVM volume groups and dm_crypt luks devices?
The reason I ask is it did not follow how I named them,
for example this system has several gpt partitions one is LVM and one of the volume groups has an encrypted root that is the Gentoo root (/) it needs to switch_root to.

When I built the system I named the LVM volume path /dev/ssd1/gentoo_root and the volume group is gentoo_root
like so
Code:
 
   --- Logical volume ---
LV Path                /dev/ssd1/gentoo_root
  LV Name                gentoo_root
  VG Name                ssd1


Then when ran I cryptsetup on the LV I made the dm_crypt device gentoo_root
and it resides at
Code:
/dev/mapper/gentoo_root


So from a live USB to enter the chroot I mount the root file system after I run
Code:
 cryptsetup luksOpen /dev/ssd1/gentoo_root gentoo_root

The grub configuration used
Code:
root=/dev/mapper/gentoo_root


I fumbled thru the Dracut guide a few times
https://wiki.gentoo.org/wiki/Dracut
The initramfs that Dracut makes expects completely different names,
for my LVM LV name it chose
Code:
/dev/mapper/ssd1-gentoo_root

and the dm_crypt Luke volume to be named luks-<UUID> where <UUID> is the uuid of the luks volume.

I poked around in Dracut and its configs and did not see a way to tell Dracut how I would like things named.
I instead got it working by just changing the root= parameter in my grub.cfg which is fine for me and it boots fine.


However I am curious if there is a way to specify / override device naming in Dracuts udev (or whatever it uses) to name devices ?
It would be a useful thing to add to the Dracut Gentoo wiki to aid other users (unless I missed something)
Or if you cant use custom names then it would be preferable for users to generate the UDEV or whatever generated names earlier in the install process so there is not a conflict with grub or another boot loader.
In the past when I had made initramfs and initrd's all the info was put in by hand, and after the initrd ran there was no need to have a that info in fstab or crypttab as the root device is already mounted.
But with Dracut I'd imagne there should be a dratab file that contains logical volume names and luks names and mount points?
Its nice that Dracut tries to auto-magicly generate that info from a running system, but it is not getting it correct from mine, or ther may be cases when a user needs to change something, so I think Dracut would work better for me if it was setup like /etc/grub.d and have auto generated files the user can edit if needed.
Also it did not seem to correctly copy over any kernel modules to the initramfs, I was under the impression it would.
That was not a show stopper as all I had to do was compile in the crypt stuff, but again it would be good if that was more clear in the wiki.
Thanks in advance for any advice, thought and or feedback on using Dracut.
_________________
Donate to Gentoo
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