Xcopy Windows to a new hard drive #
While imaging a 160GB drive with four partitions (Dell Diag, Recovery, OS, MediaDirect) to a new 500GB drive via an Acronis True Image boot CD, something went terribly wrong. Long story short, neither drive would boot (stuck in perpetual reboot loop) though files were visible on both drives. After wrangling with partition and recovery tools on the 500GB drive to no avail, the following process worked:
- Wiped all partitions on the 500GB drive and created a single NTFS partition
- Installed Vista normally on 500GB drive
- Booted from Microsoft Diagnostics and Recovery Toolset (DaRT) CD
- Erased all files from C: on 500GB drive
- Copied all files from 160GB drive's OS partition (F:) to 500GB drive (C:) via xcopy:
xcopy f:\*.* c:\ /b /c /e /h /k /o /r /x /y
- /b : Copies the symbolic link instead of the files. This parameter was introduced in Windows Vista.
- /c : Ignores errors.
- /e : Copies all subdirectories, even if they are empty
- /h : Copies files with hidden and system file attributes. By default, xcopy does not copy hidden or system files.
- /k : Copies files and retains the read-only attribute on destination files if present on the source files. By default, xcopy removes the read-only attribute.
- /o : Copies file ownership and discretionary access control list (DACL) information.
- /r : Copies read-only files.
- /x : Copies file audit settings and system access control list (SACL) information (implies /o).
- /y : Suppresses prompting to confirm that you want to overwrite an existing destination file.
- Booted from 500GB drive - still no joy: "Missing operating system"
- Booted from Vista install disc and selected "Repair your computer" (with the vague idea of trying fixboot and perhaps fixmbr)
- The following message appeared: "Windows found problems with your computer's startup options. Do you want to apply repairs and restart your computer?"
- Clicked "Repair and restart" and booted from 500GB drive
- Windows Vista started normally, with all data and apps intact!
UPDATE: Robocopy replacement (covers another interesting tool, strarc.exe)
/windows | Dec 19, 2009
Subscribe or visit the archives.