While following the instructions in Move your Linux installation to a new Solid State Drive – even a smaller one, I got stuck right after point "9." where I have copied the UUID of sdb6 (filesystem of the running ubuntu on HDD) on sda1 (wannabe new filesystem in the SSD) using tune2fs.
While I try to get un-stuck…(I'll post a thread soon about it) is it a problem to run the system while having the same UUID on two partitions?
If so, considering as well that I don't know the original UUID of the sda1 partition, would it be ok to just invent one, for example by changing a character of the UUID?
System information
Ubuntu 16.04
$ fdisk -l
Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
...
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 225282211 225280164 107.4G 83 Linux
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
...
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 318919887 318917840 152.1G 7 HPFS/NTFS/exFAT
/dev/sdb2 318920702 976771071 657850370 313.7G 5 Extended
/dev/sdb5 960151552 976771071 16619520 7.9G 82 Linux swap / Solaris
/dev/sdb6 318920704 960151551 641230848 305.8G 83 Linux
Best Answer
Some system tools refer to partitions by UUID numbers. This is common in
/etc/fstab
, for instance; partitions are identified for mounting by their UUID numbers rather than in some other way. Thus, duplicate UUID numbers can cause confusion and inconsistency -- on one boot, one partition might be mounted; but on another mount, the other partition might be mounted. This could create problems if files on that partition are changed, as is likely on most partitions.You can learn what UUID a partition uses via the
blkid
command:This example reveals that
/dev/sdc3
has a UUID of 5028fa50-0079-4c40-b240-abfaf28693ea.You can change a UUID with various filesystem-specific tools. For ext2/3/4fs, this tool is called
tune2fs
, and you pass it the-U
option to change a UUID. You will, however, need a new UUID, and you can generate this with theuuidgen
tool, which you can call as part of the call totune2fs
:You'd need to change the device ID (
/dev/sdc3
in this example) for your system, of course.If your partition uses a filesystem other than ext2/3/4fs, you'll need to use a tool other than
tune2fs
, such asxfs_admin
for XFS orbtrfstune
for Btrfs.If the partition is being mounted in
/etc/fstab
, identified by UUID in agrub.cfg
file, or otherwise referenced, you may need to adjust that configuration file after making your change.