Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID is shared between all partitions #130

Open
rumblpak opened this issue May 15, 2024 · 4 comments
Open

UUID is shared between all partitions #130

rumblpak opened this issue May 15, 2024 · 4 comments

Comments

@rumblpak
Copy link

KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s UUID -o value /dev/%P%n", SYMLINK+="disk/by-uuid/%c"

Using this blkid output, all partitions share the same uuid which causes the last partition to be the only partition listed in /dev/disk/by-uuid. This could be fixed by using UUID_SUB like this:

KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s UUID_SUB -o value /dev/%P%n", SYMLINK+="disk/by-uuid/%c"

I'm not 100% sure why this is happening locally to me but that definitely fixes populating /dev/disk/by-uuid/ for me.

@snuf
Copy link
Collaborator

snuf commented May 15, 2024

@rumblpak thanks for bringing this up, I'm not a btrfs user on my fio drive so haven't encountered this!

Afaik UUID_SUB is a btrfs-ism, and is used for volumes, no other FS seems to use it(?). The solution won't work for anyone not using btrfs, as it would return empty. The solution could be to run the UUID_SUB rule before the UUID rule?

@rumblpak
Copy link
Author

I’m actually a zfs user, still though, I’m just using fdisk to create two partitions and putting zfs on top of that. I feel like there could be a change to help both use-cases.

@snuf
Copy link
Collaborator

snuf commented May 15, 2024

@rumblpak today I learned. Never noticed the UUID_SUB with blkid before for my ZFS volumes on Linux.

I do think you can add the UUID_SUB, that said it will still execute the UUID rule leaving you with the last entry as the main UUID, which probably is not desirable. In my case when testing it shows an empty for UUID_SUB, so no harm there. Getting the UUID correct icw the UUID_SUB would require some more finagling it seems.

@rumblpak
Copy link
Author

I do think adding this before the UUID line would fix it for newer versions of udev where the := operator is supported:

KERNEL=="fio[a-z][0-9]*", ENV{DEVTYPE}=="partition", PROGRAM="/sbin/blkid -s UUID_SUB -o value /dev/%P%n", ENV{ID_FS_UUID_SUB}="$result", ENV{ID_FS_UUID_SUB}!="", SYMLINK:="disk/by-uuid/%c"

I've noticed that the symlinks for by-id and by-path aren't being created at all even though udevadm test seems to indicate that it is doing it. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants