Saturday, March 13, 2010

Using a Bootable USB Drive to Install Windows XP on an Uncooperative Laptop

As described in another post, I was trying to install WinXP on a Compaq Presario CQ60-420US laptop that would not boot from a Windows XP installation CD.  This post describes the steps I took to try to install from a USB flash drive instead.

I looked for guides on how to create a bootable USB drive using WinXP SP3.  One webpage suggested that I could use UBCD for Windows (UBCD4Win).  I had already installed UBCD4Win on the computer I was using for this investigation, so I thought this approach might make the process faster.  Following the steps on that webpage, I created a supposedly bootable USB drive, using a cheap 2GB USB thumb drive I had gotten from somewhere.  (It sounded like I had better use at least a 1GB drive.)  The webpage said it could take as long as a half-hour on a really cheap (i.e., slow) USB drive.  I plugged this USB drive into the laptop and pressed Esc during the initial boot screen to open the Startup Menu, and then F9 to bring up Boot Device Options.  It gave me only two options:  the DVD drive and the hard drive.  I exited out of that, and the system tried to Start Windows Normally and then crashed and rebooted.  I powered down, powered up, and tried again.  Same thing.  No joy.  It wasn't working.

I started over, this time creating the bootable USB drive using an OCZ Diesel 4GB USB flash drive (using FAT32 rather than FAT16 as instructed).  It still wasn't a terribly fast process.  When I stuck this one in the laptop and rebooted it and hit Esc and then F9, like before, I got a very different Boot Option Menu.  This time, we had two new entries:  DIESEL and LEGACY PCI DEVICE.  I tried DIESEL.  The screen was completely black except for a white cursor that just sat there and blinked.  (Later, I realized that it would always take a while, and that I should just be patient.  I'm not sure whether that would have solved the problem here.)

I let it go for a few minutes and then restarted the machine and tried the Legacy PCI Device option.  This seemed to be designed for booting via a network connection, from a source at the other end of an ethernet cable.  I didn't have any idea of how to do that.  It appeared that the bootable USB drive process had gone correctly, but that whatever was preventing the system from booting from the WinXP CD was also preventing it from booting from the USB.  To test that, I put the Diesel drive in another computer, which I'll call the "test" computer, and set its BIOS to boot first from the USB-FDD option, second from the USB-ZIP option, and third from the USB-CDROM option.  This gave me "Remove disks or other media.  Press any key to restart."  I did that.  On reboot, it went into GRUB.  (I had this machine set for dual-booting into Ubuntu Linux.)  I went back into the BIOS and changed the first entry to be USB-HDD.  This was my last remaining USB option.  I plugged the Diesel back in.  Once again, "Remove disks or other media."  The Diesel USB drive had given me somewhat more clarity, but it was still not working.  I had tried creating a bootable USB drive once before.  I think that one was for Ubuntu, but it had used the same BartPE components that went into this one.  It hadn't worked either -- not only for me, as I recall, but for a number of other people.

I decided to try another way of making a bootable USB drive, not involving USBCD4Win.  This time, the webpage I followed began with installing BartPE to a folder with a name like C:\pebuilder.  I had already done that, in the process of setting up UBCD4Win.  Next, they had me download and install UltraISO Premium (free to try).  It didn't look like my other CD burning programs gave me the USB-HDD burning option that they recommended, so I went ahead with the installation.  I didn't bother closing my other programs before installing.  Then I ran it as they suggested.  The result was not encouraging.  When I clicked on the drive in Windows Explorer, I got an indication that the drive was not formatted.  I took it out and put it into the test computer anyway.  When I rebooted, to my surprise I got, "Start booting from USB device."  I hadn't yet copied the I386 folder to the USB drive -- couldn't, because the source computer wasn't recognizing it -- but now I yanked it out of the target (I had hit the Pause key at that point in the target machine, so it was just sitting there, politely waiting its turn) and shoved it back into the source machine, which now recognized the jump drive as drive I: (BartPE).  I copied the I386 folder.  While that was underway, I did a quick search for the option of installing XP from the I386 folder on drive C, which I had kind of forgotten about.  It looked like a hassle, so I didn't bother with it at this point.  The I386 copy process got interrupted by an irritating Windows message that one of the files in the I386 folder was being used, so I tried again, copying this time from the I386 folder on the slipstreamed WinXP SP3 CD.

