On 06/14/2015 08:58 PM, John R Pierce wrote:> On 6/14/2015 6:55 PM, Timothy Murphy wrote: >> Maybe I used dd at some point. >> Would this keep the same UUID? > > DD just does a blind block by block copy between two devices or files. > > >I thought that uuid had nothing to do with drive content, so dd would have (should have had) nothing to do with it. I thought it had to do with information when the device is queried (manufacturer's name (id), device model, date of manufacturer, serial number ....etc). But .... https://liquidat.wordpress.com/2013/03/13/uuids-and-linux-everything-you-ever-need-to-know/ says: After generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%. The probability of one duplicate would be about 50% if every person on earth owns 600 million UUIDs. Linux generates uuids in the file listed at https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c?id=refs/tags/v3.8 and you can generate new ones via proc: $ cat /proc/sys/kernel/random/uuid eaf3a162-d770-4ec9-a819-ec96d429ea9f There is also the library libuuid <http://linux.die.net/man/3/libuuid>which is used by |uuidgen|and especially by the ext2/3/4 tools E2fsprogs to generate UUIDs: $ uuidgen f81cc383-aa75-4714-aa8a-3ce39e8ad33c
On 06/14/2015 10:08 PM, jd1008 wrote:> > > On 06/14/2015 08:58 PM, John R Pierce wrote: >> On 6/14/2015 6:55 PM, Timothy Murphy wrote: >>> Maybe I used dd at some point. >>> Would this keep the same UUID? >> >> DD just does a blind block by block copy between two devices or files. >> >> >> > I thought that uuid had nothing to do with drive content, > so dd would have (should have had) nothing to do with it.You thought wrong. The UUID for a GPT partition is a number that is recorded in the GPT. The UUID for a filesystem is a number that is recorded in the filesystem super block. The UUIDs for LVM physical or logical volumes are numbers recorded in the LVM header. Etc., etc., etc. When you use dd to copy them, the UUIDs get copied too, and significant confusion can result. Now, the drive itself does have a UUID derived from information that includes the serial number. But, unless you are referencing the drive by /dev/disk/by-uuid/*, you are not making use of it. I've occasionally used /dev/disk/by-id/xxx to select a particular drive partition that could not be reliably identified in any other way (encrypted swap partition on a non-GPT drive), but I don't recall ever using /dev/disk/by-uuid/. -- Bob Nichols "NOSPAM" is really part of my email address. Do NOT delete it.
On 06/15/2015 07:56 AM, Robert Nichols wrote:> On 06/14/2015 10:08 PM, jd1008 wrote: >> >> >> On 06/14/2015 08:58 PM, John R Pierce wrote: >>> On 6/14/2015 6:55 PM, Timothy Murphy wrote: >>>> Maybe I used dd at some point. >>>> Would this keep the same UUID? >>> >>> DD just does a blind block by block copy between two devices or files. >>> >>> >>> >> I thought that uuid had nothing to do with drive content, >> so dd would have (should have had) nothing to do with it. > > You thought wrong. The UUID for a GPT partition is a number that is > recorded in the GPT. The UUID for a filesystem is a number that is > recorded in the filesystem super block. The UUIDs for LVM physical > or logical volumes are numbers recorded in the LVM header. Etc., > etc., etc. When you use dd to copy them, the UUIDs get copied > too, and significant confusion can result. > > Now, the drive itself does have a UUID derived from information > that includes the serial number. But, unless you are referencing > the drive by /dev/disk/by-uuid/*, you are not making use of it. > I've occasionally used /dev/disk/by-id/xxx to select a particular > drive partition that could not be reliably identified in any other > way (encrypted swap partition on a non-GPT drive), but I don't > recall ever using /dev/disk/by-uuid/. >Thanx for the update but what about non-gpt and non lvm partitions? What is used as inp nut to create a universally unique id? (Actually, for an id to be universally unique, one would almost nee knowledge of all existing id's. So, I do not have much credence in this universal uniqueness.