Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It always used to be possible to transfer a Windows installation (NT/2000/XP/2003) to a new boot medium by:

  • Recreating the partition table and MBR
  • Copying the partitions using ntfsclone
  • Tricky part: The disk geometry had to remain the same and the partition where ntldr resided had to start at the same LBA sector as before

Is this still possible with Windows (Vista/7/2008)? Would such a procedure work?

  • Copy partition table, with disk signature (!) and MBR
  • Possibly resize partitions to fit the harddrive
  • Ntfsclone "System Reserved Partition" and "Boot Parition".
  • Do one or both still have to start at the same sector on old and new hard disk?

Can you explain how bootmgr and bcd really work under the hood, as opposed to e.g. grub or ntldr? Is there a first and second stage? Does it keep block lists somewhere?

Update: My original problem turned out to be hardware related. Question rephrased to address the broader issue.

share|improve this question

migrated from serverfault.com May 2 at 14:36

This question came from our site for professional system and network administrators.

    
Actually I did. Found nothing as to why it doesn't work. –  edgar.holleis May 2 at 7:14

1 Answer 1

bootmgr is not aware of "drive letters", that's something Windows does late in the boot process (and is configured in the registry, absolutely nothing to do with the physical disk configuration).

Using Linux to clone a system is not supported by Microsoft. In short, the official answer is Don't Do That. You should use Windows PE. DISM can create and apply WIM image files, which is Microsoft's preferred format (the same one used by Windows Setup).

Cloning a machine generally follows:

  1. Setup reference machine. Run sysprep.
  2. Boot WinPE. Use dism to capture the drive. Something like this batch file:

    @ECHO OFF
    IF %1 == "" GOTO DIE:
    CHKDSK /X C:
    CHKDSK /X D:
    IF NOT ERRORLEVEL 0 GOTO DIE:
    DISM /Capture-Image /ImageFile:Z:\Path\To\Images\%1.wim /Name:Boot   /CaptureDir:C:\ /Compress:fast
    DISM /Append-Image  /ImageFile:Z:\Path\To\Images\%1.wim /Name:Windows /CaptureDir:D:\
    :DIE
    

    This may need to be modified if you have a non-standard partition layout.

  3. Boot the destination computer to WinPE. Use diskpart and dism to apply the image:

    Standard diskpart script to configure partitions:

    SEL DISK 0
    CLEAN
    CREATE PART PRI SIZE=350
    ACT
    FORMAT QUICK
    ASSIGN LETTER=M
    CREATE PART PRI
    FORMAT QUICK
    ASSIGN LETTER=O
    EXIT
    

    Standard dism batch file to write image:

    @ECHO OFF
    IF %1 == "" GOTO DIE:
    DISKPART /s Diskpart-Standard.script
    IF NOT ERRORLEVEL 0 GOTO DIE:
    DISM /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:M:\
    DISM /Apply-Image /ImageFile:%1 /Index:2 /ApplyDir:O:\
    IF NOT ERRORLEVEL 0 GOTO DIE:
    BCDEDIT -STORE M:\BOOT\BCD -set {bootmgr} device partition=M:
    BCDEDIT -STORE M:\BOOT\BCD -set {memdiag} device partition=M:
    BCDEDIT -STORE M:\BOOT\BCD -set {default} device partition=O:
    BCDEDIT -STORE M:\BOOT\BCD -set {default} osdevice partition=O:
    :DIE
    ECHO Script ended...
    

Your process might work, but you likely are missing those last four bcdedit lines from the script.

Note this does not configure WinRE, but you shouldn't need it if you have WinPE around anyway.

share|improve this answer
    
Thanks for your detailed response. Some day I might even invest the time to learn the native Microsoft tools. You didn't include any details on bootmgr's inner workings, though. –  edgar.holleis May 3 at 17:21
    
Sorry, this answer is rather off topic for Super User. On Server Fault we consider "don't do that" type answers to be The Right Answer sometimes. I'll leave this here for reference but you're right that it doesn't suit the question here. –  Chris S May 4 at 2:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.