Backup/Restore remote disk images.

There are occasion when backing up data is not enough. You may want a snapshot of your whole system. There are some great tools out there like Clonezilla, which in turn uses partdisk, or Ghost if you don’t mind closed source. But you can do this using tools almost certainly available even in the most minimal of linux installs.
  • The image is easily restorable to the hardware it was created on. If you restore to another computer it will create unexpected issues.¬†Usually¬†fixable by creating a new initrd
  • The partition sizes are fixed and must be restored to a harddrive of equal or larger size.
  • dd creates a byte level copy of your harddrive, empty space is included in the backup. Without gzip a 160GB disk will create a 160GB disk image. With Gzip the image will still be very large.

Backup image to another Linux machine

If you have a Linux workstation with a large enough hard-drive you can simply backup and restore across the network. You will need root access to both boxes. Netcat is also available for Windows and Mac.

1. On the Destination Where you are storing the backup

In this example /dev/sda is the harddrive you want to backup/restore. Make sure you choose the correct harddrive.

 # nc -l 1010 > harddrive.img.gz

2. On the source computer The machine being backed-up

# dd if=/dev/sda | gzip -cf | nc -q 10 1010

Restore image form another Linux machine

1. On the Targe The machine you are restoring to

  • You will need to boot into a live image, I suggest Ubuntu, from USB or a CD.
  • From the now booted, live operating system:
    # nc -l 1010 | gzip -dcf | dd of=/dev/sda

2. On the Source machine The machine with the image saved

# nc -q 10 1010 < harddrive.img.gz

2 thoughts on “Backup/Restore remote disk images.”

  1. Greetings, I don’t understand why I cannot access the image I made to restore my HD! I placed the image in a folder on a remote drive pluged into my USB. When I go to control panel tell it not to make a backup just shut down and restore it comes back telling me that the drivers for my remote drive need to be installed . . . but then it takes to the drive to have me locate the drivers for the drive??? WTF. Been at this for over an hour, where am I going wrong? All I want to do is restore my HD back to when I did a freshy install without going through all this FBS. I hope you can help. Thanks Chip

    1. Control Panel? Sorry I do not understand what you are doing. These instructions are Linux based. There is no “dd” in Windows, so I am not sure what you are doing at all. The image can be restored, from a linux boot.

Leave a Reply

Your email address will not be published. Required fields are marked *