次の方法で共有


Recovering a multiboot system after a drive failure

Okay, this is I am sure a topic that has been covered many, many times. However, it took me a few tries and a bit of searching to find the answer to the following challenge:

I had a PC with two hard drives. Each drive had an operating system (Windows 8 and Server 2008 R2). The primary hard drive that held the boot sector failed over the weekend and left my system unbootable…

All I needed to so was rebuild the boot sector on the 2nd drive…

The solution turned out to be pretty simple (after a bit of research). A while ago, I posted an article on how to build a bootable USB flash drive. This included all of the tools I needed to perform the recovery, including the bcdboot tool:

C:\windows\system32>bcdboot /?

Bcdboot - Bcd boot file creation and repair tool.

The bcdboot.exe command-line tool is used to copy critical boot files to the system partition and to create a new system BCD store.

bcdboot <source> [/l <locale>] [/s <volume-letter> [/f <firmware>]] [/v] [/m [{OS Loader ID}]] [/addlast]

  source     Specifies the location of the windows system root.

  /l         Specifies an optional locale parameter to use when
           initializing the BCD store. The default is US English.

  /s         Specifies an optional volume letter parameter to designate
             the target system partition where boot environment files are
             copied.  The default is the system partition identified by
             the firmware.

  /v         Enables verbose mode.

  /m         If an OS loader GUID is provided, this option merges the
             given loader object with the system template to produce a
             bootable entry. Otherwise, only global objects are merged.

  /d         Specifies that the existing default windows boot entry
             should be preserved.

  /f         Used with the /s command, specifies the firmware type of the
             target system partition. Options for <firmware> are 'UEFI',
             'BIOS', or 'ALL'.

  /addlast   Specifies that the windows boot manager firmware entry
             should be added last. The default behavior is to add it
             first.

Examples: bcdboot c:\windows /l en-us
          bcdboot c:\windows /s h:
          bcdboot c:\windows /s h: /f UEFI
          bcdboot c:\windows /m {d58d10c6-df53-11dc-878f-00064f4f4e08}
          bcdboot c:\windows /d /addlast

The steps were very simple:

1: Boot from the USB flash drive I created previously (or similar) – in my case I had to use F12 during the POST process to select to boot from USB.

2: Select Next from the language selection menu

3: Select “Repair Your Computer”

4: Select “Troubleshoot” (to display Troubleshooting Options)

5: Select “Advanced Options”

6: Select “Command Prompt” (now, others had reported success with the Automatic Repair Option, but it didn’t work for me)

7: type "bcdboot c:\windows /s c: ” (without the speech marks) and press ENTER

Note: This assumed that my boot drive was C: and the version of Windows was installed in the C:\Windows directory. You get the picture…

Okay, I told you this was straight forward, but it had me thinking for a few minutes… thanks to Scott Hanselman as it was his blog post that finally pointed me in the right direction after a few false starts.

Enjoy!