22 August 2013

How to install and run a full winxp on usb disk - Part 2

<< Back to Part 1

2. Make USB disk bootable with NTloader and Grub4Dos

2.1 Format the USB :

You need an USB disk larger than the disk image (4GB in this post). Format it with NTFS filesystem or FAT32 (make sure to backup it first !!!)


2.2 Make the USB disk bootable :

After format, suppose it has been mounted as D: drive. We will make it bootable by :
  • Make it as active partition (open Disk Management and right click / Set Active). 
  • Copy from C: drive these files (maybe you need to set Folder Options to show all hidden file) : ntldr, ntdetect.com, boot.ini
  • Search and download the Grub4Dos tool (or download here : https://drive.google.com/file/d/0B3OvTrPZEcO9M2hGZERaVHdJVUE/edit?usp=sharing ). Unzip it. Copy these files to the USB (D: drive) : grldr, grldr.mbr 

Now you need to place the ntloader bootcode onto the MBR of the USB disk. You will need the bootsect.exe tool (search for it in the WinVista or Win7 installation disc,  or download it here : https://drive.google.com/file/d/0B3OvTrPZEcO9NGVCeFpPNmRIUEE/edit?usp=sharing ), copy it to the C: drive. Then execute the command :

c:\bootsect.exe /nt52 d: /force

Now the USB disk can bootable, next we need to point NTLoader to load Grub4Dos. Edit the boot.ini file :

[boot loader]
timeout=10
default=c:\grldr
[operating systems]
c:\grldr="Grub4Dos"

Save the boot.ini file.

Let's restart the PC and boot from USB disk. The NTloader will load Grub4Dos according to the boot.ini file.


So, we now have the USB disk bootable according to :
  • Primary Active partition. 
  • NTloader in the MBR : ntldr, ntdetect.com, boot.ini 
  • Grub4Dos at second stage : grldr, grldr.mbr 

3. Boot the image by Grub4Dos.

3.1 Copy the vhd disk image to USB disk :

Restart the PC and copy the vhd image file (has been located at 1.6 step) to the USB disk. You should rename it from "winxp full.vhd" to "winxpfull.vhd" to kill the blank space.
3.2 Boot the disk image :

Reboot the PC and boot from USB disk, when Grub4Dos has been loaded, choose the command line menu. Enter these commands to load the WinXP image :

map (hd0,0)/winxpfull.vhd (hd0)
map --hook
chainloader (hd0,0)/ntldr
boot

and the WinXP image will be loaded as usual ... When done, you will see the disk image has been mounted as C: drive and the USB disk as D: drive. In Device Manager there also have a WinVblock disk appears under the Disk drive entry.

so we've almost done.

3.3 Create Grub4Dos menu entry :

Now we will create a menu entry for auto loading the image instead of manually typing the commands. On the USB disk (D: drive), create a text file named D:\menu.lst with the content :

timeout 5
default 0
title Boot to Winxp.vhd
map (hd0,0)/winxpfull.vhd (hd0)
map --hook
chainloader (hd0,0)/ntldr

Reboot the PC and boot from USB to see the result :

So, we have done for a full Winxp running in USB disk. You can try it on different PC to see the result.

Video show :




Known issue :

  • Not contiguous image file : You need to defragement the image file before load it.
  • Boot hang on new machine with SATA/AHCI controllers : Enter BIOS and switch the SATA/AHCI controller to use Compatible/Legacy mode. 

<< Back to Part 1