Backing up a Windows Laptop with OS X

Update 9/10/2006: I’ve improved this procedure, and removed the need for NFS. See HOWTO Backup an Entire Windows Drive with OS X and Ubuntu for details.

My wife’s XP laptop continues to get slower. She’s had it for about 2 1/2 years, and it’s still running the original XP install, so no surprise that performance is lousy. I’ve considered dropping a desktop Linux install on it, but she has a couple of apps that still require Windows. For now, I decided to format her hard drive and revert it to factory condition with the restore CDs that came with the machine.

So now I needed to back up her machine. It doesn’t support Firewire or USB2, so external drives were out. In the past, I’ve always copied alot of files over the network, but this is time consuming, and usually error prone- If windows decides it can’t copy a file, the whole copy operation stops, and you have to figure out what has copied and what hasn’t.

I wanted something similar to Ghost. Ghost is a PC backup solution the PC admin folks at work used to use. It’s now a Symantec product, but I don’t think it was at the time. The original was great- a single floppy (we used floppies back then) would boot, connect to the network, and copy the entire hard drive to an image file on a network server. Modern versions allow you to grab files from inside the image; I don’t recall if the original did. This is a feature I need; I’m not restoring the whole image to a drive.

I tried to find an open source alternative (the current Symantec Ghost is overpriced, and I don’t trust Symantec software at all) without much luck. I found Partition Image for Linux, but the images can’t be opened for access to individual files. While researching, I came up with another idea… make a direct copy of the windows partition from a Linux Live CD (such as Knoppix) using dd. I figured the image might be mountable, just as you can mount an ISO CD image file.

A word about efficiency: This method copies the entire partion, empty blocks along with the rest. So, copying Sherri’s 27G partion would result in a 27G image file. However, I have the space on the iMac, the backup is only temporary, and I wanted to be sure I had everything. Seemed worth a shot.

In order to make the backup over the network, I needed to share a directory on the iMac as an NFS share, since I’d be connecting from a Linux Live CD. OS X supports this, but not via a nice little applet like with Windows Sharing. You need to fool around with netinfo, which I dislike, and run several daemons. Since this is only for temporary use, I decided not to get my hands too dirty, and found a shareware utility called NFSManager to handle the details for me. Once I had created an NFS share, it was time to use it.

I booted Sherri’s laptop using a Knoppix LiveCD, opened a shell, and mounted the NFS share (/Users/jclark/Netmount on the iMac):

sudo su
mdkir /mnt/mac
mount -t nfs /mnt/mac

The first line makes me root for the ensuing commands. I then make a mountpoint, and mount the NFS share to the mountpoint. Interestingly, when I ran the mount command, the command appear to hang, but opening another terminal showed that the mount worked.

The laptop only had one drive (C:) so I suspected that I only needed to backup /dev/hda1, but I checked it with QtParted just to be safe. QtParted is a GUI shell around GNU parted, and is accessible from the Knoppix start menu. I would have used parted from the command line, but couldn’t find it in the Knoppix install.

Once I had confirmed what I needed to backup, making the image was simple:

dd if=/dev/hda1 of=/mnt/mac/laptop_drive

The transfer rate was about 10G/hr, which isn’t too bad I suppose. When it was finally complete, I tried to mount it under OS X using the mount command, with no success. A little while later I realized I hadn’t specified to mount it via loopback (in other words, treat a file like a drive). After a few minutes trying to figure how to do this in OS X, I got lazy and Googled. One of my hits suggested an idea for opening a floppy image that seemed too good to be true, but I tried it anyway.

I renamed the image file, adding .img to the name, and then double clicked the icon in Finder. A few seconds later the drive image was mounted, and I had access to the entire drive backup. Very cool.

Now all I have to do is restore her factory drive image, clean off all the crap it came pre-loaded with, patch the crap out of XP, reinstall her software, and restore all of here files.

Maybe I should just buy her an iBook….

Both comments and pings are currently closed.

One Response to “Backing up a Windows Laptop with OS X”

  1. - HOWTO Backup an Entire Windows Drive with OS X and Ubuntu Says:

    […] About a year ago, I posted a method for backing up a Windows Laptop with OS X, which used a Knoppix Live CD and NFS. Today, I needed to perform the same task. I wanted to use Windows file sharing instead of NFS, since support is built into OS X and can be enabled from System Preferences. I also wanted to use Ubuntu instead of Knoppix, since I had a Ubuntu 6.06 CD handy, and I’m a Ubuntu fan. While I had some issues, I came up with a method which I think is easier then the old one. […]