Benefits of Remote Backup?
I tested the SSH method in two ways:
- I set up my Macbook in the living room and sent the image from my office computer over wireless. The backup time was about as fast as sending the image to a spare partition.
- I have about 250 GB available on my 1and1 hosting plan. Since SSH is enabled, I can send the image directly to my web server.
While storing the Windows image on a spare partition may be handy, I highly recommend that you archive it elsewhere. What if your hard disk explodes, or a cat urinates on your motherboard? Hey, it could happen. Storing the image elsewhere, such as on a DVD (if it fits), on another computer in your home, or on an off-site server is handy.
While storing my Windows image on my web server sounds appealing, I am not sure that I am comfortable with the idea, unless I made that folder inaccessible to the public. Anyway, here is how you could restore directly from your web server. Use a tool like wget to grab the image, then send the data to ntfsclone.
wget -qO – http://yourserver/path/name-of-image.img.gz | ntfsclone -r -O /dev/hda1 –
Conclusions / Advanced Restoration
As you can see, a Linux “live” CD truly possesses great power. By simply chaining a few commands together, it is possible to do amazing things. Though this process is not as simple as “point and click,” it is absolutely free, extremely flexible, and requires nothing to install.
One issue that I did not cover at all is a “bare metal” restore, meaning a restoration to a completely-erased (or new) hard disk. This is possible by simply using GParted in conjunction with a few more commands. If you are interested in doing this (and you should be), you need to archive the Master Boot Record (MBR) as well as the partition table. We do this by using the aforementioned dd tool.
Saving the MBR plus primary partition table:
# dd if=/dev/hda bs=512 count=1 of=/mnt/hda2/master-hda.mbr
If you need to restore it, just reverse it:
# dd if=/mnt/hda2/master-hda.mbr of=/dev/hda
Of course, if you are restoring to a completely blank drive, you MUST have the image and the MBR file archived elsewhere, such as on a DVD or a remote server, so you will probably need to alter the restoration path of the MBR file accordingly. Once dd sets the partition table and MBR in order, you may then use GParted to format or alter any additional partitions and restore with ntfsclone as usual.
Restoring from “bare metal” is a complicated issue, but hopefully that gets you on the right track. Perhaps I will create an addendum for this article sometime soon.
If you read all the way to the end of this tutorial, here is your reward. I created a one-page cheatsheet containing all of the relevant commands. Feel free to print it and use it for your reference. 🙂
Good luck, and as always, happy backups!
— Brian Bondari