You are not logged in.

#1 2013-10-29 15:16:13

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 294

non-unique UUIDs of partitions

The arch wiki for cloning a disk says:

"This will clone the entire drive, including MBR (and therefore bootloader), all partitions, UUIDs, and data. "
(...)
"Note: To regain unique UUIDs, use "tune2fs /dev/sdbX -U random" on every partitions."

I did not do the Note.

Could Linux get confused when booting with both disks at the same time now, because there are non-unique UUIDs for partitions? Or what would happen?

Thanks!

Offline

#2 2013-10-29 15:18:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: non-unique UUIDs of partitions

Boot and see what happens :-)
I think you should run tune2fs and adjust fstab etc.

Offline

#3 2013-10-29 15:31:07

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 18,993

Re: non-unique UUIDs of partitions

aardwolf wrote:

Could Linux get confused when booting with both disks at the same time now, because there are non-unique UUIDs for partitions?

Yes.

Or what would happen?

I would say that it indeterminate.  It may pick the first one it finds, it may pick the last one it finds.  Depending on when the drives come on-line, that order may change.  It may note there are identical UUIDs and pitch a warning or an error (but I doubt it).  As Karol says, try it;  but then, come back and tell us.  Even better, put it in the wiki.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2013-10-29 15:56:00

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: non-unique UUIDs of partitions

Note that what might happen could vary from one system to another, so one person's experimentation is not really all that useful. For that matter, what happens could vary from one boot of one system to another boot of the same computer. The solution is to fix the problem by using tune2fs (or equivalent tools for non-ext2/3/4 filesystems). You can do this long after copying the disk, but if you want to use the disk whose UUIDs you change, you'll probably have to adjust the /etc/fstab file. OTOH, if you're copying the disk so as to replace the original, and you intend to wipe the original clean or destroy it, there's not much need for any of this; just do the copy, pull the old disk, and everything should be fine.

One more point: If the disk uses the new GUID Partition Table (GPT), then both the partition table itself and every partition on the disk has its own GUID, which is similar to a UUID -- in fact, some Linux tools refer to the partition GUIDs as PARTUUIDs. They must be updated, too, if both disks are to be kept available in the same computer. This can be done quite easily with sgdisk:

sgdisk -G /dev/sdb

This command randomizes the GUIDs for /dev/sdb and all its partitions. This does not affect the filesystem UUIDs, though. This command should not be used on disks that are partitioned using the older MBR system, which doesn't have unique partition IDs of any type.

Offline

#5 2013-10-29 16:01:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 18,993

Re: non-unique UUIDs of partitions

srs5694 wrote:

Note that what might happen could vary from one system to another, so one person's experimentation is not really all that useful.

You are, of course, absolutely correct.  What I was actually thinking was to see if the system pitched an error or a warning.  I think that would be universal.  Other non deterministic behavior that could be perceived as "Random" would (could) vary from machine to machine, or from one boot to the next.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2013-10-29 17:56:03

aardwolf
Member
From: Belgium
Registered: 2005-07-23
Posts: 294

Re: non-unique UUIDs of partitions

I already did the disk copy, but want to re-do the copy, because I messed up with the disk copy (working on the computer and changing the source disk during the copying).

So to re-do the copy, I would have to boot up the computer with these two disks at some point.

Will the UUID collision cause problems immediately, or would it only cause a problem if I mount the extra disk? (Which I'm not planning to do).

Thanks.

Offline

#7 2013-10-29 17:59:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: non-unique UUIDs of partitions

You can boot with one disk at a time: first connect just the disk you copied the data into, fix the UUID, poweroff and connect the other drive.

Offline

Board footer

Powered by FluxBB