====== Disaster_Recovery ====== ===== Moving disk partitions from one machine to another ===== If a disk is about to fail, and you need to create a backup of a partition on another machine, you can use dd and netcat (and optionally pv) to copy the partition over the network. Run the following command on the machine that is to receive the backup. In this case, -p 3333 specifies the port to listen on, -s 10737418240 is the expected size of the partition (10gb here) in bytes, and finally of=/path/to=backup.img is where the backup will end up. You can of course use another partition, such as an lvm partition, as the location for the backup. Using pv causes progress information to be displayed; omit the pipe to pv if you don't want/need this information. {{Root| nc -l -p 3333 | pv -p -r -b -e -t -s 10737418240 | dd of=/path/to/backup.img bs=4096 }} To send the partition to the backup machine, run this comand on the machine that has the failing disk. Here, if=/dev/failed-disk is the device node for the partition to be backed up, and backup-machine.example.com 3333 is the hostname or ip address of the other machine to send the backup to, along with the port number specified above. {{Root| dd if=/dev/failed-disk bs=4096 | pv -b -p -r -t -e -s 107374182400 | nc backup-machine.example.com 3333 }} ===== See Also ===== * http://www.linuxjournal.com/content/copying-filesystem-between-computers * http://www.ivarch.com/programs/quickref/pv.shtml or man pv