When the I386 folder was all copied to the USB drive, I jerked it out of the source machine and rammed it back into the same USB port in the test machine.  I hit a key to un-pause that machine's boot process, but got "Disk Error -- Press any key to restart."  I did that.  Now BartPE loaded.  It flashed a Windows XP opening screen, so I knew WinXP was there somewhere.  Next, BartPE gave me a screen for DiskInternals.  I killed that.  It wanted to know if I wanted to start network support.  I said no.  I didn't see the DiskPart program described in the webpage, and actually I would have rather used GParted for that anyway.  I tried DiskInternals Partition Recovery, which seemed to be the closest thing to a partitioner, but it didn't look right.  I inserted the GParted CD and went to BartPE's Go > Shut down > Restart option.  On reboot, I went back into the BIOS setup and set the CD-ROM drive to boot before the USB-HDD.

Then I decided I didn't need to be fooling with the test machine anymore.  This USB drive appeared to be working.  So I put the GParted CD into the laptop instead, and also changed its BIOS boot order as just described.  I used GParted to set up a 25GB NTFS partition and then rebooted with the USB drive.  It booted!  This time around, I skipped the partitioning and formatting step described on that webpage, and instead went to BartPE's Go > Command Prompt.  This put me at an X:\minint\System32 prompt.  I guessed this meant that X was the drive letter assigned to the USB drive.  So I did a "CD \I386" and, sure enough, there it was.  So I ran the command they indicated:
X:\i386\winnt32.exe /syspart:C: /tempdrive:C: /makelocalsource /noreboot
Woo hoo -- a WinXP installation screen!  But then, dammit, an error:
Setup cannot continue because upgrade functionality is disabled and your copy of Windows XP only allows upgrades.
Now what?  I had never gotten this before.  There was, as far as I knew, no problem with the CD itself.  A search suggested no obvious solutions.  I suspected this might be a problem caused by the use of a slipstreamed CD with the BartPE process.  I decided to try again with the second approach, to see if that cheap 2GB USB drive could also be made bootable, but using an original Windows XP SP2 CD in that process.  While that was doing its thing, I took another look at that option of installing WinXP from the I386 folder.  I found a webpage that suggested using winnt.exe instead of winnt32.exe.  Unfortunately, I was not sure how to replace the other options in the foregoing winnt32 command.  (Later, I saw somewhere that the command to use would have been X:\i386\winnt /s:X:\i386, where the /S switch defines the location of the startup files).

By this time, BartPE had finished being reinstalled on the cheap 2GB USB drive.  I checked and noticed that the installed files (including /I386) filled 934MB.  The I386 files filled about 2/3 of that by themselves.  I rebooted the laptop with the cheap 2GB drive plugged in, and it worked.  Conclusion:  the UBCD4Win process did not work, at least not unless I wanted to reinstall UBCD4Win, in case it had become screwed up during my previous use of it.  But then, spoke too soon:  the cheap 2GB drive produced the same BSOD I had gotten when trying to install WinXP from the CD.  Why would the same BartPE process work with SP3 and not SP2?  I replaced the SP2 files on the cheap USB with SP3 files (using Beyond Compare to avoid having to recopy everything) and tried again with the cheap USB.  While this was underway, I also tried booting from the SP3 CD again, as I had done at the start of this post.  Nope:  still a BSOD.  When the cheap USB had the SP3 files, I tried booting it.  Nope:  still a BSOD.  So apparently there was some difference between the Diesel USB and the cheap USB.  I tried the Diesel USB once again, just to be sure.  Sure enough; once again it loaded BartPE.

Next, I downloaded WinSetupFromUSB.  It didn’t seem to have a homepage of its own; that link was the first in a long thread about it, and there was a download link there.  It came in a .7z form, and for some reason right-clicking didn’t open up the usual Windows XP “Extract” option, so I used 7-zip to extract it.  It was a standalone; no installation process needed.  It didn’t detect anything on the cheap USB drive, but it gave me options to reformat it with either Bootice or RMPrepUSB.  But then it didn’t seem to be working, so I killed it (Ctrl-Alt-Del) and started it again.  This time it identified it as 2020MB Total (FAT) and gave me an error indicating that I should not be using FAT16 on a drive > 2GB.  So apparently those other instructions were mistaken, and maybe this was why the cheap USB hadn't worked as well as the 4GB Diesel.

