none
How to restore Windows boot after resizing system partition ?

    Question

  • I have an fairly new HP Pavilion 14-n228ca notebook which I intend to use mostly for Linux, but still wish to occasionally run the WIndows 8.1 that it shipped with.

    I installed CentOS 6.5 using the dual-boot procedure I have used many times in the past with XP and Vista, viz. resize the main NTFS filesystem, delete the partition and recreate it smaller at the exact same start byte.

    Normally (on XP,Vista) Windows boots from GRUB, but here I get an error "file \Boot\BCD - missing or contains errors"

    F9 at boot gets me a hardware boot menu, where I have a choice of "OS boot manager", EFI file, or "notebook hard drive". The last gets me GRUB. The first drops me to a repair menu where I can try autorepair, which fails, or a command line.

    The command line allows me to run diskpart and assign a drive letter to the system partition, at which point I can run chkfs successfully and access files.

    If I try "bootrec /rebuildbcd" it finds one valid volume at \\?\GLOBALROOT\Device\HardDiskVolume4\Windows but then says "system cannot find the file specified"

    How can I restore the ability to boot the Windows partition, preferably without messing up the Linux one ?

    Sunday, August 24, 2014 11:39 AM

Answers

  • - there was no c:\boot, and bootrec /RebuildBcd failed.

    However:

    From the command line I ran diskpart, then selected the system partition and did
    set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    per http://technet.microsoft.com/en-us/library/cc753840.aspx

    Then on rebooting I get to the repair menu again, but the system partition now has a drive letter C: and is mounted, and is not marked hidden.
    (I found C:\Windows\System32\Logfiles\Srt\disklayout.txt which seems to be a log from the original running system, showing the original partition settings)

    I then did
    bcdedit  /set {default} device partition=C:
    then per https://neosmart.net/wiki/recovering-windows-bootloader/
    bcdedit /set {default} osdevice partition=C:
    then for luck
    bootrec /rebuildbcd

    and now it works - booted into regular Windows with no problem

    (I can't find "easybcd" mentioned in various documentation)

    - I still get the error from GRUB, but I can get to Windows from the boot menu by pressing F9 during boot.

    • Marked as answer by a.daviel Thursday, September 11, 2014 7:15 AM
    Monday, August 25, 2014 11:43 AM

All replies

  • Hi

    Have you tried to repair windows?


    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Sunday, August 24, 2014 12:20 PM
  • I have an fairly new HP Pavilion 14-n228ca notebook which I intend to use mostly for Linux, but still wish to occasionally run the WIndows 8.1 that it shipped with.

    I installed CentOS 6.5 using the dual-boot procedure I have used many times in the past with XP and Vista, viz. resize the main NTFS filesystem, delete the partition and recreate it smaller at the exact same start byte.

    Normally (on XP,Vista) Windows boots from GRUB, but here I get an error "file \Boot\BCD - missing or contains errors"

    F9 at boot gets me a hardware boot menu, where I have a choice of "OS boot manager", EFI file, or "notebook hard drive". The last gets me GRUB. The first drops me to a repair menu where I can try autorepair, which fails, or a command line.

    The command line allows me to run diskpart and assign a drive letter to the system partition, at which point I can run chkfs successfully and access files.

    If I try "bootrec /rebuildbcd" it finds one valid volume at \\?\GLOBALROOT\Device\HardDiskVolume4\Windows but then says "system cannot find the file specified"

    How can I restore the ability to boot the Windows partition, preferably without messing up the Linux one ?

    assuming your recovery partition is still extant, you can run that and go back to factory

    backup files first natually

    use a virtual machine linux or cloud


    Corsair Carbide 300R with TX850V2
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 660 Ti FTW Signature 2 (GK104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Professional x64
    Microsoft Wireless Desktop 2000 & Wacom Bamboo CHT470M

    Place your rig specifics into your signature like I have, makes it 100x easier to understand!

    Hardcore Games Legendary is the Only Way to Play!

    Sunday, August 24, 2014 1:06 PM
  • If I try "bootrec /rebuildbcd" it finds one valid volume at \\?\GLOBALROOT\Device\HardDiskVolume4\Windows but then says "system cannot find the file specified"

    Possible causes I suppose are:

    1.BCD is totally corrupted, you can export and delete the BCD store and then run the cmd again, to do this, type the following commands at the Windows RE command prompt:

    • bcdedit /export C:\BCD_Backup
    • c:
    • cd boot
    • attrib bcd -s -h -r
    • ren c:\boot\bcd bcd.old
    • bootrec /RebuildBcd

    http://support.microsoft.com/kb/927392

    2.You may have errors on the hard drive, in this case, use chkdsk /r to do a further check.

    3.The main hard drive partition that contains your Windows installation may not be set as the Active partition. Use diskpart to select the primary partition of the drive you want to boot from and type "active" to mark it as active


    Yolanda Zhu
    TechNet Community Support

    Monday, August 25, 2014 7:21 AM
    Moderator
  • - there was no c:\boot, and bootrec /RebuildBcd failed.

    However:

    From the command line I ran diskpart, then selected the system partition and did
    set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    per http://technet.microsoft.com/en-us/library/cc753840.aspx

    Then on rebooting I get to the repair menu again, but the system partition now has a drive letter C: and is mounted, and is not marked hidden.
    (I found C:\Windows\System32\Logfiles\Srt\disklayout.txt which seems to be a log from the original running system, showing the original partition settings)

    I then did
    bcdedit  /set {default} device partition=C:
    then per https://neosmart.net/wiki/recovering-windows-bootloader/
    bcdedit /set {default} osdevice partition=C:
    then for luck
    bootrec /rebuildbcd

    and now it works - booted into regular Windows with no problem

    (I can't find "easybcd" mentioned in various documentation)

    - I still get the error from GRUB, but I can get to Windows from the boot menu by pressing F9 during boot.

    • Marked as answer by a.daviel Thursday, September 11, 2014 7:15 AM
    Monday, August 25, 2014 11:43 AM
  • Hi,

    Regarding to the "easybcd" you mentioned in your last post, as I know, it is related with a third party tool named "Easybcd", but applogize that we don't support that tool.

    For error shown up in GRUB, I suggest you contact supprt in the following forum 

    http://www.gnu.org/software/grub/grub-faq.html

    NOTE This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites.


    Yolanda Zhu
    TechNet Community Support

    Thursday, August 28, 2014 7:39 AM
    Moderator
  • I found EasyBCD at neosmart.net, but although it did run (though not in the rescue partition command prompt), and purportedly supports adding a Fedora boot image, it did not work for me.

    I later found rEFInd on sourceforge, which allowed me to successfully modify the EFI structure and give a simple OS choice at boot, without having to e.g. hit F9 quickly. The refind homepage at rodsbooks.com/refind  is also a good reference for EFI in general.

    Thursday, September 11, 2014 7:14 AM