The test system contained one hard disk with two partitions -
- Windows XP installed on device (hd0,0) - first hard disk, first partition. This OS will be configured for RAM booting and copied to a disk image.
- (hd0,1) data storage, program files and pagefile.
- Grub4dos installed to (hd0,0) - booted via the Windows NT loader ntldr using boot.ini entry.
- (cd0) - DVD drive that will be used to boot a Windows XP based PE disc (LiveXP). The PE image must have ImDisk installed.
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.
- 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).
- 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: -
- Click on the Start menu and then right-click on My Computer and select Properties
- Select the Advanced tab, and click on the Settings button in the Performance section
- Select the Advanced tab in the Performance Options window and click on the Change button in the Virtual memory section
- Highlight the C: drive in the Drive list and make a note of the initial and maximum sizes, then select No paging file and click on the Set button. Now highlight the D: drive in the Drive list and select Custom size: and enter the required sizes, then click on the Set button then click on OK. You will be prompted with the message The changes you have made require you to restart your computer before they can take effect. - click on the OK button
- Close any open windows and restart the computer - booting back into the Windows XP installation on device (hd0,0).
- 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).
- 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:
- Delete all files in the C:\Windows\System32\dllcache\ folder.
- 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]
- 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) -
- 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]
- 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]
- Start regedit and browse to the HKLM\firadisk\MountedDevices key, then delete all values except \DosDevices\D:
- Unmount the HKLM\firadisk hive (R:\Windows\System32\config\SYSTEM) by entering the following command at a command prompt -
reg unload HKLM\firadisk[enter]
- 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
- Unmount the disk image using the following command -
imdisk -d -m R:[enter]
- 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.