Curse you Microsoft

My daughter wants to play Sims 3 on my laptop, which is currently running Linux Mint 14 (nicknamed Nadia).  I had been running Windows XP on it until the hard drive died.  Of course, no backup of that drive image existed.  No big loss for me really, as the machine has just been a game platform for my kids and their Windows-centric game interests.  So when the HDD died, I bought a new one and installed Mint on it, which I like an awful lot.  The laptop itself is a Sager something-or-other, a rebadged Compal HEL80.  It was a pretty sweet rig in 2007, but has been a knockaround kid computer for a few years now.  The Linux Mint install is very nice, a wonderful implementation of Ubuntu without the Unity interface.  But my daughter doesn’t care for it because it doesn’t do Sims 3.

Years ago I vowed to not give Microsoft any more of my money.  I’ve worked hard to live up to that, and have even recruited my wife from the dark side.  So how can I get Windows on my laptop without paying Microsoft for a new license of Windows?  The original media disk from Sager is cracked, so I can’t install from that.  It turns out I have the original 80 GB hard drive that came installed in the laptop.  After installing several 3D games on the system the HDD was full and needed to be replaced, I think back in 2009.  The procedure I did back then is what I will repeat now to put the Windows XP install on the new 320 GB hard drive.

The diskdump command, abbreviated as dd, is the tool I’ll use to create an image of the old hard drive.  I have the old drive plugged into my desktop system, here’s the output from fdisk:

$ sudo fdisk /dev/sdb
Command (m for help): p

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1d0ffd6e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63   156296384    78148161    7  HPFS/NTFS/exFAT

I’ve got an UnRAID server set up as my network storage.  The first thing I need to do is create an image of the 80 GB drive.  From there I will boot a rescue CD on the laptop and reformat the 320 GB drive with that image.  This will result in a 80 GB partition, which I can resize using QtParted.

dd needs a few parameters to tell it what to do and where to do it.  The first, ‘if’, is the input fiule.  I’ll tell it to use the second sata drive which is /dev/sdb.  The second paramter is the output file, which I’ll be putting on my network share.  Finally, a blocksize parameter can help optimize the transfer time.  I don’t know what is best for transferring over a gigabit network so I may just go with the default.  Actually, I can do a short test and see what works best.

$ sudo dd if=/dev/sdb of=/tower/misc/system/junk.file bs=1K count=10
10+0 records in
10+0 records out
10240 bytes (10 kB) copied, 0.0201032 s, 509 kB/s

The above command shows the result of sending ten 1-kilobyte records from the old 80 GB drive to storage on the server named tower.  I repeated the command with different block sizes with the following results.

2K: 20480 bytes (20 kB) copied, 0.0334338 s, 613 kB/s
4K: 40960 bytes (41 kB) copied, 0.00890875 s, 4.6 MB/s
8K: 81920 bytes (82 kB) copied, 0.0369878 s, 2.2 MB/s
6K: 61440 bytes (61 kB) copied, 0.00451427 s, 13.6 MB/s
5K: 51200 bytes (51 kB) copied, 0.00441713 s, 11.6 MB/s
7K: 71680 bytes (72 kB) copied, 0.0190475 s, 3.8 MB/s

Using a block size of 6K I entered the following command on my desktop:

$ sudo dd if=/dev/sdb of=/tower/misc/system/hdimage_80gb_WinXP_20130323 bs=5K

Note that I screwed up and put in 5K instead of 6K.  I don’t think it will make a difference as we’ll see below.  Anyway, after typing this in, the curser sat there unmoving, not telling me a single thing about whether or not I was successfully backing up an image of the drive onto the network server.  Thanks to a helpful web page at LinuxCommando, I was able to monitor the progress of the dd transfer.  I opened another terminal window and entered the following:

$ watch -n 30 kill -USR1 PID

where PID was the process ID for the running dd command.  Back in the terminal where I entered dd, it started giving me progress updates every 30 seconds, like this.

77233+0 records in
77232+0 records out
395427840 bytes (395 MB) copied, 10.3707 s, 38.1 MB/s

After several minutes it settled in to a sustained transfer rate of 33 MB/s.

I’ll follow up with another post on putting Windows on the laptop.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: