Copy a Hard Drive

From Tech
Jump to: navigation, search

You can make a backup of a drive using dd

dd if=/dev/sda of=myfile.img

then restore it later

dd if=myfile.img of=/dev/sda

or over the network

dd if=/dev/sda | pv --size XXg | gzip --best | ssh user@ip 'dd of=/mnt/backups/sda.img'

You can determine the size of a hard drive with

fdisk -l /dev/sda
Personal tools