Friday, August 31, 2007

Repair GRUB booting with a USB stick and XP

When we're installing our machines for dual booting, sometimes we have to restore the previous MBR that the Windows installation has overwriten, as we have lost the GRUB booting. This method is working fine, and allows to restore the GRUB MBR flawlessly, creating the USB stick configuration from XP. We need:
Simply, install the HP USB Key Utility, insert the USB stick, execute the program with the option "Transfer floppy image to USB key", select the Super Grub Disk floppy image, and check that the selected USB drive is the right one. This will create a booting USB that will allow us to execute the Super Grub Disk.

To restore the MBR with GRUB, boot the computer with the USB in, and follow the steps:
  1. GNU/Linux
  2. Fix boot of GNU/Linux (GRUB)
  3. Choose the partition where GRUB is installed (usually /boot)
  4. SGD has suceeded
  5. Exit the menu tree and reboot, taking out the USB stick
This will make us boot GRUB again.

Install XP Pro SP2 from USB stick for dual boot

As soon as I got my refund for the Windows Vista that came preinstalled on the laptop, I formatted the whole disk with Ubuntu 7.04's fdisk, as I wanted to perform a clean installation modifying the disk partitioning. Some time later, I dediced that I wanted to install Windows XP in order to participate in the LAN parties that were held at some friends houses. And here the problems arised. I took a Windows XP Professional SP2 installation CD, booted from it, and when the message "The XP setup program is inspecting your hardware configuration", it locks and does not continue.

I haven't yet been able to identify what is the cause of the lock, maybe it was because I wanted to install in the fourth SATA disk partition (/dev/sda4), or maybe it was a Phoenix BIOS issue, as the laptop comes with the Vista enabled BIOS 3309. Maybe there is any incompatibility with EFI. Don't know yet. Here I'm describing the method that worked for me, after a long time of trials and errors. It does not work as expected, but it works. It's based on the following article:

Let's assume that Windows is installed on the PC on drive C:, the CD-ROM unit is drive D:, and the USB stick maps in the E: In my case, the Windows version used is XP Professional with integrated SP2 in Spanish.

Step by step:
  • Create a copy of your C:\boot.ini to C:\boot.bak
  • Perform a noreboot installation ...
Execute from the command line
D:\I386\winnt32.exe /noreboot
Select "New Installation (avanced)"
Accept the EULA and type the CD key
Check in the Setup options -> Advanced options that the directory is \WINDOWS and check the option "Copy setup files"
Answer NO if you get asked on upgrade the hard disk to NTFS.
Once finished, the setup program will finish withouth rebooting. Do not extract the CD yet.

Now there would be two newly created directories called C:\$WIN_NT$.~BT and C:\$WIN_NT$.~LS. If they are not visible, check that the folder options to show hidden and system files are enabled.
  • Delete C:\boot.ini and rename C:\boot.bak to C:\boot.ini
  • Create the bootable USB with PEtoUSB ...
Insert the USB stick, execute PEtoUSB, select the USB stick, mark "Enable disk format" and point "source path" to the CD installation source, in my case D:\, and check "Enable File Copy" and "Overwrite always". The bootable USB will be created.
  • When the program is done, erase everything except:

The WIN51* files will depend on the Windows version that you're installing.
  • Copy the directories C:\$WIN_NT$.~BT and C:\$WIN_NT$.~LS into the USB stick root.
  • Create a directory called E:\minint in the stick
  • Copy C:\$WIN_NT$.~BT\txtsetup.sif into the E:\minint directory of the stick
  • Erase the following files from the USB E:\$WIN_NT$.~BT directory
  • Renane the directories C:\$WIN_NT$.~BT to C:\$WIN_NT$.~BT.OLD and C:\$WIN_NT$.~LS to C:\$WIN_NT$.~LS.OLD in order to keep them if anything goes wrong.
Now, boot with the USB ... accept everything and some time later it will ask for the installation CD. Put it in the CD drive and press ENTER. Install Windows in the usual way. At this point, in the partitioning, I had an error saying that Windows could not create the partition to install. What I did was to reboot with Ubuntu and create the WinLBA32 partition from fdisk. I restarted the setup procedure and formated the partition with NTFS quick format.

If the system is displaying errors on restart, check the C:\boot.ini file in the laptop by using the recovery console that is in the USB stick. Check that the entries are pointing to the right disk drive. In my case, it's as follows.
[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

Now, it's only needed to restore the MBR so that GRUB can launch instead of the XP boot manager. This can be easily done with Super Grub Disk, please check the post "Repair GRUB booting with a USB stick and XP".

If everything went fine, you can also delete the installation folders on the PC, C:\$WIN_NT$.~BT.OLD and C:\$WIN_NT$.~LS.OLD, as they are no longer needed.

It's not a bad idea to restart the laptop in Linux and create an image of the XP partition with some tool like Partimage (, in order to restore it in an easier way.

Wednesday, August 29, 2007


The laptop has the following manufacturer specs:
  • AMD Turion 64 Mobile MK36 (2.0 GHz, 512KB L2 cache)
  • 1 GB DDR2
  • 14.1 WXGA Acer CrystalBrite LCD
  • ATI Radeon Xpress 1100, up to 256MB from system memory
  • 120 GB HDD
  • DVD Multi (support DVD+R DL, DVD+RW, DVD-RW)
  • 10/100 ethernet
  • 802.11b/g wireless LAN
  • Acer Orbicam integrated webcam
The Acer 5050 series details can be found here:

The laptop came with Windows Vista Home Basic preinstalled, although there is an option to get it with Windows Media Center Edition 2005. All two options are 32bit.

We will later cover in-depth the hardware specifications one by one.

Initial note

This is the blog that I will use to track all progress I do about setting up my new laptop, an Acer Aspire 5051 AWXMi. I'm intended to setup a dual boot configuration with a linux flavour and Windows XP.

I've chosen that laptop because I wanted to buy the cheapest and smallest one, and push it to its full potential. And it seems to be a nice one, but I think that it will take some time to get the most of it.

Suggestions and experiences are really welcome.