Hello,
I am looking at udev's behavior when duplicate UUID's are present (ie,
partition a and partition b both have the same UUID) in a system. Yes,
this is a rather rare case, but it can happen if, for instance, one
partition is cloned to another.
Right now, it appears that the behavior for creating the /dev/disk/by-uuid
links is "last one in wins." For example, if I have /dev/sda1 with UUID X
in a system, and then add another drive with a /dev/sdb1 with UUID X,
/dev/sdb1 ends up with its link in /dev/disk/by-uuid. It would seem to me
that "first one in wins" might be a better approach. That is, when
/dev/sdb1 comes along later, /dev/sda1's link would persist in
/dev/disk/by-uuid.
Thoughts? I modified the existing rule slightly (see below) and this
seems to implement the "first one in" behavior.
--- /lib/udev/rules.d/60-persistent-storage.rules 2010-04-19 05:30:29.000000000 -0400
+++ parted/60-persistent-storage.rules 2010-08-08 20:43:45.000000000 -0400
@@ -63,7 +63,7 @@
KERNEL!="sr*", OPTIONS+="watch"
# by-label/by-uuid links (filesystem metadata)
-ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", TEST!="/dev/disk/by-uuid/$env{ID_FS_UUID_ENC}",
SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*",
SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
# by-id (World Wide Name)
--
Thanks,
Scott Talbert
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html