Upgrading a main system hard drive, cloan XP

Sep 24, 2010 14:56

Hello, and welcome to another geek post.
As there are friends of mine who seem to be having runs of dying hard drives, and probably others who have or will have it happen, I thought I'd mention my method of making a cloan of a running XP system which will simply work as it should.
The first thing that has to happen is a perfect copy of all the files.
You require
documents and settings,
program files,
windows.,
and the ntldr, .sys, bat, and .ini files in the root.
Any other data you have is perhaps important, but likely not vital to running the system.

Make sure the target disk is partitioned and formatted correctly, (probably NTFS).
In this case, The partition table must be type 7
Diskpart will get this right
The partition must also be set active.
Copying:
The first thing to be aware of is that it's as good as impossible to copy all the files from a currently running system, so you need eather a linux boot CD such as GRML or vinux or whatever, or else a separate windows PC with some way to USB connect the drives you wish to copy.
The windows PC is a better option for this, as there are registry tweaks required as well, which I know of no way to do in Linux.
You should make sure that your explorer view has all things showing, no hideing of system files, or extensions or any other restrictions.
XP pro is best here, as it's hard to edit permitions under that joke they call home, and you'll probably run up against at least one thing that will refuse to copy (access denied).
If you use linux to copy, you can mount the drives with ntfs-3g and use rsync to do it.
Rsync and ntfs-3g ignore ACLS, so you'll have complete access to any files on an NTFS drive.
If you are using XP home or you just like command lines, you can try using something like the following to unlock the problem files.
cacls "windows" /t /c /e /g administrators:f
Even this can sometimes fail if you are not the owner of the files in question.
Of course "windows" can be changed to the directory name you need to copy.
You are logged in as an admin right?
To fix most other access denied issues with XP pro,
Go to folder options, insure simple file sharing is off,
Right click the directory containing the problem files, go to security tab
Go into advanced, owner tab and take ownership of folder and all sub-folders and files as group administrators.
Then go to permissions tab and insure you have full control, and that there are no deny permissions that may affect you.
If there are, delete them and inherit all from the parent and replace all inheritable permissions if any.
Also, be certain that the system you are copying is shutdown, not hibernated! Sound complex? Well, it can be, and sometimes you even have to do it a couple of times for it all to work.
You can/should skip copying the recycle bin, system volume information, hiberfile.sys and pagefile.sys

Once you have the copy of all these dirs and files, you need to do a little tweeking.
First:
go into the windows directory of the copy and delete everything in the prefetch directory.

Then on the system you are using to do the cloaning, run regedit, navigate to hk_users and file menu; load hive.
Load the file g:\windows\system32\config\system.
It will ask for a name, give it what ever you like "hellfire" or something!
G: is the drive letter of the cloan you just made in the example...
You should now see a registry key hellfire and you can navigate into it and clean out all the values in mounted devices.
Particularly the drive C: one.
Now navigate back to hellfire and go into file menu again and unload it.
This should save the changes.
If you have the partition correctly bootable and all the files coppied, the cloan should now boot up.
You'll probably want to defrag it and do a
defrag c: -b as well to optimize the boot files.
Note some programs with nasty copy protections may fail if they've seen the hardware change of main hard drive, but
re registerring or patching them should fix that.
The other thing that is good to do, which windows will usually manage its self eventually is to get the prefetch list fixed.
Run the following command from within your newly cloaned system:
rundll32.exe advapi32.dll,ProcessIdleTasks
It probably isn't recommended to drop working systems like this on to different hardware, but if it's not too different, it can work.
Certainly if the machines are of a similar brand or model, you can often get away with it, keeping in mind the possibillity that some of the single lisence systems might have activation issues.
Having said that, I've seen a working system move streight from an NEC laptop to an IBM t41 and work perfectly!
I think it was PRO OEM.

There is another issue that also might rear it's head.
That's system restore.
I have seen this do slightly odd things on a drive that wasn't the drive it was installed on.
It basicly saves restore points, but they die after the next one is made, so you might only be able to go back 1 if even that much.
The thing I did that fixed it was to delete the keys in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore
Save this whole tree out before you start, because I had killed it completely by deleting things in the Cfg sub-tree.
It fired up again once I put the machine guid key and value back.
I think this is used to name the restore directory in "system volume information".

Have fun...
Previous post Next post
Up