Copy of an XP system from one volume to another volume as another bootable XP system.

vers page en franšais

It is useful to have several operating systems and to be able to copy systems:

It is possible to do a backup (as a new operating system) Restoration is not needed when the backup can be operated.

It is possible to test several version of a program in separate systems

 If an update (new version of a program or of an operating system) does not operate correctly it is possible to use the old version and also debug the new one.

All these possibilities are cheap:
The storage of a full system cost around $10 of hard drive space.
There are free programs to copy systems and to boot a system among several systems.
The time to copy an entire system is around 10 mn with a recent computer.

The system copy is easy for Windows Me but with Windows XP it is more difficult to obtain (by copy) several systems.

Main difficulty:
Each disk has a signature (written on the disk) and each volume has an identifier (written on the volume, specific to the disk and the volume). The registry assigns letters to identifiers (at install or when a new disk is added).

Some consequences:
When a new disk is added: the registry assigns or reassigns letters not in use at that time to the volumes of the new disk (even if the letters have been already assigned to a disk now absent). When a new disk is added all the disks already recognized must be present.
If a drive is cloned (and if you keep the old disk in the system) there will be duplicate disk signatures and duplicate volume identifiers. To boot on a new cloned drive you must take of the old drive (for the first boot)
When a system on a source volume is copied to a destination volume, the registry of the destination volume points to many files on the source volume (the volume letters do not change in this registry). It is possible to boot to this destination volume only if the source volume is present. It is not safe to operate a long time in this state because this may damage both systems as some files are common.

I try to describe a method to copy an XP system (it is perhaps not the best one).
I don't use drive cloning but I copy the partition using savepart with the option "copy of the occupied sectors only". This tool can copy FAT32 or NTFS partitions

1 Preparation of the hard drives.
It is better to have on each disk three primary partitions of the same size. Itis convenient to namethe volumes with the rank of the partition and the name of the disk.

