F
Frantisek Rysanek
Dear fellow usenetters,
I've developed a deterministic procedure of how to
move a live Windows 2000 install to a different disk
drive on a different controller (different driver,
even externally installed).
It took me a while to figure out and I'd like to share
a summary with others.
There are occasions when you'd like to move a working
Windows install onto a new hardware setup - without
reinstalling from scratch and without repairing the
setup from an install CD, which may break applications
that are already installed, service packs applied etc.
It's not a simple as copying the files, even ghosting
the partition won't do.
Let's have a machine with a single IDE disk drive,
with Windows 2000 installed on it.
The "NT boot loader" menu is based on a file
called C:\boot.ini. This Menu currently contains
a single entry - boot.ini says something like this:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional"
Using regedit.exe, check the disk volumes mounted - they're
listed at HKLM\SYSTEM\MountedDevices\*
Your only hard drive should be listed as something like
"\DosDevices\C:"
Consequently, the system boot goes like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C
Now suppose you install an exotic SCSI controller with a disk
drive attached to it (or a RAID controller of some kind, 3ware
for instance, with an array created on it). Configure the BIOSes
such that the original IDE drive is the first in BIOS order.
After you install the hardware, launch W2k from the original
C drive and install the drivers for the new disk controller
(the driver is not a standard part of the system).
Now the system contains two disk drives on two different
controllers: the original IDE "C" drive (containing Windows),
and the new drive on the additional controller (still empty).
On the original C drive, add a line to boot.ini:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional"
multi(0)disk(0)rdisk(1)partition(1)\WINNT="Microsoft Windows 2000 Professional"
The "multi(0)" root is used for Enhanced BIOS access (via int13) - there's
perhaps never a higher-numbered multi() device. Disk() is unused with
int13 access - always a zero. Rdisk() is the drive's ordinal number
and partition() is the partition's ordinal number. All the numbers are
zero-based, except for partition which is one-based.
Alternatively, instead of the multi() root, NT4 could also use a scsi() root
with slightly different semantics and with a dedicated driver stored in
C:\ntbootdd.sys (a renamed driver file from the manufacturer's driver
disk). W2k doesn't seem to be dependent on this (the default IDE driver
is not stored in ntbootdd.sys anymore). The point is that with
the Int13 BIOS call, only the first 8 GB of the disk are accessible,
whereas via the scsi() root and native drivers, the bootloader can
reach anywhere on a huge disk and is only limited by the SCSI and
NTFS limits, which are beyond todays hardware...
Now clone the disks - use your favourite disk copy tool,
whatever it is (Norton/Symantec ghost, standard unix dd
or whatever).
We already have the W2k driver installed - without it, the
system would return an INACCESSIBLE_BOOT_DRIVE blue
screen during second stage of loading from the new drive.
Hence, now the branching boot sequence looks like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C,disk1=D
rdisk1/part1 -> rdisk1/part1 -> disk0=C,disk1=D
You can't remove the first disk yet. If you did, the boot sequence
would look like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect1 -> rdisk1/part1 -> rdisk1/part1 -> disk0=C,disk1=D
This way, W2k stop loading just after the default blue "desktop"
is displayed. W2k actually complain about the swap file being
inaccessible - and either lock up with only the mouse moving
across the clear heavenly blue of the desktop, or repeat the
"swapfile inaccessible" message in a loop. Clearly, this way
Windows can't access the C drive.
Drive letters' mapping is set in the registry and can be changed
by Regedit.exe - which only works from graphical Windows environment.
Hence, still with both two drives in the system, boot Windows from the
_SECOND_ boot profile. This causes Windows to load from the new drive,
including the registry files - although most of the user-space
programs run by absolute paths from the C drive, which is why
Windows boot at all.
Next, run regedit and rename the labels on the C and D drives
(keeping their binary reference strings intact). The two keys
to cross-rename will be called
HKLM\SYSTEM\MountedDevices\DosDevices\C:
HKLM\SYSTEM\MountedDevices\DosDevices\D:
You'll probably need to do this in three steps, using a temporary
name in an intermediate step to avoid a "namespace clash".
Now you can try booting the first and the second boot profiles
in turns, watching the physical drives swapping letters in windows
with each reboot
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C,disk1=D
rdisk1/part1 -> rdisk1/part1 -> disk0=D,disk1=C
When the fun wears off, remove the first drive. Just unplug the
IDE ribbon cable. Then boot the machine again.
You should notice that the second profile is defunct - the new
drive is the first one now (actually zero'th) per BIOS numbering.
Booting the first profile yields a W2k system up and running
without a hitch ))
Mission accomplished.
Please note that the boot process up to and including the loading
of registry files runs along the BIOS numbering - whereas
drive letters are mapped based on some other controller&device
identification that's picked up from the registry (PnP ID's
or some such).
It would seem that quite a large portion of the boot process
actually runs using the hardware-specific driver but still
from the drive selected by BIOS numbering - without the driver,
the boot process fails much earlier than with it...
Also, let me stress once again that you need Windows up and running
from the original boot drive but already with the new hardware
in the system - in order to install the hardware drivers, to change
boot.ini and to change the mapping of the drives.
Please note that the disks can only be cloned after the hardware
drivers are installed. Similarly, the drive letters can only be
swapped once Windows boots from the _SECOND_ profile, still with both
drives in the system.
Caveat: there's BIOS numbering and there's Windows numbering.
If your original boot drive is not the first one in the system by
BIOS numbering, or if the new drive won't retain its Windows numbering
position in the new system, modify the procedure accordingly as respects
boot.ini and the drive letters mapping in the registry.
Essentially, the drive letter should remain the same in the target
system. The BIOS numbering doesn't have to be observed as long as
the target boot.ini contains a valid entry corresponding to the
BIOS-numbered position of the drive in the target system.
All of the above is based on a compilation of previously published
information.
Special thanks to Mr. Jiri Tuma of Seznam.cz for publishing the
boot.ini syntax some two years ago.
I hope this proves useful to someone.
Frank Rysanek
I've developed a deterministic procedure of how to
move a live Windows 2000 install to a different disk
drive on a different controller (different driver,
even externally installed).
It took me a while to figure out and I'd like to share
a summary with others.
There are occasions when you'd like to move a working
Windows install onto a new hardware setup - without
reinstalling from scratch and without repairing the
setup from an install CD, which may break applications
that are already installed, service packs applied etc.
It's not a simple as copying the files, even ghosting
the partition won't do.
Let's have a machine with a single IDE disk drive,
with Windows 2000 installed on it.
The "NT boot loader" menu is based on a file
called C:\boot.ini. This Menu currently contains
a single entry - boot.ini says something like this:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional"
Using regedit.exe, check the disk volumes mounted - they're
listed at HKLM\SYSTEM\MountedDevices\*
Your only hard drive should be listed as something like
"\DosDevices\C:"
Consequently, the system boot goes like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C
Now suppose you install an exotic SCSI controller with a disk
drive attached to it (or a RAID controller of some kind, 3ware
for instance, with an array created on it). Configure the BIOSes
such that the original IDE drive is the first in BIOS order.
After you install the hardware, launch W2k from the original
C drive and install the drivers for the new disk controller
(the driver is not a standard part of the system).
Now the system contains two disk drives on two different
controllers: the original IDE "C" drive (containing Windows),
and the new drive on the additional controller (still empty).
On the original C drive, add a line to boot.ini:
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional"
multi(0)disk(0)rdisk(1)partition(1)\WINNT="Microsoft Windows 2000 Professional"
The "multi(0)" root is used for Enhanced BIOS access (via int13) - there's
perhaps never a higher-numbered multi() device. Disk() is unused with
int13 access - always a zero. Rdisk() is the drive's ordinal number
and partition() is the partition's ordinal number. All the numbers are
zero-based, except for partition which is one-based.
Alternatively, instead of the multi() root, NT4 could also use a scsi() root
with slightly different semantics and with a dedicated driver stored in
C:\ntbootdd.sys (a renamed driver file from the manufacturer's driver
disk). W2k doesn't seem to be dependent on this (the default IDE driver
is not stored in ntbootdd.sys anymore). The point is that with
the Int13 BIOS call, only the first 8 GB of the disk are accessible,
whereas via the scsi() root and native drivers, the bootloader can
reach anywhere on a huge disk and is only limited by the SCSI and
NTFS limits, which are beyond todays hardware...
Now clone the disks - use your favourite disk copy tool,
whatever it is (Norton/Symantec ghost, standard unix dd
or whatever).
We already have the W2k driver installed - without it, the
system would return an INACCESSIBLE_BOOT_DRIVE blue
screen during second stage of loading from the new drive.
Hence, now the branching boot sequence looks like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C,disk1=D
rdisk1/part1 -> rdisk1/part1 -> disk0=C,disk1=D
You can't remove the first disk yet. If you did, the boot sequence
would look like this:
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect1 -> rdisk1/part1 -> rdisk1/part1 -> disk0=C,disk1=D
This way, W2k stop loading just after the default blue "desktop"
is displayed. W2k actually complain about the swap file being
inaccessible - and either lock up with only the mouse moving
across the clear heavenly blue of the desktop, or repeat the
"swapfile inaccessible" message in a loop. Clearly, this way
Windows can't access the C drive.
Drive letters' mapping is set in the registry and can be changed
by Regedit.exe - which only works from graphical Windows environment.
Hence, still with both two drives in the system, boot Windows from the
_SECOND_ boot profile. This causes Windows to load from the new drive,
including the registry files - although most of the user-space
programs run by absolute paths from the C drive, which is why
Windows boot at all.
Next, run regedit and rename the labels on the C and D drives
(keeping their binary reference strings intact). The two keys
to cross-rename will be called
HKLM\SYSTEM\MountedDevices\DosDevices\C:
HKLM\SYSTEM\MountedDevices\DosDevices\D:
You'll probably need to do this in three steps, using a temporary
name in an intermediate step to avoid a "namespace clash".
Now you can try booting the first and the second boot profiles
in turns, watching the physical drives swapping letters in windows
with each reboot
boot boot.ini registry files mounts
-----------------------------------------------------------
bootsect0 -> rdisk0/part1 -> rdisk0/part1 -> disk0=C,disk1=D
rdisk1/part1 -> rdisk1/part1 -> disk0=D,disk1=C
When the fun wears off, remove the first drive. Just unplug the
IDE ribbon cable. Then boot the machine again.
You should notice that the second profile is defunct - the new
drive is the first one now (actually zero'th) per BIOS numbering.
Booting the first profile yields a W2k system up and running
without a hitch ))
Mission accomplished.
Please note that the boot process up to and including the loading
of registry files runs along the BIOS numbering - whereas
drive letters are mapped based on some other controller&device
identification that's picked up from the registry (PnP ID's
or some such).
It would seem that quite a large portion of the boot process
actually runs using the hardware-specific driver but still
from the drive selected by BIOS numbering - without the driver,
the boot process fails much earlier than with it...
Also, let me stress once again that you need Windows up and running
from the original boot drive but already with the new hardware
in the system - in order to install the hardware drivers, to change
boot.ini and to change the mapping of the drives.
Please note that the disks can only be cloned after the hardware
drivers are installed. Similarly, the drive letters can only be
swapped once Windows boots from the _SECOND_ profile, still with both
drives in the system.
Caveat: there's BIOS numbering and there's Windows numbering.
If your original boot drive is not the first one in the system by
BIOS numbering, or if the new drive won't retain its Windows numbering
position in the new system, modify the procedure accordingly as respects
boot.ini and the drive letters mapping in the registry.
Essentially, the drive letter should remain the same in the target
system. The BIOS numbering doesn't have to be observed as long as
the target boot.ini contains a valid entry corresponding to the
BIOS-numbered position of the drive in the target system.
All of the above is based on a compilation of previously published
information.
Special thanks to Mr. Jiri Tuma of Seznam.cz for publishing the
boot.ini syntax some two years ago.
I hope this proves useful to someone.
Frank Rysanek