- Jan 23, 2003
- 517
- 0
- 0
I just ran through all of this and a bag of chips, so I thought I would post the reults of my labour. I will try to also state why certain methods work and other fail.
BIG NOTE: Never ever mess with your original drive for the moment. EVER. Don't delete it, copy it, or modify it. If any of this fails, you will ahve to plug it back in and boot off of it. So don't mess with it. Until you get the new drive working 100%, consider it read-only. This includes registry keys and the like. You could run something like SYSPREP before copying, but that isn't covered here.
My first method was tring to copy everything across to the new drive directly in Windows. That will fail.
Windows File Locks prevent you from copying all files you will need over, such as your current user files or system files currently in use. We need to get around this. Additionally, checking using the SeaTools bootable CD utility, the drive wasn't flagged as being bootable. The MBR didn't think the drive could boot, so I got "BOOT FAILURE FROM PREVIOUS DEVICE" errors after POST. If you get those, check to see the drive and partition is flagged as bootable. (The bootable CD that came with my Seagate had this under 'Show advanced drive information')
Second method was using the SeaTools in-windows utilities to copy data.
This worked for the most part, but required me to repartition the new drive. This meant all data that WAS on the drive from my attempt to copy in Windows would be wiped. However, it did make it flagged as bootable. The copy process steamrolled over any errors, requiring no user input (a good thing).
But, the copy process was rather slow and some files could not be copied. This wasn't that bad, since it kept a log of which files failed. If you open up the error log after the copy which is located in the program's folder (which you should enable if it isn't already), you might see something like EVENT.LOG, which is the security logs, and aren't really that important to copy over. However, some of the other files are important, like NTUSER.DAT in your home folder. Using this in conjunction with BartPE to copy over files that are in use that are omitted from the mass copy works well.
Third method was booting using something like BartPE and copying all data over in an isolated environment.
Works great, and you should be able to access all your NTFS files, but there are some minor issues. This might run into a couple of files withe nams that are too long, and also hits a problem of directories with a '.' as the first character (e.g. OpenSSH installs a '.ssh' folder to your home directory). Also, some files may get strange errors, since the copy utility isn't all that robust. I recommend copying bulk using a drive utility available free from companies like Seagate and using BartPE for the remainder of files which were unable to be copied (as noted in a convenient .txt log).
If you cannot or do not wish to use the drive copy utility, make sure the drive is flagged as bootable, then copy directories one by one from the root so you know what directories give an error. You then have to go in and fix each problem yourself. Keep in mind the offending file may be a couple directories deep, so you have to be pretty technical to know exactly where it is coming from by just the name. Until there is a better copy utility in BartPE, this is also not that great.
Fourth method was using a drive imaging utility like Ghost from BartPE or a boot disk.
This type of software usually isn't free, so this is more restrictive. However, you can get a perfect copy from the original drive to the new one. Beyond that, all you then have to deal with is the problems Windows throws up when it is done...
Problems Windows may create when a 'perfect copy' of all files is complete
At this point you could just do a Repair Install off the Windows CD, but since that impies redownloading everything and applying all your patches and customizations we made again, we can't do that. This section is about the 'funky errors' that specificallly come up from trying to boot after copying the drive data over. You may get other, weirder errors if you are running odd bootup utilities or the like.
You may now have to worry about Permissions. (This section may only apply to power users of XP Pro who have enabled Advanced Filesharing) Windows has a nasty habbit of not allowing itself access to files, thereby making boot impossible since the critical system files are inaccessible. If you still have the good installation on the old hard drive, this isn't as much of an issue as you can always boot from that, and change the permissions on the new hard drive from inside Windows.
If you don't have the original drive anymore, you would have to somehow get it under a XP-like install where you can set security policies on all files, and 'Take Ownership' of all files on the drive. Then you may even have to set EVERYONE permissions to FULL CONTROL on everything to get it to work. In my case, I double checked permissions were sensible and inhereted (YMMV) before I did the image.
At this point I would say DISCONNECT THE OLD HARD DRIVE. Past his, it may only cause problems to have two hard drives hooked up at once. If you reboot and you get a BIOS warning, you didn't do what I said a couple of paragraphs up. If you get Windows Errors, you are at least headed in the right direction. If you boot using the Windows XP Setup CD and go into Recovery Console, you can use the command 'FxMBR' to fix the Master Boot Sector and FixBoot <driveletter> to rewrite the boot sector on that drive. There is also fdisk /MBR, which *may be destructive*. You can also use BOOTCFG /REBUILD (it has other parameters, play around) to reconstruct the boot.ini file. BOOTCFG can scan for, and then use, Windows installations it finds. If you removed the old hard drive, there should be only one, and if you run it again, you may end up with multiple copies of the same entry. If you don't have a boot.INI, the default parameter for most XP installs is "/fastdetect", and the name really isn't all that important.
Run the commands in this order: FixMBR by itself, reboot. If the problem persists, go back into recovery console, type fixMBR, Fixboot <drive letter>. Should that fail as well, go back and so the same, then use the BOOTCFG /REBUILD to fix the boot.ini.
In my situation, it started booted Windows fine when I copied over the boot files in the imaging process (boot.ini, NTLDR, NTDETECT.COM) and removed the old hard drive before booting again.
Now, if you can remove the old drive physically from the system and you can boot and log in, you are golden. Just to cleanup work from here...
What to if you get to the Login/Welcome Screen and there are no user accounts present
This part is where it gets really messy. Windows grabs a unique ID from each drive and uses it to mark that drive at itself. This is why you can have a removable hard drive and it will always get the same drive letter even if you remove it and reconnect it. It's like a drive serial number.
This also interferes in the boot process, as Windows gets confused why it just booted from a drive it previously thought was something other than C:\. (Let's use the example that it was G:\ to windows when hooked up next to it before all this). This somehow makes Windows not show any user accounts, and even disable manual login (this does nothing if this is the case). Also, when trying to boot into any type of safe mode, you will get the login screen with no accounts. This is the same reasoning, so don't bother.
What you need to do at this point is documented
here. For the sake of brevity, you basically need to go into the registry and change the drive ID-to-letter associations around so that it thinks the drive it just booted from WAS the C:\ drive. But how do you edit the registry if the computer won't boot, you ask? And you can't edit the raw registry files from Recovery Console? The answer is below.
How to edit the registry hives from the files stored on the hard drive without booting that installation
First you need a BartPE disk, or a WinPE disk. Anything which can run natively regedit.exe will work, although BartPE is more useful overall, an this only covers that. When you run regedit.exe on BartPE, you will be given the registry of BartPE itself, not that of the drives under it. You need to click on HKEY_USERS to highlight it, then click File->Load Hive. Then merely browse to <New Drive Letter>:\Windows\System32\ and type *.* in the file box, hit enter to display all files, then select SYSTEM. You should type a name like TEMPORARY so that you don't accidentally overwrite something or merge it with an existing key. Go to the registry key \HKEY_USERS\TEMPORARY (or the name you typed)\SYSTEM\MountedDevices . Then just find what your Old Windows install called the new drive, and swap the names.
Example (old drive thought the new drive was G
:
"\DosDevice\C:" 31 c1 30 21 02 13 51 23 13 <- Your original drive
"\DosDevice\G:" 00 2a 2b 4f 22 ac 12 c3 02 <- The drive you just copied everything to
"\DosDevice\I:" 22 da 2a 21 50 f8 12 43 a2
Right click on \DosDevice\C: and rename it to be another letter, whatever you want Windows to call the drive when you hook it up again (*do not* use a letter already there, in this case I
. Then, right click on the new drive (remember, it was G: to your old windows install) in this case, \DisDevice\G:, and change it to C:\. Now click File->Unload Hive, and the changes should be saved to the registry file on the new hard drive! Reboot, remove the CD, and you should be staring at the same welcome screen of the drive you imaged as if you just logged back on.
Hope this helps!
And remember, I can take no reponsibility if you nuke your own data or image the wrong direction, yadda yadda yadda so just be careful. This isn't meant to be a walkthrough, only how to go about it if you happen to be doing the same thing I did. Keep that in mind.
BIG NOTE: Never ever mess with your original drive for the moment. EVER. Don't delete it, copy it, or modify it. If any of this fails, you will ahve to plug it back in and boot off of it. So don't mess with it. Until you get the new drive working 100%, consider it read-only. This includes registry keys and the like. You could run something like SYSPREP before copying, but that isn't covered here.
My first method was tring to copy everything across to the new drive directly in Windows. That will fail.
Windows File Locks prevent you from copying all files you will need over, such as your current user files or system files currently in use. We need to get around this. Additionally, checking using the SeaTools bootable CD utility, the drive wasn't flagged as being bootable. The MBR didn't think the drive could boot, so I got "BOOT FAILURE FROM PREVIOUS DEVICE" errors after POST. If you get those, check to see the drive and partition is flagged as bootable. (The bootable CD that came with my Seagate had this under 'Show advanced drive information')
Second method was using the SeaTools in-windows utilities to copy data.
This worked for the most part, but required me to repartition the new drive. This meant all data that WAS on the drive from my attempt to copy in Windows would be wiped. However, it did make it flagged as bootable. The copy process steamrolled over any errors, requiring no user input (a good thing).
But, the copy process was rather slow and some files could not be copied. This wasn't that bad, since it kept a log of which files failed. If you open up the error log after the copy which is located in the program's folder (which you should enable if it isn't already), you might see something like EVENT.LOG, which is the security logs, and aren't really that important to copy over. However, some of the other files are important, like NTUSER.DAT in your home folder. Using this in conjunction with BartPE to copy over files that are in use that are omitted from the mass copy works well.
Third method was booting using something like BartPE and copying all data over in an isolated environment.
Works great, and you should be able to access all your NTFS files, but there are some minor issues. This might run into a couple of files withe nams that are too long, and also hits a problem of directories with a '.' as the first character (e.g. OpenSSH installs a '.ssh' folder to your home directory). Also, some files may get strange errors, since the copy utility isn't all that robust. I recommend copying bulk using a drive utility available free from companies like Seagate and using BartPE for the remainder of files which were unable to be copied (as noted in a convenient .txt log).
If you cannot or do not wish to use the drive copy utility, make sure the drive is flagged as bootable, then copy directories one by one from the root so you know what directories give an error. You then have to go in and fix each problem yourself. Keep in mind the offending file may be a couple directories deep, so you have to be pretty technical to know exactly where it is coming from by just the name. Until there is a better copy utility in BartPE, this is also not that great.
Fourth method was using a drive imaging utility like Ghost from BartPE or a boot disk.
This type of software usually isn't free, so this is more restrictive. However, you can get a perfect copy from the original drive to the new one. Beyond that, all you then have to deal with is the problems Windows throws up when it is done...
Problems Windows may create when a 'perfect copy' of all files is complete
At this point you could just do a Repair Install off the Windows CD, but since that impies redownloading everything and applying all your patches and customizations we made again, we can't do that. This section is about the 'funky errors' that specificallly come up from trying to boot after copying the drive data over. You may get other, weirder errors if you are running odd bootup utilities or the like.
You may now have to worry about Permissions. (This section may only apply to power users of XP Pro who have enabled Advanced Filesharing) Windows has a nasty habbit of not allowing itself access to files, thereby making boot impossible since the critical system files are inaccessible. If you still have the good installation on the old hard drive, this isn't as much of an issue as you can always boot from that, and change the permissions on the new hard drive from inside Windows.
If you don't have the original drive anymore, you would have to somehow get it under a XP-like install where you can set security policies on all files, and 'Take Ownership' of all files on the drive. Then you may even have to set EVERYONE permissions to FULL CONTROL on everything to get it to work. In my case, I double checked permissions were sensible and inhereted (YMMV) before I did the image.
At this point I would say DISCONNECT THE OLD HARD DRIVE. Past his, it may only cause problems to have two hard drives hooked up at once. If you reboot and you get a BIOS warning, you didn't do what I said a couple of paragraphs up. If you get Windows Errors, you are at least headed in the right direction. If you boot using the Windows XP Setup CD and go into Recovery Console, you can use the command 'FxMBR' to fix the Master Boot Sector and FixBoot <driveletter> to rewrite the boot sector on that drive. There is also fdisk /MBR, which *may be destructive*. You can also use BOOTCFG /REBUILD (it has other parameters, play around) to reconstruct the boot.ini file. BOOTCFG can scan for, and then use, Windows installations it finds. If you removed the old hard drive, there should be only one, and if you run it again, you may end up with multiple copies of the same entry. If you don't have a boot.INI, the default parameter for most XP installs is "/fastdetect", and the name really isn't all that important.
Run the commands in this order: FixMBR by itself, reboot. If the problem persists, go back into recovery console, type fixMBR, Fixboot <drive letter>. Should that fail as well, go back and so the same, then use the BOOTCFG /REBUILD to fix the boot.ini.
In my situation, it started booted Windows fine when I copied over the boot files in the imaging process (boot.ini, NTLDR, NTDETECT.COM) and removed the old hard drive before booting again.
Now, if you can remove the old drive physically from the system and you can boot and log in, you are golden. Just to cleanup work from here...
What to if you get to the Login/Welcome Screen and there are no user accounts present
This part is where it gets really messy. Windows grabs a unique ID from each drive and uses it to mark that drive at itself. This is why you can have a removable hard drive and it will always get the same drive letter even if you remove it and reconnect it. It's like a drive serial number.
This also interferes in the boot process, as Windows gets confused why it just booted from a drive it previously thought was something other than C:\. (Let's use the example that it was G:\ to windows when hooked up next to it before all this). This somehow makes Windows not show any user accounts, and even disable manual login (this does nothing if this is the case). Also, when trying to boot into any type of safe mode, you will get the login screen with no accounts. This is the same reasoning, so don't bother.
What you need to do at this point is documented
here. For the sake of brevity, you basically need to go into the registry and change the drive ID-to-letter associations around so that it thinks the drive it just booted from WAS the C:\ drive. But how do you edit the registry if the computer won't boot, you ask? And you can't edit the raw registry files from Recovery Console? The answer is below.
How to edit the registry hives from the files stored on the hard drive without booting that installation
First you need a BartPE disk, or a WinPE disk. Anything which can run natively regedit.exe will work, although BartPE is more useful overall, an this only covers that. When you run regedit.exe on BartPE, you will be given the registry of BartPE itself, not that of the drives under it. You need to click on HKEY_USERS to highlight it, then click File->Load Hive. Then merely browse to <New Drive Letter>:\Windows\System32\ and type *.* in the file box, hit enter to display all files, then select SYSTEM. You should type a name like TEMPORARY so that you don't accidentally overwrite something or merge it with an existing key. Go to the registry key \HKEY_USERS\TEMPORARY (or the name you typed)\SYSTEM\MountedDevices . Then just find what your Old Windows install called the new drive, and swap the names.
Example (old drive thought the new drive was G
"\DosDevice\C:" 31 c1 30 21 02 13 51 23 13 <- Your original drive
"\DosDevice\G:" 00 2a 2b 4f 22 ac 12 c3 02 <- The drive you just copied everything to
"\DosDevice\I:" 22 da 2a 21 50 f8 12 43 a2
Right click on \DosDevice\C: and rename it to be another letter, whatever you want Windows to call the drive when you hook it up again (*do not* use a letter already there, in this case I
Hope this helps!
And remember, I can take no reponsibility if you nuke your own data or image the wrong direction, yadda yadda yadda so just be careful. This isn't meant to be a walkthrough, only how to go about it if you happen to be doing the same thing I did. Keep that in mind.