When dealing with partitions there are 2 ways to move their content. You can either make an exact copy of the partition(s) using a tool such as dd
or copy the contents of the partition(s).
exact copies
This approach will not only copy the content but also the filesystem's metadata too. Depending on what you're trying to accomplish this may be a good or bad thing.
NOTE: You're literally making a byte for byte copy of the drive.
For example, say you have 2 harddrives, 1TB & 2TB. Let's imagine that all your data is currently on the 1TB and you'd like to move/migrate it to the 2TB drive. If you were to enlist the help of dd
, you'd only be able to clone the drive as is onto the 2TB drive, there by wasting the balance of the larger space.
$ sudo dd if=/dev/sda of=/dev/sdb
copying data
The other approach is to createcompletely discrete drives/partitions from one another. Then copy the contents of the partition on the 1TB drive (/dev/sda1) to a partition on the 2TB drive (/dev/sdb1), using a tool such as rsync
.
Once you have the partitions squared away you'll need ot mount them:
$ sudo mount /dev/sda1 /media/ssd
$ sudo mount /dev/sdb1 /media/backup-drive/ssd-backup
And then use rsync
to copy:
$ sudo rsync -ax /media/ssd /media/backup-drive/ssd-backup
dd
?cat
is faster and less error-prone (i
ando
are so close on most keyboards). – Gilles 'SO- stop being evil' Aug 22 '13 at 21:28