In this article, we have explained how to modify UUID of partition in Linux.
UUID is used to identify the partition. It is stands for Universally Unique IDentifier of a partition. You can check UUID in /etc/fstab file.
How to Find UUID of Your Filesystems
To find the UUID of your partitions, you can use blkid command as shown.
# blkid | grep UUID
How to modify UUID of the partition
It is very easy to change UUID of a filesystem. For that we can use tune2fs command. Use following command to change UUID of the partition.
The partition has to be unmounted prior apply the new UUID:
# umount /dev/sdb1
# tune2fs /dev/sdb1 -U random /dev/sdb1 # blkid | grep sdb1
Replace /dev/sdb1 to your desired partition.
The UUID has been successfully changed. Now you can mount the filesystem back again.
# mount /dev/sdb1
You can also update your /etc/fstab if needed, with the new UUID.
Note: After you update /etc/fstab file with new UUID, you must use mount -a command before system reboot. This is because if you enter any wrong character in fstab file, you can correct it right now. If you reboot the system without verifying fstab, it will corrupt you system. So safe side is run mount -a command.
We have successfully modify UUID of partition in Linux.
[Need assistance to fix this error or install tools? We’ll help you.]