2 Preparation of the tools
Create a dos boot floppy as explained at ( FAQ). and add savepart.exe. The CDROM driver is not useful, the mouse driver is usefull.Create a boot floppy to boot an XP with a corrupt boot.ini. This floppy has only three files: Ntldr, and an universal boot.ini hereafter:
[boot loader]
 [operating systems
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Pro disk 0 partition 1" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Pro disk 0 partition 2" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft Windows XP Pro disk 0 partition 3" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Pro disk 1 partition 1" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(1)partition(2)\WINDOWS="Microsoft Windows XP Pro disk 1 partition 2" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(1)partition(3)\WINDOWS="Microsoft Windows XP Pro disk1 partition 3" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(2)partition(1)\WINDOWS="Microsoft Windows XP Pro disk 2 partition 1" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(2)partition(2)\WINDOWS="Microsoft Windows XP Pro disk 2 partition 2" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(2)partition(3)\WINDOWS="Microsoft Windows XP Pro disk 2 partition 3" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(3)partition(1)\WINDOWS="Microsoft Windows XP Pro disk 3 partition 1" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(3)partition(2)\WINDOWS="Microsoft Windows XP Pro disk 3 partition 2" /fastdetect /noexecute=optin
multi(0)disk(0)rdisk(3)partition(3)\WINDOWS="Microsoft Windows XP Pro disk 3 partition 3" /fastdetect /noexecute=optin  
Do not use /noexecute=optin for the XP systems before SP2

3 Preparation of the source volume
Boot on the source volume and check the boot letter (this letter must be used later). If there are several hard drives note the rank of the drives (in disk management) this is useful to write a correct boot.ini.  The boot disk is the drive 0 the rank of the others  is  primary master primary slave secondary master secondary slave.
It is better to suppress system restore and indexing service for all volumes and to keep on the source volume pagefile.sys and all programs or files referenced in the registry. This floppy can boot an XP system which has lost one of its boot files (ntldr boot.ini it is useful for a first boot on a system when the boot.ini does not point to this system.

4 Copy of the files from the source volume to the destination volume
Boot on the savepart floppy, type savepart, chose "copying element", chose the source, choose "occupied sectors only", chose the destination.

5 Modifications to be able to boot on the new system on the destination volume
Boot on the source system (If the boot on the source system is not possible use the boot floppy.) The destination volume has now the same name as the source volume, modify its name (its letter may help to find which is the old one or use the disk management). Add lines for the new system in boot.ini which must point to the new volume and new drive. See Reviewing and Correcting Boot.ini Settings on x86-based Systems and boot.ini example.

6 Modification to be able to run the new system
Boot on the new system on the destination volume in safe mode (if it is not possible use the above boot floppy).
The letters of the source volume and of the destination volume must be swapped in the registry of the destination volume in use.
For that use the Knowledge Base article Q223188 ( regedit : HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, right click on volume, chose rename for instance C to Z, D to C, Z to D, reboot). Then the new system does not need the source volume.
Any other operation may corrupt both systems.
If necessary check the boot letter.
Verify errors in the events journal. Then the new system does not need the source volume and is fully operational

Remark: It is not possible to chose the operating system boot partition letter: it is necessary to use the letter for which the registry operates normally. (It is the letter of the operating system boot partition when this XP system has been installed, letter which is used in many registry keys)

7 Boot on any primary partition
To separate completely the volumes I prefer:
-to choose the drive in the bios,
- to use a small boot manager in each MBR in order to choose the boot volume in each drive,
-to place in each volume ("operating system boot partition") XP boot files (Ntldr boot.ini so each partition can become also "system partition" and the loss of a volume does not prevent the boot on another volume. It is not the case if there is only one boot.ini in the computer.
mountvol /? give the volumes GUID

How to check the letter of the registry in use

(only useful with several XP systems)
Use set to see the environment variables
Open a dos windows and type
(letter):             (to go to the volume)
cd \                    ( to go to the root)
cd  %windir%   if you go to the windows directory this is the letter of the registry
if you stay in the root, this volume doesn't host the registry in use

Copy using xxcopy

xxcopy keeps the short files names.   
xxcopy ( ) can copy on a partition smaller than the source partition (version or later runs on XP). But you must run xxcopy outside the system that you want to copy. For instance in XP on another partition or in a floppy after boot on a  CD BartPE (BartPE in french) or UBCD4Win    
example copy of d: to e: (with run cmd)
xxcopy d:\ e:\ /clone /exlist.lst /onerror.txt    (this command suppress all the files initially on e:\)
the text file list.lst contains three lines which are the path to three files which must not be copied: (/exlist.lst  is not necessary)

"d:\System Volume Information"

/onerror.txt asks to save the list of errors in the file error.txt

A small boot manager for basic disks

The small boot manager described afterwards is entirely written on the MBR its operation is not modified when operating systems or even partitions are modified or copied. Sophisticated boot managers are installed in partitions or in operating systems and if you want to copy operating systems or to change partitions it is necessary to adapt the boot manager.
I have modified the John S. Fine's program smbmbr.asm at
The modified version smbnew.asm can be used with disks above 8 Go and with Windows XP (disk signature)
The boot disk must be chosen with the bios
Smbnew can boot only on one of the primary disk partitions (cannot boot extended partition).
Smbnew.asm can be modified compiled and linked easily in the same manner that John Fine explains for the original version smbmbr.asm. You can also install directly the binary file smbnew.bin: this is explain below.

Program utilisation
Only four choices:
Type 1 to boot on the first partition,
Type 2 to boot on the second partition,
Type 3 to boot on the third partition
Type 4 to boot on the fourth partition
If no entry : boot on the last partition used

Once installed it does not need modifications if partitions are modified or if operating systems are copied, transferred: no risk of errors.

Before to boot on a floppy (or CD ROM), boot before on the disk partition which must be active
(even if not yet bootable: it is only to activate this partition in the MBR)

At boot are displayed:
- the last partition used (To boot on another partition enter the partition number)
- "SMBMBR" (If you have several disks it is recommended to replace "SMBMBR" by the name of the disk. This can be done directly in the .bin file without compiling and linking)
- a beep is emitted to ask for a key
- the partition effectively booted (or error messages)

Error messages:
- "1 2 3 or 4 only ": you have entered a key which is not - 1 2 3 or 4 try again
- "no partition " the key is accepted but no partition exists on the disk for this key, try again
- "disk error" : cannot read or write the disk
other messages are from the bios or from the booted partition.

Modifications possible without compilation
Replace smbmbr by the name of the disk . Some delays can also be changed.

Before installation
See XP documentation on Master Boot Record on Basic Disks
Prepare a dos boot disk with minimal files (like to flash a bios) see
Add the following files:
- partcopy.exe
- a small disk sector editor (like diskedit )
- the binary file smbnew.bin to be transferred to the MBR (modified for the name of the disk)

After a boot on the floppy
Save the beginning of the disk on the floppy
partcopy -h0 0 10000 original.mbr
As another backup, copy the original first sector of the disk on for instance the fifth sector
partcopy -h0 0 200 -h0 800
Install the binary file on the MBR
partcopy smbnew.bin 0 1b4 -h0 (1b4 is the length of the copied zone)
As a backup copy the new first sector on for instance the fourth sector
partcopy -h0 0 200 -h0 600
and the beginning of the disk on the floppy
partcopy -h0 0 10000 smbnew.mbr

Some precautions
To install on a disk it is better to remove all other disks (for instance disconnect the small power connector).
Use the disk editing program to check the beginning of the disk before and after a write operation : The end of the first sector (1b4 to 200) must not change. If it is modified all the disk data may be lost.
It is safer to experiment when adding a new empty disk. In this case and if after unsuccessful experiments the disk cannot be partitioned with fdisk it is probable that garbage has been written in the partition table. To recover the disk, erase the
partition table or the first sector of the disk with a small disk editor

May be necessary for instance after a new XP or Me installation (which writes a new MBR ). To modify a MBR on a disk it is better to remove all other disks. After boot on the smbnew installation floppy it is useful to read the MBR with the small sector editor to know what is modified (boot manager or partition table). To restore smbnew from the file on the floppy type
partcopy smbnew.mbr 0 1b4 -h0
To restore from the fourth disk sector type
partcopy -h0 600 1b4 -h0
It is possible to restore also the partition table and the signature (all the sector: partcopy -h0 600 200 -h0) but be sure that the backup is recent: a partition modification could have be done since the last backup (for instance FAT32 to NTFS).

Modifications with compilation and link
See same operations can be done with the new source smbnew.asm

boot.ini for several XP with XP menu without small boot manager

It is the classical configuration
3 disks on HPT370 controller
Primary master D60 with 2 primary partitions as boot partitions: D60 1, D60 2,
Primary slave B60 with 3 primary partitions as boot partitions: B60 1, B60 2, B60 3
Secondary master B45 with 3 primary partitions as boot partitions: B45 1, B45 2, B45 3
Windows Me on B45 1, Linux on B45 3, XP on the other partitions. The boot disk (chosen in HPT370) is B45
In this case I find that the first disk is B45 rdisk(0), second D60 rdisk(1) and third B60 rdisk(2).
The boot.ini in B45 1 (system partition) is:

[boot loader]
[operating systems]
C:\ = "Microsoft Windows Me B45 1"
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professionnel B45 2" /fastdetect
C:\linux.ini="Linux B45 3"
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Professionnel D60 1" /fastdetect
multi(0)disk(0)rdisk(1)partition(2)\WINDOWS="Microsoft Windows XP Professionnel D60 2" /fastdetect
multi(0)disk(0)rdisk(2)partition(1)\WINDOWS="Microsoft Windows XP Professionnel B60 1" /fastdetect
multi(0)disk(0)rdisk(2)partition(2)\WINDOWS="Microsoft Windows XP Professionnel B60 2" /fastdetect
multi(0)disk(0)rdisk(2)partition(3)\WINDOWS="Microsoft Windows XP Professionnel B60 3" /fastdetect

C:\ must have Ntldr and
the file C:\linux.ini has been created using a small disk sector editor to save the first sector of the linux boot partition B45 3 to a file.

Letters after boot on one of theses 7 primary partitions 

One XP system installed as C:\ then 5 copies of this XP

Windows Me sees only the three Fat32 partitions

D60_1  D60_2 B60_1  B60_2  B60_3  B45_2 B45_1
D60_1 C D D D D N
D60_2 K C K N O D
D60_3 I I I I I I
D60_4 E E E E E E
D60_5 F F F F F F
D60_6 G G G G G G
B60_1 D K C K K K
B60_2 N N N C N O
B60_3 O O O O C P
B60_4 H H H H H H
B60_5 L L L L L L
B60_6 M M M M M M
B45_1  Q Q Q Q Q Q C
B45_2 V V V V V C E
B45_6 T T T T T T D
B45_7 U U U U U U
The extended partitions letters do not change in XP. If necessary the primary partitions letters (other than C:) can be changed using the XP disk manager.
The XP menu is easy to use but a corruption of the B45 1 partition may prevent the boot. In the two following solutions it is always possible to boot on an XP system even if all others partitions are lost

boot.ini for each XP with a small boot manager without XP menu

An example to boot on the second partition of the boot disk without XP menu:

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professionnel" /fastdetect

The second partition has this boot.ini and Ntldr and (The system partition is also boot partition)
If you use smbnew the boot disk is choosen in the bios. All the files boot.ini will have multi(0)disk(0)rdisk(0).
After a copy the volume number must be updated in the line multi(0)disk(0)rdisk(0)partition(?) of the boot.ini of the volume which boot directly on this volume (without XP menu).

boot with XP menu or with a small boot manager

The default boot disk (default system partition) has a usual boot.ini with a menu (see above) the other XP volumes have a simplified boot.ini (and Ntldr and
With this configuration it is possible as usual to choose the boot partition with the XP menu. If the default system partition become corrupted it is possible to boot directly on any other (system and boot) partition using the small boot manager smbnew. (it is even possible to have several volumes with an XP menu).
To copy Vista
To copy Windows 7

may 10 2011 _________g@gjullien.fr___________