Diary of a Network Geek

The trials and tribulations of a Certified Novell Engineer who's been stranded in Houston, Texas.

11/6/2007

Linux-based PC Imaging, Part One

Filed under: Fun Work,Geek Work,GUI Center,Linux,MicroSoft,The Dark Side — Posted by the Network Geek during the Hour of the Rooster which is in the early evening or 6:17 pm for you boring, normal people.
The moon is Waning Gibbous

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!

5 Comments

  1. 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

  2. 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

  3. 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

  4. 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

  5. […] 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

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.


Powered by WordPress
Any links to sites selling any reviewed item, including but not limited to Amazon, may be affiliate links which will pay me some tiny bit of money if used to purchase the item, but this site does no paid reviews and all opinions are my own.