Notes

Copy one partition to another in Ubuntu Linux

Copy one partition to another using rsync, dd, or GParted

Edit on GitHub

Ubuntu

NOTE: Following are just for copying one partition from another, they don’t discuss generating new UUID and editing fstab that you will have to do if you want to change the mount points

With rsync

1sudo rsync /home/. /media/home/.

If you want to exclude some files, you can add them with the --exclude= flag, for example: --exclude='/*/.gvfs'

--exclude=PATTERN        exclude files matching PATTERN
--exclude-from=FILE      read exclude patterns from FILE

Check that the copying worked:

1sudo diff -r /home /media/home -x ".gvfs/*"

With dd

1sudo dd if=/dev/sdx1 of=/dev/sdy1 bs=64K conv=noerror,sync

/dev/sdx1 is the source partition (input) and /dev/sdy1 is the destination (output)

  • if provides input file (instead of the standard input)
  • of provides output file
  • bs means block size
  • noerror means do not stop processing on an input error

With gparted

In the GParted GUI, right click on the drive and select Copy, then right click on the drive where you want to copy to and select Paste