I'm used to finding the answers to all my technical questions with a couple of 'net searches but information in this area seems a bit scarce.
The typical scenario is that a partition has been backed up using a cloning tool like parted, then various problems appear due to the duplicated UUID. The accepted solution is to alter the volume label on the backup partition using mlabel [mtools] and then edit /etc/fstab to have the backup partition identified using LABEL="WinWhatever" instead of UUID=89C9589FC4162F5. That's not necessarily the end of the story though. A live CD or reinstaller will again trip over the duplicate UUID.
A more robust solution is to alter the UUID on the backup partition and create a record of the original UUID at the same time, in case the master partition crashes and is unrecoverable. First let's see what we've got:-Make a note of the partition number X of the backup partition. Use that number instead of X in all the comands below.Code:sudo blkid
Now let's grab the superblock:-And edit it using hexeditor [ncurses-hexedit]:-Code:sudo dd if=/dev/sdaX of=~/superblockX bs=512 count=1The UUID shown by blkid earlier will match the volume serial number which you should see at 0x43-0x46 for VFAT or 0x48-0x4f for NTFS. Change it somehow and save.Code:sudo hexeditor ~/superblockX
[Optional sanity check: "ls -l ~/superblockX" The file should still be exactly 512 bytes].
Copy the modified file back to the superblock. I don't need to mention how risky this part is. Be sure you know what you're doing.Next edit /etc/fstab with a line identifying the backup partition via its new UUID. You might want to add noauto to the options if you don't want it mounted automatically all the time. Finally, I suggest mounting the backup partition and adding a tag file to its root directory. The file name should indicate the original UUID prior to editing, eg. 540C-0199.vol, as this will be needed if the master partition ever crashes catastrophically or needs to be restored.Code:sudo dd if=~/superblockX of=/dev/sdaX bs=512 count=1
I hope this process will all be automated one day. See this bug report.
Please post back if you spot errors or if there are just better ways to do the above. I haven't tested this on an NTFS partition yet.
References:
How FAT32 volume serial numbers are calculated.
Some info on NTFS.
Bookmarks