xcopy

This is a discussion on xcopy within the Tech Board forums, part of the Community Boards category; Finally ran out of space on my small C: drive. Been wanting to transfer Windows from my 20GB to my ...

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590

    xcopy

    Finally ran out of space on my small C: drive. Been wanting to transfer Windows from my 20GB to my 300GB SATA but do not want to re-install everything.

    I have so many updates, games, save games, etc, etc. that I do not want to reinstall all this crap.

    I'm trying to use xcopy *.* /h /i /c /k /e /r /y <dest> to copy my entire C: drive to F:. However on boot the loader says \Window\System32\Config is either missing or corrupt and will not boot.

    So is there a way to copy a bootable Windows to another drive?
    And why doesn't Microsoft provide this functionality in their OS? I guess they feel when you fill up your boot drive you gotta reinstall. This is a stupid assinine assumption.

    EDIT:

    I think it's failing to copy the system registry. So I'm going to go into the Recovery Console in setup and copy the entire config into a temp folder inside of Windows. Then when my working Windows boots, I'll copy the files in temp over to F:\Windows\System32\Config and it should work since none of those files are opened. It should copy all the files in recovery console because Windows will not have opened them yet. /H /I /C /K /E /R /Y was supposed to account for files being locked but perhaps MS made this little caveat so people won't copy Windows XP.
    Last edited by VirtualAce; 12-29-2007 at 02:21 PM.

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    You could try DD for Windows, but I don't know if that's quite what you would need in your case. But I've used it to write bootable harddisk images to physical drives before, and it's worked fine for me.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Well it worked but there were some issues.

    None of the registry information was copied over from Documents and Settings. So I had to boot into my F: drive copy, copy Documents and Settings from C: to F: into a temp folder. Then I had to boot into C: copy and delete F:\Documents and Settings. After that I renamed F:\temp to Documents and Settings.

    Now both copies are bootable. There is a problem with System Restore in both copies however. In C: OS it doesn't work and in F: OS it throws an exception. I'll fix this later.

    I forgot that with XP most of your registry is in ntuser.dat which resides in Documents and Settings. All of this stems from the fact that you cannot copy locked files. However I'm working on an application that will attempt to lock the file, mutex it, copy it, and then unlock it.

    It is possible to enumerate all processes and find out how many handles they have and how many are locked. So far I've not found a way to enumerate which files those handles belong to. I would think this is a system-wide property of the file system and not related to the processes themselves. So there may be a way to retrieve the filename via a file handle from the file system.
    Last edited by VirtualAce; 12-29-2007 at 08:40 PM.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Your best bet would be to use a live linux distro to do this. Knoppix will load from the cd, mount your old drive, mount the new one (or send it to an image file on a removable drive) and use dd from there.

    As knoppix wont need to use the drives to run you should avoid any problem with locks

  5. #5
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Physically copy all the files from your old drive to the new one, including all system and hidden files. Then run a Windows install on the new drive and select repair previous installation, it will recover all the installed applications.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21