Backup using disk dump – dd

Note: The following commands have all to be run as the super user (root) as raw access to partitions is not permitted to normal users.

A simple bit by bit backup of the partition 9 on the hard disk /dev/sdx:

dd if=/dev/sdx9 of=imagefile bs=2048

You can also pipe it into gzip to compress the image and split it then into DVD-sized parts:

dd if=/dev/sdx9 | gzip -9 | split -b 4200m - /target/backup.gz

To restore do:

cat /target/backup.gz* | gzip -dc | dd of=/dev/sdx9

Similar or more Elaborate Tools for Linux / Unix as Live ISOs

Similar tool for NTFS windows partitions: ntfsclone

Clone NTFS partition /dev/hda1 to /dev/hdc1:

ntfsclone --overwrite /dev/hdc1 /dev/hda1

Save an NTFS to a file (using a special image format):

ntfsclone --save-image --output backup.img /dev/hda1

Restore an NTFS from a special image file to its original partition:

ntfsclone --restore-image --overwrite /dev/hda1 backup.img

resources

Comments