Linux-based PC Imaging, Part One
Hey, I get paid to be a geek, right?
So, I’ve been having some issues with my network and several Windows XP machines. In a nutshell, these machines seem to lose connectivity after approximately nine hours and fifteen minutes from the last restart. In other words, when my crazy-dedicated engineers work past their ninth hour, their machine slows to a crawl and eventually locks tighter than a Catholic school-girl’s knees. In any case, after weeks of troubleshooting this issue, I’ve come up empty. The best that I’ve got for these guys is either a) Don’t work such long hours or b) Reboot the machine at lunch.
In a further attempt to fully understand what is happening and at what level, I’ve gotten one of these machines and I’m going to install Windows 2000 on it. If we have the same issue, I know it’s hardware. If I don’t, I’ll be certain, within a reasonable percentage of sureity, that the issue is some arcane aspect of Windows XP. Either way, I should be closer to a real answer.
But, before I wipe my current experimental machine, I decided I wanted to back it up. Naturally, I turned to my old friend, Linux. A quick Google turned up a blog entry titled “Cloning XP with Linux and ntfsclone“. So, with a few modifications for my own environment, I followed the instructions there. Incidentally, I used the latest version of Knoppix as a boot CD.
First, open up a terminal/shell session and create a mount point with the following command:
# mkdir /tmp/server
Then, because my DHCP server didn’t give the Knoppix virtual machine the right DNS information, add your server to the /etc/hosts file.
Next, mount the network share that you want to dump the images on.
# mount -t smb -o username=administrator //server1/share /tmp/server
Check how your live CD sees the partitions you want to save with the following command:
# cat /proc/partitions major minor #blocks name 8 0 78150744 sda 8 1 76211608 sda1 240 0 1939136 cloop0
I want to save that 80 GB disk sda, which has a primary partition sda1. First I saved the partition table and the Master Boot Record this way:
# sfdisk -d /dev/sda >/tmp/server/images/cad1r-sfdisk-sda.dump
# dd if=/dev/sda bs=512 count=1 of=/tmp/server/images/cad1-sda.mbr
and then the partitions:
ntfsclone -s -o - /dev/sda1 | gzip | split -b 1000m - /tmp/server/images/cad1-sda1.img.gz_
Note that this saved disk image in 1G files, in case the way I mounted the share to the network server didn’t allow for large files. Sometimes that can get tricky going from Linux to a Windows 2003 server and back, so I decided not to take any chances. It makes a mess of files, but at least it took the guess-work out for me.
Coming soon, the restore process! Keep an eye out!
Well, I don’t really know about all of that computer stuff, but I can say that I know a few catholic school girls who’s knees didn’t lock at all, let alone tight. 😉
Comment by Cheri — 11/6/2007 @ 6:56 pm
Ha! Perhaps I should have written “proverbial Catholic school girl’s knees”. Well, my experience with them is limited and blurred by the distance in time.
The process of using Linux to clone a machine, incidentally, works very, very well for me. It may just save my sanity!
Comment by the Network Geek — 11/6/2007 @ 8:16 pm
We have experienced this problem with dual core machines running XP Pro and IE 7. Microsoft has a few patches out, but all they seem to do is delay the inevitable lock up.
Comment by duhmoose — 11/8/2007 @ 6:41 am
Hmm, glad to know we’re not the only ones, duhmoose. I’ve tried all the patches, including a couple “triple-secret probation” ones that aren’t in Windows Update, but none of them seem to do much.
In fact, so far, the only thing that has made a difference is reloading from scratch. Notice that I write “so far”….
Comment by the Network Geek — 11/8/2007 @ 9:57 am
[…] that relied on Linux and a whole lot of personal documentation. (You can read that, in two parts, here and here.) It worked pretty well and I was pretty damn proud of myself for both figuring it out […]
Pingback by Updated Linux-based Disk Imaging | Diary of a Network Geek — 7/6/2011 @ 5:55 am