Walkthrough 3


The test system contained one hard disk with two partitions -

Note - this method will allow the RAM loaded XP installation to use a full pagefile by moving it to device (hd0,1) prior to creating the disk image.

Note - this method assumes that the disk image has already been created (or a downloaded image is used). Disk image \my_disk.ima on device (hd0,1) is used below.

  1. Boot the Windows XP installation on (hd0,0) and prepare the Windows installation for copying - install firadisk, disable system restore and hibernation (follow the instructions here).
  2. Assuming that (hd0,0) is mounted as drive C: and (hd0,1) is mounted as drive D:, change the pagefile settings and install it to drive D: -
  3. Install any required programs using device (hd0,1) (D: drive) as the install location. Using this approach combined with the registry edits in steps 9-11 it is possible to install (m)any required programs for use from the RAM loaded Windows XP whilst still keeping the XP installation on (hd0,0) as small as possible for copying to the disk image. Note - some programs (e.g. .NET framework) will automatically be installed to the system drive).
  4. Reboot the computer and boot into LiveXP. An assumption is made in the remaining steps that device (hd0,0) is mounted as drive C: and (hd0,1) is mounted as drive D:
  5. Delete all files in the C:\Windows\System32\dllcache\ folder.
  6. Use the following command to mount disk image D:\my_disk.ima (hard disk type with MBR - first partition offset 63rd sector) as drive R:-
    imdisk.exe -a -f D:\my_disk.ima -m R: -b 32256 [enter]
  7. Create text file D:\exclude.txt in notepad, containing the following text (note the inclusion of grldr to the exclusion file - remember that Grub4dos is installed on (hd0,0). Ensuring that grldr is not copied to the disk image and carrying out an edit to boot.ini in step 12 will prevent the disk image from rebooting to Grub4dos) -
  8. Use the following command to copy the XP installation from drive C: to drive R: (the mounted disk image) -
    xcopy C:\ R:\ /exclude:D:\exclude.txt /e /c /i /h /k /x /y /w [enter]
  9. Load the SYSTEM registry hive in the mounted disk image as HKLM\firadisk using the following command -
    reg load HKLM\firadisk R:\windows\system32\config\system [enter]
  10. Start regedit and browse to the HKLM\firadisk\MountedDevices key, then delete all values except \DosDevices\D:
  11. Unmount the HKLM\firadisk hive (R:\Windows\System32\config\SYSTEM) by entering the following command at a command prompt -
    reg unload HKLM\firadisk[enter]
  12. Open R:\boot.ini and edit the paths to ensure that multi(0)disk(0)rdisk(0)partition(1) is used. Delete the C:\grldr="Grub4DOS" entry
  13. Unmount the disk image using the following command -
    imdisk -d -m R:[enter]
  14. Add an entry to menu.lst -

On the test system Windows XP booted successfully from the disk image. The booted disk image was allocated the C: drive letter, (hd0,0) was mounted as drive E: and (hd0,1) was mounted as drive D:. No issues were noted regarding the pagefile or using the programs installed to the D: drive.