Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
repopulate /dev/disk/by-uuid with device mapper devices?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 168

PostPosted: Sun Jun 15, 2014 6:24 pm    Post subject: repopulate /dev/disk/by-uuid with device mapper devices? Reply with quote

I have a program that needs to read the uuids links from /dev/disk/by-uuid but they don't exists on my system.

The problem is caused by cryptsetup and my initramfs. All disks except for the bootdisk use full disk encryption. I boot into my own initramfs with devtmpfs for /dev and setup the crypto mappings there. Then I mount the real root, unmount /dev and switch_root to the real root. The real init will start udev but at that point the crypto mappings has already been setup and udev will not populate /dev/disk/by-uuid.

If I manually mount an encrypted filesystem after boot it will appear in /dev/disk/by-uuid. That's because cryptsetup will send some signal to udev informing it about the change. I can't figure out how to trigger this manually without remounting all filesystems.
"dmsetup mknodes" will recreate the files in /dev/mapper but not /dev/disk/by-uuid. I've also tried "udevadm trigger" but that doesn't work either.
Back to top
View user's profile Send private message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 168

PostPosted: Mon Jun 16, 2014 12:34 am    Post subject: Reply with quote

Neither of these commands works even though they should.
udevadm trigger --verbose --subsystem-match=block --sysname-match=dm-* --action=add
udevadm trigger --verbose --subsystem-match=block --sysname-match=dm-* --action=change


Running udevadm info /dev/dm-5 shows that the flag DM_UDEV_DISABLE_DISK_RULES_FLAG is set and that cause udev to skip all rules in /lib/udev/rules.d/13-dm-disk.rules including the one that setup the /dev/disk/by-uuid/ links. So why is DM_UDEV_DISABLE_DISK_RULES_FLAG set? I don't know. It's set in 10-dm.rules but all these udev rule files are nothing but global variables & goto spaghetti code mess.

I feel tempted to just create a script to get the uuids with blkid and create the links myself.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Jun 16, 2014 1:49 am    Post subject: Reply with quote

tholin wrote:
I feel tempted to just create a script to get the uuids with blkid and create the links myself.

tholin ... you might want to look at mdev-like-a-boss, it has a 'storage-device' script which could be adapted for this purpose.

HTH & best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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