From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Talbert Date: Mon, 09 Aug 2010 01:19:49 +0000 Subject: Behavior with duplicate UUID's Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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