I clicked on Bootice and left the Destination Disk setting at the default USB.  The Bootice tooltip had recommended using Grub for DOS, so I clicked Process MBR and chose Grub for DOS > Install / Config.  I left the default settings as they were and went with Save to Disk.  This said, “GRUB4DOS is successfully installed onto this disk!  Please copy GRLDR (and optional menu.lst) to the root of any partition of this disk.”  I clicked OK > Return > Return.  This put me back to the main Bootice dialog.  Following the tooltip, I clicked Perform Format > USB-HAD HAD (Single Partition) and chose NTFS.  I got, “The partition has been formatted successfully.  You can install some kind of MBR and PBR onto it now.”  I had already done the MBR, though, and when I clicked on that it seemed to be indicating that I would be changing the MBR, so I went on to the PBR option.  I left it at NTLDR and hit Install / Config.  This, too, seemed to have been done already.  But then, when I exited all dialogs back to the WinSetFromUSB introductory dialog, I got an error message:
Could not find primary partition on the selected disk!
Please insert USB disk with a primary partition on it and click Refresh button.
I wasn’t sure what I was doing wrong, so I clicked Refresh.  Same error again.  It went away after a few seconds, so I tried RMPrepUSB instead of Bootice.  Here, the steps were numbered.  In step 3, I changed Boot Options to XP.  I went looking for the manual and, in WinSetupFromUSB\files\tools, I found RMPrepUSB.pdf.  (There didn’t seem to be a manual there for Bootice.)  This PDF said that I would have to indicate files to be copied to the USB drive here, in step 5, if I wanted the drive to be bootable.  But what files?  I wasn’t sure, so I just went with this part.  (I noticed RMPrepUSB offered an image “File to USB” button.  From the readme PDF, it seemed this would be useful only if you already had an ISO or other image containing everything that would be needed to boot a USB drive as distinct from a CD.  I didn’t have that, so I didn’t use this.)  Then I clicked on 6, Prepare Drive.  Something went wrong at this point, probably in my choices or in another program I was running.  The system nearly froze, and I had to use Ctrl-Alt-Delete to shut down this program and another one.  I tried WinSetupFromUSB > Bootice again.  It registered the drive as formatted in FAT32, so I went to the PBR button and clicked Install / Config > OK > Return.  Next, Process MBR > Grub for DOS > Install/Configure > Save to Disk.  It said something about installing GRLDR and menu.lst to the root of any partition.  After a search and a look at several websites, I still didn’t know what or where GRLDR was, or which menu.lst to install.  Finally I found a guide on how to use WinSetupFromUSB.  This guide was unfortunately somewhat outdated.  I followed its advice in a modified sense:  I copied the entire WinXP installation CD to a new folder on drive C, and indicated that in step 5 in RMPrepUSB.  Then I clicked step 6, the Prepare Drive button, along with the other OK buttons etc. needed to get it underway.  It spent maybe a half-hour copying the contents of the WinXP installation CD to the USB drive.

When it was done, I clicked Exit and ejected the USB drive.  Before ejecting, I noticed that the contents of the drive appeared identical to those of a WinXP CD; but during the process, I had noticed a brief reference to the possibility that two partitions were being created on the jump drive, and that maybe one of them was hidden.  Maybe this would be the boot partition, and it would make it so that the jump drive really would function like a boot CD.  Maybe.  About this time, I also realized that this might have been a partly wasted effort, insofar as the cheap USB drive had not been a star performer so far; I just hadn't wanted to wipe out that hard-won Diesel drive until I thought I might have a better alternative.

At this point, I used one of the foregoing processes to make a SanDisk Cruzer 4GB flash drive bootable.  I did not record which process; it was late and I went to bed while it was underway.  A day or two passed before I got back to this project.  I booted the laptop with the SanDisk, hit Esc and then F9, and saw that I did have the SanDisk as a boot option.  It did start booting.  It went through "Starting BartPE" and showed the WinXP startup screen, but then collapsed into a BSOD.

I went back to the approach that had worked with the Diesel USB.  This time, it occurred to me, I might not need to go through the long process of copying I386 to the jump drive.  That would be necessary for a situation where a CD drive was not available; but in this situation I did have a drive that would (I hoped) read the I386 file from the WinXP installation CD.  It took only a minute or so for UltraISO to make the Diesel bootable.  When that was done, I closed UltraISO, ejected the Diesel, inserted it into the laptop, put the WinXP CD in the laptop's CD drive, booted the laptop, and did the Esc-F9 sequence on startup.  This time, unfortunately, the Diesel didn't work either; another BSOD.  I thought maybe the problem was that the machine didn't even want to see the WinXP CD, so I tried again, booting the Diesel, without the WinXP CD in the drive, but no:  BSOD again.

At this point, I abandoned this bootable USB approach.  The Diesel USB had worked the first time, to the point of giving me a command prompt.  It might work again, if I kept playing with it.  But by now I had come up with some other possible approaches, so I returned to the effort described in a separate post.