How to Duplicate a Specific UUID to an Existing SSD or HDD

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5821
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

How to Duplicate a Specific UUID to an Existing SSD or HDD

Post by Lady Fitzgerald »

Warning! The disk to have its UUID replaced with a duplicate UUID must be connected to or installed in a computer other than the one with the disk with the original UUID.

1. Find UUID to be duplicated using Disks.

2. Make sure partition or drive to receive the new UUID is unmounted using Disks.

3. Run filesystem check on the target disk or partition in terminal. This step is mandatory even if it seems unnecessary.

sudo e2fsck -f /dev/sdb1

Replace sdb1 with the correct device name getting the new UUID.

4. Run the following in the terminal. Replace sdb1 with the correct device name and replace the UUID shown here with the correct new UUID.

sudo tune2fs /dev/sdb1 -U 39ea80c4-e748-47eb-835c-64025de53e26

This may take a while.

5. Using Disks, check to verify the UUID has been changed correctly.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
vimes666
Level 6
Level 6
Posts: 1241
Joined: Tue Jan 19, 2016 6:08 pm

Re: How to Duplicate a Specific UUID to an Existing SSD or HDD

Post by vimes666 »

Why would you do that?
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5821
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: How to Duplicate a Specific UUID to an Existing SSD or HDD

Post by Lady Fitzgerald »

vimes666 wrote: Wed Mar 06, 2024 3:37 pm Why would you do that?
One situation is you may need to replace a data drive that died and you have to rebuild it from or more backups, downloads from the "interwebz", etc. in which case the drive's UUID will be different than from the original drive's UUID. In a case like this, it may be simpler to replace the new drive's UUID with the original one rather than go into the OS and programs that use the original UUID and change all those parameters to the new UUID.

Another situation is, to avoid tying up the computer while cloning a replacement drive (to get more capacity or a faster drive), you can use an advanced copy program (such as FreeFileSync) to just copy the data from the old drive to the new drive which would allow you to keep using the computer while the copying is going on. Same as above, it may be easier to just change the new drives UUID back to the original UUID than to have to correct fstab entries and any entries in programs that look for the UUID of a drive.

Granted, this procedure is one for a very limited use case that most people will never encounter but, at least, it is here for the rare times when it will be useful. For the rare person who will need it, this tutorial will save them the hours of research and experimentation it took me to find out how to do it.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
Post Reply

Return to “Tutorials”