RemixVSL / iomemory-vsl

Updated Fusion-io iomemory VSL Linux (version 3.2.16) driver for recent kernels.
150 stars 27 forks source link

UUID is shared between all partitions #130

Open rumblpak opened 3 months ago

rumblpak commented 3 months ago

https://github.com/RemixVSL/iomemory-vsl/blob/0a12f1507186a8088697588a8f9462babbf8279e/tools/udev/rules.d/60-persistent-fio.rules#L38

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 commented 3 months ago

@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 commented 3 months ago

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 commented 3 months ago

@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 commented 3 months ago

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. 🤷‍♂️