Wednesday, January 27, 2010

Fix no-boot Windows XP after partition size increase

Sorry about the complicated title which I'll explain more clearly now.
I have an old (almost 8 years old) Dell desktop (4550) with an 80GB HDD and 1GB of RAM. Right now I'm dual booting Ubuntu with Windows XP. The XP came with the original machine and it's fully updated.
I'm not at all a Windows user but I reluctantly have to admit that occasionally, just occasionally, things crop up that can only be done on Windows.
An example is DVDVideo Soft Free Studio which I was using to convert some of my (totally legal) avi films to mp4 for loading onto an iPod Touch. However, it only works in Windows.
So that meant that I had to transfer over some avi movies to my Windows partition on the Dell and quickly ran out of space. What to do? Parted Magic of course.
So, I doubled the size of the Windows partition and everything seemed fine.
But when I next went to boot to Windows XP, I got a message telling me that c:\windows\system32\hal.dll was either missing or corrupt and that I needed to copy over this file before I could get Windows to boot.
OK, seems easy enough and this post explains what to do in detail and this one in even more details together with what might go wrong.
OK, so I booted to the Recovery Console (BTW, my administrator password is blank. IOW, just press return when asked for a password) with the OEM CD in place. Then I issued this command:

expand d:\i386\hal.dl_ c:\windows\system32

the type "Y" (must be CAPITAL Y) when asked if you want to overwrite hal.dll and then "exit" when you want to quit.
Great, but still got the very same error and no boot.
For cryin' out loud -- I did everything exactly as prescribed.
Hmmm, maybe the hal.dl_ on the CD was also corrupted. So, I found here (towards the end) that the required file is also available at c:\windows\servicepackfiles\i386\. However, copying c:\windows\servicepackfiles\i386\hal.dll to c:\windows\system32 did not remove the error.
Now what?
Well, the hal.dll file is available for download here (as a zip -- this site looks more than a little dodgy, but I was able to get the required file without problems on my MacBook). Then I copied it to a pendrive, moved the pendrive to my Dell (which has the XP partition), booted to the recovery console and tried to copy from the pendrive to c:\windows\system32 but although this seemed to go fine, XP still wouldn't boot (same error).

So, next I tried the Option 1 in this link which says to issue the following commands in the Recovery Console:
Attrib -H -R -S C:\Boot.ini
DEL C:\Boot.ini
BootCfg /Rebuild
Fixboot

However the "attrib" command just wouldn't work for me. Even issuing it on it's own gave the same error as with whatever other combination (Parameter is not valid).
Couldn't figure this one out after extensive googling.
Then I found this post which lead to a solution.
I tried option #5 and issued this command in the Recovery Console with the OEM CD in the drive:
bootcfg/rebuild

This didn't take longer than 1 second and when I tried to reboot, no errors and I got into my XP GUI again. So, looks like Gparted not only messed up my hal.dll but also my boot.ini.
It's worth noting that XP went through an extensive "Found New Hardware" exercise where it seemed that drivers had to be assigned to every piece of software. I really have no idea why this happened.
OK, so back to XP and everything should be fine now in the enlarged partition, right? Actually, I should have been suspicious that Windows did not do a file check on booting into XP as it normally does after the partition size had been changed by Gparted.
Now, even though Gparted had seen the partition as enlarged, in XP, the size was unchanged. How the hell did that happen?
So back into Parted Magic where I did a file check on the ntfs partition (no problems) and enlarged my Ubuntu /home.
Then booted back into XP, and this time all was well, no boot problems and the XP partition was enlarged.
My assessment of what went wrong is that it seems that Gparted didn't quite get things right the first time around.
Now I've been using Gparted for many years and never, ever had a single problem until now. Strange.

No comments:

Post a Comment