I seem to have partitions on two different disks with the same UUID: [tim at helen ~]$ sudo blkid /dev/sda2 /dev/sda2: LABEL="/boot1" UUID="5bbc8e95-6108-41f5-bc0e-5b5f8df5ce03" TYPE="ext3" [tim at helen ~]$ sudo blkid /dev/sdb2 /dev/sdb2: LABEL="/boot1" UUID="5bbc8e95-6108-41f5-bc0e-5b5f8df5ce03" TYPE="ext3" This is causing some confusion, as these are boot partitions, and grub2 seems to be choosing the wrong one. I wonder how this occurred; I thought different partitions on different disks necessarily had different UUIDs? Maybe I used dd at some point. Would this keep the same UUID? -- Timothy Murphy gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin
On 06/14/2015 07:55 PM, Timothy Murphy wrote:> I seem to have partitions on two different disks > with the same UUID: > [tim at helen ~]$ sudo blkid /dev/sda2 > /dev/sda2: LABEL="/boot1" UUID="5bbc8e95-6108-41f5-bc0e-5b5f8df5ce03" > TYPE="ext3" > [tim at helen ~]$ sudo blkid /dev/sdb2 > /dev/sdb2: LABEL="/boot1" UUID="5bbc8e95-6108-41f5-bc0e-5b5f8df5ce03" > TYPE="ext3" > This is causing some confusion, as these are boot partitions, > and grub2 seems to be choosing the wrong one. > > I wonder how this occurred; > I thought different partitions on different disks > necessarily had different UUIDs? > > Maybe I used dd at some point. > Would this keep the same UUID? >Interesting. And I thought uuid's were supposed to be unique on a system.
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. -- john r pierce, recycling bits in santa cruz
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