Linux Hotplug development
 help / color / mirror / Atom feed
* Behavior with duplicate UUID's
@ 2010-08-09  1:19 Scott Talbert
  2010-08-09  8:02 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Scott Talbert @ 2010-08-09  1:19 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-11  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09  1:19 Behavior with duplicate UUID's Scott Talbert
2010-08-09  8:02 ` Kay Sievers
2010-08-11  3:05 ` Scott Talbert
2010-08-11  8:17 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox