Jump to content

BCDBOOT problem after image applying


gustavo21

Recommended Posts

Hi everyone. I am having some problems after apply the wim image with imagex. I do this

diskpart.txt:

sel disk 0

clean

create part pri

sel part 1

assign letter c

active

next i format and tranfer the wim. Thats works OK.

But when i transfer bcdboot with "bcdboot c:\windows" some times in some computers when boot i have bootmgr error. It happens in less than 10% of the computers.

If i apply bcd with "bcdboot c:\windows /s c:" works 100% of times but in 90% i have dual boot and i have to manual delete one entrie.

I was thinking there is a way to avoid this, maybe deleting all bcd in disk and next generate it again?

I hope you understand me.

Thanks!!

Link to comment
Share on other sites


If the source image was captured from a single partition, you do not need to run BCDBoot. It is only needed if your source image was captured from a system that used the System Reserved partition.

Also, when you have Diskpart clean a disk, the BCD is removed.

Link to comment
Share on other sites

But when i transfer bcdboot with "bcdboot c:\windows" some times in some computers when boot i have bootmgr error. It happens in less than 10% of the computers.

Which computers do you use? Describe the hardware.

Which computers list bootmgr error? Which bootmgr error do you get?

Which image do you apply? Does this image contain a file \boot\bcd already?

Do you use one hard disk or more hard disks?

Are there any card readers?

How do you run imagex? Do you boot a PE?

How do you boot the computer Do you boot from CD/DVD, USB flash, USB hard disk, network,...?

Link to comment
Share on other sites

I run a PE from windows 7 AIK. I capture the syspreped image from a single drive and a single partition in a standard pc (sempron 145, asrock n68) that i use to deploy only.

The same image some times boot and some times doesn't. When doesn't, i have to load PE and enter bcdboot c:\windows /s C:. But if i apply that command everytime, in most cases i have a dual boot.

Link to comment
Share on other sites

The same image some times boot and some times doesn't. When doesn't, i have to load PE and enter bcdboot c:\windows /s C:. But if i apply that command everytime, in most cases i have a dual boot.

Do you run bcdedit to adjust partition layout settings after image apply?

Which error message do you get, if it dosn't boot?

Run a bcdedit, post the output from the failed computer.

Rename the file c:\boot\bcd first, 'run bcdboot c:\windows /s C:' next

Link to comment
Share on other sites

I run a PE from windows 7 AIK. I capture the syspreped image from a single drive and a single partition in a standard pc (sempron 145, asrock n68) that i use to deploy only.

The same image some times boot and some times doesn't. When doesn't, i have to load PE and enter bcdboot c:\windows /s C:. But if i apply that command everytime, in most cases i have a dual boot.

This perfect sounds like the usually mistake to also capture the boot files.

Mount your wim file rw and remove the \Boot folder and the \bootmgr file in the root. They aren't supposed to be there.

And always use bcdboot after apply an image.

Link to comment
Share on other sites

JFX is right.

While capturing an image with imagex, you must have captured the existing boot folder and bcd store data. As a default, imagex can skip certain files, but you can use the "/Config <drive:\folder\myconfig.ini" option to direct imagex to use your custom config file which should specify which folders and files to skip during capture operation.

Since you have a single drive - single partition, your boot files (BCD store) are on the same partition, instead of the system reserved partition. Because default imagex configuration does not exclude \boot folder and files (as well as bootmgr), imagex capture operation will include the folder and the files in the wim image. When applied, you will have the boot folder, files and bootmgr written to the new disk, which will cause you the problems you indicated.

See http://technet.microsoft.com/en-us/library/cc766147%28v=ws.10%29.aspx for info on config.ini, and how you can customize it and use it during imagex capture operation.

You have several choices:

1. Fixing the problem disk where image is applied: Before booting the system after applying an image containing old BCD store (boot files), boot into windows PE (using the win 7 install media), go to the drive where the image is applied, locate and take ownership of the existing boot folder and files and bootmgr, change permissions and then remove them. Use "bcdboot C:\windows /s C:" command to create a proper BCD store, and reboot the system from the drive. Ensure that the partition is set to active!!!

2. Fixing the wim image itself (for re-use): Mount the existing wim image, remove the existing boot folder and files and bootmgr and save the image. You may need to take ownership and change permissions to be able to remove the boot files. Now, your image will be ready for use without any other modifications for the next use. You can test the image by re-applying the image to the new system (new disk).

3. Fixing imagex capture operation issues: This option is, of course, a general case for when capturing images, and hwtahow to capture images! In principle, you might go through this process for your current situation as a test case, to confirm that your capture ops and apply ops are being performed correctly and as expected. What you need to do (if you have the time) is to create a custom imagex config.ini file, specify boot folder and files, and bootmgr as exclusions in the configuration, and then use this config.ini file during a wim image capture from an existing system (Note: the system is sysprepped with OOBE, Generalize options, and ready for capture, correct?).

Finally, you test functionality of the new system (after the wim image is applied and new BCD store - boot files are created by issuing the BCDBOOT command) and check that the system boots correctly. Control your bcd store contents with bcdedit!. Keep a copy of the custom config.ini file with your WAIK-3 tools for re-use for other capture ops!

Dai

Addendum--

On a subject related to capturing and applying images, I wanted to remind you about an issue with the sysprep - OOBE - Generalize operation to prepare a system for WIM image capture. There's a registry key "skiprearm" which may cause sysprep operation to fail, because you have exceeded rearm counts! When you try to sysprep a system that was already sysprepped previously, eventually you will run out of the rearm counts which is triggered during a sysprep - OOBE - Generalize operation (i.e. rearm count is decremented during the sysprep oper). There are ways around this issue which you may want to check by googling for "enable/disable skiprearm".

There is also a method to reset the "rearm" count by removing a hive from the registry, and later re-installing a license, which might be of interest. Ensrure that you have good backups of your existing system before sysprepping and playing with the skiprearm registry key, and resetting rearm counts!!!

Tip: Usually when I prepare a computer (or virt. machine) for imaging with Win7, Win 2008, I enable skiprearm, and put the system into Sysprep-Audit mode (CTRL+Shift+F3 at the initial boot of the OS after the installation of OS). I perform driver and software installs, configs, and customizations. When the system is configured as I want it, I boot the machine into WinPE, access the offline registry of the installed OS, and remove registry item related to rearm counts (WPA key under HKLM\System) [source info: http://www.zimbio.com/Windows+Vista/articles/ahWKUTCstH9/Unlimited+Rearm+Windows+7+Forever+Usage+without].

Reboot the machine into sysprep-Audit, install the product license, and keep skiprearm registry enabled (to prevent decrement of rearm count). When you check activation, you will see the license info, grace period and remaining rearm counts. I will disable skiprearm before I perform a Sysprep-OOBE-generalize before attempting an image capture.

The enable/disable skiprearm, and deleting of WPA key enables me to overcome/resolve issues arising from activation grace period, and sysprepping a machine multiple times.

It is good that with win 8 and win 2012, sysprepping is not limited to 3 times as it is with Win Vista/7/2008.

Edited by daremo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...