How to change the UUID of a partition

UUID is the abbreviate of Universally Unique IDentifier. This ID is used in several places to identify the partitions in your system, both Windows and Linux partition. The most notable used of UUID is in /etc/fstab file, which manages the mounting of partitions at boot time. Normally, its very rare for 2 different partitions to have the same UUID. But there may be cases where you clone a partition using DD or Clonezilla and the clone resides on the same machine – different physical hard drive or partition. And in this case, you will need to change the UUID of a partition.

First, you will need to find the device paths and the UUID's of the partitions in your system, you can use the command "blkid" as root:

change UUID

Now you see the device paths and the UUID's of all the partitions. If there are 2 partitions that have the same UUID, you will need to generate a new UUID, the command will be:
 uuidgen  

And you will have a new UUID like this:


Now you have a new UUID, copy this UUID then apply it into the following command to change the UUID of a partition, say /dev/sda6:
 sudo tune2fs /dev/sda6 -U new-UUID-code  

Now the partition /dev/sda6 has a new UUID. Also remember to update your grub to include the correct UUID’s to reduce any risk of your system confusing the partitions.
linux tips and tricks