Tue 17 May 2005
Well it took a bit of trial and error, but I managed to transfer
windows over to the new 40 gig drive with just a few elegant unix
commands.
That dd is an incredable tool. It wasn’t excactly the right fit for
what I was trying to do, but I’m very impressed with what it did for
me, and other functionality I read about in my research.
I installed the new drive as hda, and made the original drive its
slave. I transferred the mbr over with these two commands:
% dd if=/dev/hdb of=hdb-mbr-image bs=512 count=1
% dd if=/dev/hdb-mbr-image of=/dev/hda>&/dev/null
I don’t think the bs=512 count=1, or the >&/dev/null are strictly
necessary, but I got the commands from a forum and, anyway, it worked.
To transfer the data, I decided to try doing it in one step:
% dd if=/dev/hdb1 of=/dev/hda1>&/dev/null
Again, I think the >&/dev/null just directs any error messages to
/dev/null, but I included it. When it finished (roughly five minutes),
I mounted /dev/hda1 and there was my data!
Only problem was it essentially created an image of the original drive
and copied it on to the new one, so I was still stuck with a four gig
partition. (You’d mentioned ghost having the ability to resize
partitions. I see your point now.)
No problem, Mandrake can resize ntfs partitions. So I bring in my 9.1
install discs today, begin the install process, resize the partition
and tell it to write the table. Then I run into a glitch: the Mandrake
installer complains if you haven’t defined a root partition. I just
rebooted at that point, but I guess it didn’t update the partition
table correctly. When I booted back into Windows, the Disk Management
tool showed the drive as being one healthy 38 gig partition, but
Explorer showed only 4 gig. I confirmed this by copying files onto the
drive. It ran out of space at four gig.
Once again, open source tools to the rescue.
I had been using my venerable Rescue CD from
http://www.sysresccd.org/download.en.php
to run Linux on the machine, and it contains qtparted, which is a
graphical front end for ntfsresize. In order to use it, I had to get
that dell to boot in frame buffer mode — no easy task, but the boot
parameter i810fb640 finally did the trick. I ran qtparted, and it
showed hda1 as a 38 gig partition too, but I went into resize anyway
and sure enough the slider was at 4 gig. I moved it up to 38,
committed the changes, booted into Windows and presto! I had a 38 gig
drive.
Like I said, it took a bit of googling and head scratching, but the
whole operation could have been completed in about 20 minutes, with
most of that time devoted to swapping the drives. Oh, yeah, I came
accross some helpful docs for the “L” series dells at
http://support.dell.com/support/edocs/systems/dmum/index.htm
(I’m including a lot of these links so I can find them myself in the
future … )
That rescue cd could really be a life saver. dd uses stdin and stdout
by default, so it’s perfect for piping input and output to or from a
network share, for example. It can also ignore/skip bad blocks, so
partially corrupted files don’t stop it. I’ve just scratched the
surface, but the next time I have a hard drive crash I’ll know where
to start.
Happy hacking!
