Cloning Windows and replacing motherboards

From HelpDeskWiki

Cloning, the process of duplicating a hard drive for use on another system, is generally discussed in matter-of-fact terms, but there are a number of pitfalls relating to the steps that must be taken prior to duplication. Some of the same problems also apply when replacing a motherboard with one of a different model.


Table of contents

Changes needed for cloning and motherboard replacement

Preparing the drive before copying is necessary because several things must be changed between different systems. The first two items below apply to replacing the motherboard:

  1. The system type (HAL) may need to be changed in Device Manager in order for the system to boot up at all. This is described in more detail below.
  2. Chipset-specific drivers may need to be updated in order for the system to boot up at all. This is described in more detail below.
  3. The SID (Security IDentifier) must be different if the system is to be used in a domain. Changing the SID is strongly recommended when cloning a system.
  4. The computer name must be changed if the system is used in a network.
  5. If a volume-license version of Windows is NOT used, then the product key must be changed. If not using SysPrep, see this Microsoft article on changing the product key (http://support.microsoft.com/?kbid=328874).
  6. If a static IP address is used, the IP address must be changed.


SysPrep

SysPrep, which can be found on the Windows 2000, Windows XP Pro, and Windows Server 2003 CDs, is generally recommended as the tool of choice for preparing a drive for cloning. However, it has some poorly-documented side-effects. The most obvious side-effect is that it seems to install several Microsoft-specified icons, including the IE icon and the Set Program Access and Defaults icon, which partially voids the purpose of cloning in the first place. It also deletes the System Restore points, which makes it hard to undo a change that was made before SysPrep was run. It may also greatly and permanently increase the startup time in some cases, although this could be a fluke.

SysPrep is able to change the SID, update all device drivers, change the computer name to a semi-random value based upon the organization name, and prompt for the license key.


System type (HAL)

The system type, which controls which HAL (Hardware Abstraction Layer) is used, is listed in Device Manager, under Computer. The various types are not always especially compatible with each other.

On a Windows XP Pro system, the system types typically available are:

  • ACPI Uniprocessor PC
  • ACPI Multiprocessor PC
  • Advanced Configuration and Power Interface (ACPI) PC
  • MPS Multiprocessor PC
  • MPS Uniprocessor PC
  • Standard PC

Note that Standard PC is always an option. However, once you switch to it, you cannot switch back, unless a replacement HAL.INF is provided; see below. Standard PC does not offer the power management provided by ACPI, including the ability to shut off automatically, nor does it support APIC, which can cause the system to become flaky. If the system becomes flaky with Standard PC, unplug all non-essential devices, especially the network cable. Also, try going into the BIOS setup and selecting the reset configuration data option. Changing the PnP OS option may also help.

A Stop 0x0000007b message is typically generated when an incompatible HAL is used. The standard way to work around an incompatible HAL is by either doing an in-place update of Windows, or placing the drive back into a compatible computer and changing the HAL to Standard PC. See the section below on making all HAL types available in Device Manager.


Chipset-specific devices

Most of the chipset-specific devices are in the System devices section of Device Manager. The video card, network adapter, sound or other multimedia devices, and mass-storage device driver generally do not need to be changed, according to Microsoft. Chipset-specific drivers for USB do not seem to need to be changed either.

To make this change without the aid of SysPrep, go into Device Manager, locate the chipset-specific drivers (mostly in the System devices section), right-click and select Update Driver, and proceed to manually install the Standard driver which is available for the device type. If there is no Standard driver, then it does not need to be changed.

Upon the next boot, PnP will usually update these devices back to the correct chipset-specific drivers, although in some cases, you must manually cause it to update to the correct driver.

Note that SysPrep will delete all Device Manager entries (except for the system type), so that the list is clean. When preparing a drive manually, this option is not readily available, since deleted devices are quickly reinstalled, therefore the list must be cleaned out afterwards, if desired.


Editing HAL.INF so that all HALs are available

Locate HAL.INF in %SystemRoot%\INF, and copy it to HAL2.INF in the same folder. Then, edit HAL2.INF and replace the [GENDEV_SYS] and [COMPAQ_SYS] sections with:

[GENDEV_SYS]
%E_ISA_UP.DeviceDesc%     = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; Standard PC
%ACPIPIC_UP.DeviceDesc%   = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; ACPI PIC-based PC
%ACPIAPIC_UP.DeviceDesc%  = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; ACPI APIC-based PC (UP)
%ACPIAPIC_MP.DeviceDesc%  = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; ACPI APIC-based PC (MP)
%MPS_UP.DeviceDesc%       = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; MPS UP PC
%MPS_MP.DeviceDesc%       = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP  ; MPS MP PC
[COMPAQ_SYS]
%SYSPRO_MP.DeviceDesc%    = E_ISA_UP, E_ISA_UP_HAL, MPS_MP, MPS_MP_HAL, MPS_UP, \
                            MPS_UP_HAL, ACPIAPIC_MP, ACPIAPIC_MP_HAL, \
                            ACPIAPIC_UP, ACPIAPIC_UP_HAL, ACPIPIC_UP, \
                            ACPIPIC_UP_HAL, SYSPRO_MP_HAL, SYSPRO_MP

Note that when you go to change the system type in Device Manager, they will now be listed as NOT digitally signed. This is because the signature includes the INF file, which is now changed. Download HAL2.ZIP for a copy that is already modified for use with XP. Be sure to change the system type to Standard PC before cloning the drive or replacing the motherboard, and let Windows detect the correct system type afterwards. You will probably have to go into Device Manager and force it to update the driver. Note that often there are TWO drivers listed afterwards; delete whichever one will permit deletion. Note also that Windows does not always correctly detect the correct system type, and may detect Standard PC even when the system supports ACPI and APIC, and may also no longer turn off by itself, for unknown reasons. The manufacturer's pre-set type may be incorrect also; for example, the Compaq Presario S4020WM, which is a single-processor system, comes out of the box set to ACPI Multiprocessor.

Tweaking tips

Try to do all of your tweaking and testing before cloning, in order to minimize the amount of work to do afterwards. Also, if possible, make multiple backups of the hard drive along the way. This way, you avoid having to start all over again when you run into problems that you can't seem to fix. The more tweaking you do, the more likely that these irreversible problems will appear.

To do

  1. Find out how to clean out hardware drivers without Windows reinstalling them before the system is shut down.
  2. Find out how to change the HAL to Standard PC and clean out hardware drivers when the drive is slaved to another computer.
  3. Find out how to force drivers to be updated (especially the system type) without user intervention.