DD Backups over SSH
To perform backups of a local workstation’s hard disk over a network, perform the following procedures (adjusted to your particular situation of course):
- Download and boot from a live Linux distro
- Become “root” within a shell
- Run “fdisk -l” (”mac-fdisk -l” I know works on SystemRescueCD 0.2.0 (PPC) for PPC/Macs (what about Intel Macs?)) and note the internal hard disk partition to backup (ex: ‘/dev/hda’)
The rest assumes that (in short, you will probably have to substitute some numbers or devices and you have ssh access somewhere):
- You have network access
- You have access to an SSH server
- Your network is configured with private addresses and you are not assigning one that conflicts with another local IP address
- Your netmask is the same as the one supplied in the following commands
Give an IP address to the workstation you have just booted the live Linux disc on, set the netmask, and bring the network interface up:
Set the default gateway (if you need to reach outside of the LAN that is… normally this is your router’s IP address):
Set a DNS server (if you are in the habit of not strictly using IP addresses):
Execute the backup command:
Obviously, most of the previous is getting the network up… try running “dhclient” if the live Linux disc has it installed, and your network has DHCP setup.
UPDATE (2010-02-09): I just thought I would mention, that Clonezilla Live is a fantastic piece of software that makes this all a little more automated. Their site says, “For [supported] file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.” Essentially, this translates into much smaller image sizes for the majority of files systems that people work with. See a basic how-to at http://www.howtoforge.com/back-up-restore-hard-drives-and-partitions-with-clonezilla-live.
This entry was posted on Friday, September 12th, 2008 at 10:04 pm. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
January 11th, 2010 at 12:47 pm
What is the problem with making this with the system booted up normally from /dev/hda ? Is it really necesary to start with a live cd?
January 13th, 2010 at 1:59 pm
This post is about imaging /dev/hda. If you are booted from /dev/hda, than I don’t think that it would be a good idea to try and image it (nor am I sure it is even possible… haven’t tried)… because you would have partitions mounted, that you are trying to image.
Files would be changing, just by being booted off of the drive. Though you could be booted off of /dev/hda and image /dev/sda, or some other device.
January 21st, 2010 at 2:39 pm
The drive that you are imaging has to be unmounted for the process to work so if you are going to image your primary boot partition you should boot from a live CD. Once you get the commands down dd + SSH is better than Norton Ghost and a lot cheaper.