Ubuntu – Copying contents of a small partition over contents of a larger one using GParted

gpartedpartitioning

I want to copy the casper-rw partition contents of one device OVER the the casper-rw partition of the other device, using GParted tool and here described procedure. (Note: casper-rw partition in the above mentioned configuration holds data and settings. That's the reason I want to copy the casper-rw partition).

I don't want to change the structure or size of the casper-rw partition on the destination device – all I want is to gain more room for that partition while preserving the settings and data already on the source (smaller) device.

My understanding is that the first step is to unallocate the destination casper-rw partition. The second step is to copy/paste the casper-rw source partition over the unallocated partition.

Now the questions:

  • How to unallocated the destination casper-rw partition?
  • Will the copy/paste procedure use all unallocated space – or I'll
    have to do more in order to add remaining space to the casper-rw
    partition?

Alternative solution:

Instead of using GParted, I can run (dry run):

sudo rsync -Havn

and then, if everything looks ok, no error message, eventually run

sudo rsync -Hav

to copy files and folders. I believe that

rsync

is not going to change the SIZE of the destination partition.

Best Answer

I don't know if GParted would solve the problem (copy/paste partition without changing the size). But with the help of the rsync command I was able to copy all the files from the source partition to the destination partition while preserving the size of the destination partition. Specifically:

sudo rsync -Hav /media/ubuntu/casper-rw1/ /media/ubuntu/casper-rw2/

I'd recommend to precede it by "dry run" (the -n option) and save the output in a log file, in case the rsync command outputs error messages.