Sunday, August 3, 2014

Fixing the problematic duplicate UUID issue

A UUID is a universally unique identifier. For disks UUIDS are used to uniquely identify a particular disk irrespective of in which order and when it is loaded. E.g. A UUID can be used to tell the system to always boot from the specific partition with a specific UUID irrespective of which order it is loaded in e.g. if there are 2 hard disk it may be loaded as /dev/sdb but another type as /dev/sda it would not matter.

Duplicate UUIDs occur only in rare cases. The most common cause is if you have cloned a disk using some utility. (E.g. dd). Duplicate UUIDs in general are not good and can cause progblems because the identifiers are no longer unique on the system.


The steps to solve this issue are:


1) type “blkid” on the main server and the other server as root. And identify the partitions and their corresponding numbers in /dev E.g. /dev/sda1, dev/sda2 .. /dev/sdX etc.. Now we
need to change only those partitions whose UUIDs match the UUIDs of partitions on the server.

2) generate as many random UUIDs as needed for the partitions. Using the “uuidgen” command. Running “uuidgen” in terminal will generate a random UUID e.g.
“4ae70274-5b0f-4384-a7fd-15fcbdbd0b58″ do this twice or thrice or as many times as needed.

4) Assign these randomly generate UUID’s to the partitions. This needs root privileges; the command is “tune2fs /dev/sdX -U New-UUID-Value”
E.g.: sudo tune2fs /dev/sda2 -U 73c6756e-aad2-41f6-8dff-597fe076cd07

No comments:

Post a Comment