I have a fedora guest OS in VMware. I want to expand /boot
partition, so I add another virtual disk to this VM, and try to clone the disk.
After dd if=/dev/sda1 of=/dev/sdb1
, blkid
report that /dev/sda1 and /dev/sdb1 have same UUID/GUID.
It's weird that there're 2 same UUIDs in the universe, how to change one of them to another UUID value?
Update 2017-01-25
Subject changed, UUID here means filesystem UUID, not partition UUID.
Since it's filesystem UUID, filesystem specific utils are needed to change the UUID, or use hexeditor to modify raw data on disk (DANGEROUS, not recommended unless you know what you are doing).
Best Answer
To generate a random new UUID, one can use:
To actually change the UUID is file system dependent.
Assuming ext-family filesystem
Or if you're confident uuidgen is going to work:
Assuming btrfs filesystem
The UUID is stored in the superblock, so a byte-for-byte copy of the filesystem will have the same UUID.