Ubuntu 20.04 Backing up disk using GParted how are UUIDs handled?

Nils Kassube kassube at gmx.net
Wed Dec 4 20:38:25 UTC 2024


On 04.12.24 Bo Berglund wrote:
> My Ubuntu 20.04.6 LTS Server has a single disk that is a bit too small, so I
> figured that I should use GParted standalone to copy its partitions to a new
> bigger drive.
> I have GParted on a bootable Ventoy USB stick.
>
> And while doing that I might only bring along the server and its used
> partitions.
> I might also enlarge/create a data partition on the copy using the extra space
> on that drive.
>
> But my /etc/fstab file has these entries:
>
> UUID=ec0e8708-8a6a-4bbf-93ba-0a09b1e2ddc1 / ext4 errors=remount-ro 0 1
> UUID=a77b40db-2377-4d25-b304-8d233664d1ca none swap sw 0 0
> UUID=42BE-49BB  /boot/efi vfat umask=0077 0 1
> UUID=389c6db9-3256-47ed-b67f-c11c76eed17f /home ext4 nodev,nosuid 0 2
> UUID=fb4a08b7-378e-42eb-9b7a-2c7b4f85cd06 /var/lib/svn ext4 nodev,nosuid 0 2
>
> As you can see the partitions that are mounted use UUID values to define which
> is mounted where.
>
> Now to the questions:
>
> 1) UUID
> If I copy the partitions themselves to another bigger drive as a backup or for
> migration, will the UUID of the partitions stay the same or are they
> re-generated so the source and destination can be told apart?

The UUID will be the same because it is a value inside the partition you copy.

> 2) Use of new disk
> If UUIDs stay the same, can I then put the bigger drive into the PC and boot it
> up and expect Ubuntu to come alive?
> That would essentially make it a backup drive copy....

That will only work reliably if you remove the smaller disk. If you have two partitions with identical UUIDs the system doesn't really know which partition is the wanted one. If you want to use both disks in the same machine, you should change the UUID of one of the partitions.


Nils







More information about the ubuntu-users mailing list