The test system was set up with two Windows XP installations -
- Windows XP installed on device (hd0,0) - first hard disk, first partition. This OS will be used to create and mount a disk image and to copy the XP installation configured for RAM booting.
- Windows XP installed on device (hd0,1) - first hard disk, second partition. This OS will be configured for RAM booting and copied to a disk image.
- Grub4dos installed to (hd0,0) - booted via the Windows NT loader ntldr using boot.ini entry.
Firadisk will be used to create and mount the disk image and the Windows Disk Management console will create MBR and partition entries. The only other tool required for this method is Devcon (see here).
- Boot the Windows XP installation on (hd0,1) and follow the instructions here to reduce the size of the Windows installation for copying (install firadisk, remove pagefile, disable system restore and hibernation).
- Reboot the computer and boot the XP installation on (hd0,0).
- Assuming device (hd0,1), the Windows XP installation being copied, is mounted as drive D: - delete all files in the D:\Windows\System32\dllcache\ folder.
- Install the firadisk driver using devcon -
devcon install firadisk.inf root\firadisk
- Use the following script to create and mount a 1 GB disk image (adjust the parameters to suit your own needs) -
- Right-click on the disk in the bottom pane of the Disk Management console > select Initialize Disk > and click on the Ok button
- Partition the disk image and create a MBR. Right-click on the disk in the disk management window and select New Partition... to open the New Partition Wizard -
Mark the partition as active by right-clicking on the partition in the disk management window and select Mark Partition as Active, then close the Disk Management window
Use the following script to copy the XP installation from (hd0,1) to the mounted disk image (this assumes that (hd0,1) is mounted as drive D: and the disk image is mounted as drive R: - adjust the parameters to suit your own needs). Note - an exclusion file is automatically created when running the batch file -
Load the SYSTEM registry hive in the mounted disk image as HKLM\firadisk using the following command -
- Welcome to the New Partition Wizard - click on the Next > button
- Select Partition Type - select Primary partition and click on the Next > button
- Specify Partition Size - use all available space and click on the Next > button
- Assign Drive Letter or Path - select Assign the following drive letter: and select R from the list, then click on the Next > button
- Format Partition - select Format the partition with the following settings. Use File system: > NTFS, Allocation unit size: > Default and Volume label: > XP RAMDisk. Also select Enable file and folder compression then click on the Next > button
- Completing the New Partition Wizard - click on the Finish button
reg load HKLM\firadisk R:\windows\system32\config\system
Delete the HKLM\firadisk\MountedDevices key using the following command -
reg delete HKLM\firadisk\MountedDevices /f
Unload the disk image SYSTEM registry hive using the following command -
reg unload HKLM\firadisk
Open boot.ini and edit the paths to ensure that multi(0)disk(0)rdisk(0)partition(1) is used
Disable firadisk to unmount the disk image using command -
devcon disable root\firadisk
Add an entry to C:\menu.lst entry -
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 D: and (hd0,1) was mounted as drive E:.