Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Help with bcdboot

- - - - -

  • Please log in to reply
19 replies to this topic

#1
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag
Hi all,

I'm booting WinPE via a USB HDD with 2 partitions and applying my image to the internal HDD. This works well but my images are of only the System partition and don't contain any of the boot files contained in the boot folder, so I need to use the bcdboot command to copy the boot files onto the internal HDD.

My question is therefore what is the correct bootbcd command given the following.

C Drive in the boot partition on the USB
D Drive is the second partition on the USB containing all my images
E Drive is the internal HDD that I just applied the image to.

Is it BCDBOOT e:\windows /s c:

Or something else. Plus do I need to CD to a particular drive before I execute the command?

TIA

Greg

Edited by ghines, 24 October 2012 - 11:58 PM.



How to remove advertisement from MSFN

#2
johnhc

johnhc

    MSFN Junkie

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,362 posts
  • OS:Windows 7 x64
  • Country: Country Flag
ghines, I suspect your c: and e: are reversed. See this MS TechNet article. Please let us know what you learn. Enjoy, John.

EDIT: BCDboot not bootBCD. In a command prompt enter 'BDCboot /?' (no quotes) and get instructions.

Edited by johnhc, 21 October 2012 - 08:04 AM.


#3
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag

ghines, I suspect your c: and e: are reversed. See this MS TechNet article. Please let us know what you learn. Enjoy, John.

EDIT: BCDboot not bootBCD. In a command prompt enter 'BDCboot /?' (no quotes) and get instructions.


No C: and E: are not reversed. I boot from my USB HDD and the new HDD that is to have the image applied to is unformatted and unpartitioned. I then clean, partition, format, set active and assign the new HDD, which gives the new HDD the next drive letter E:. I then apply my image to E:

Have read the link but I'm still confused as to the correct BCDBOOT command and whether I should CD to a particular drive before I issue the command.

Any help would be appreciated.

Greg

#4
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,750 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

You only need to use BCDBoot.exe if your HDD has more than one partition. If it is a single OS partition, you don't need it.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#5
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,205 posts
  • OS:none specified
  • Country: Country Flag

You only need to use BCDBoot.exe if your HDD has more than one partition. If it is a single OS partition, you don't need it.

And the files that are missing in the "source" will appear, materializing from thin air? :w00t: :unsure:

This works well but my images are of only the System partition and don't contain any of the boot files contained in the boot folder, so I need to use the bootbcd command to copy the boot files onto the internal HDD.


BCDboot first copies needed files (from the booted environment, the WinPE in this case) and then sets the BCD "properly".

Just for the record, MS names partitions the "wrong" way:
http://www.multiboot....uk/system.html

You say Tomato


Microsoft calls the partition with the boot files the System partition, and the partition with the operating system the Boot partition. Everyone else refers to them exactly the other way round. The boot files on the boot partition. The operating system on the system partition.



When someone talks of "Boot" and "System" volumes he/she should always specify if the used convention is the "right" one or the "reversed" MS way.

jaclaz

Edited by jaclaz, 22 October 2012 - 10:00 AM.


#6
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,750 posts
  • OS:Server 2012
  • Country: Country Flag

Donator


You only need to use BCDBoot.exe if your HDD has more than one partition. If it is a single OS partition, you don't need it.

And the files that are missing in the "source" will appear, materializing from thin air? :w00t: :unsure:


Well lets put it this way. I can do an install with a System Reserved partition (where the boot files are located), then capture just the OS partition, redploy it as single partition and it will boot. Have there been any documented cases of where NOT using BCDBoot.exe on a single partition disk causes Windows not to boot? From my experiences, BCDBoot.exe is only needed when you have multiple partitions with bootable OSes.

@OP, you don't mention what made this image. Is it Imagex, DISM or something else? You also don't mention what OS the image is of, and if you are deploying to MBR or GPT disks.

There are some conflicting documentation as to how to run BCDBoot.exe. Some may say run it from the WinPE ramdisk (x:\windows\system32\bcdboot.exe) but I have seen other documentation saying to run it from the deployed OS path (e:\windows\system32\bcdboot.exe) which I've never gotten to work. You could alternatively copy it from the deployed OS to the ramdisk... or just keep it in your WinPE image.

I've also run into problems with the C: being take up already when booting into PE for imaging (except Windows 8) which I solve by using a diskpart script. It basically takes whatever is assigned to C: and changes it to something else that isn't taken. This way there is no problem with your deployed OS being installed to a partition assigned with C:\.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#7
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag
Thanks everyone for all your input, but no one has answered my original questions. I will recap and add a bit more information that might be helpful. I'll use the MS convention for naming the partitions.

I place a new HDD, unpartitioned and unformatted, into a laptop. I boot the laptop via a USB HDD that has 2 partitions. They System Partition of the USB HDD gets assigned C while the other partition containing the images is assigned D.

I now use DISKPART to prepare the new HDD, clean | create par pri | format fs=ntfs quick | active | assign. Now the new HDD has the drive letter of E.

I apply my Windows 7 image to the new HDD using imagex. However this image is only of the Boot Partition and therefore does not contain a boot folder in the root directory.

To make this new HDD bootable I need to use the BCDBOOT command, but what is the correct command and do I need to run the command from a particular location?

TIA

Greg

#8
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,205 posts
  • OS:none specified
  • Country: Country Flag

Thanks everyone for all your input, but no one has answered my original questions.

Oh, yes, johnc did allright.
http://technet.micro...7(v=WS.10).aspx
Simplified:
BCDboot <source path> [options] <target drive>
What System (the PE, aka "source") do you have running?
Do you have a C:\windows or a D:\Windows when you boot from the USB hdd (before you partition format the PC internal HD)?
Just open a command prompt and in it type:
SET Windir

If you have C:\Windows you run:
BCDboot C:\Windows /s E:

jaclaz

Edited by jaclaz, 25 October 2012 - 02:37 AM.


#9
johnhc

johnhc

    MSFN Junkie

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,362 posts
  • OS:Windows 7 x64
  • Country: Country Flag
ghines, here is an interesting article about doing a similar process as you. The article uses the BCDboot on the target system partition (D: in this case) to do the file copy and only specifies the first parameter for the command. I suspect this means that the files come from the X: partition (WinPE, ie from the firmware) which must be of the same architecture (32/64 bit) as the target system. Please let us know if this helps. Anyone please correct me if I am wrong! Enjoy, John

#10
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,750 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

Well, while my assertion that I've never used BCDBoot on a single partition deployment is true... and that it may not be 100% accurate for everyone... THIS is: BCDBoot x64 binary can write to both a deployed x86 or x64 OS. I had problems with 32bit BCDBoot from Win7RTM time doing both, and switched to 64bit exclusively. Also, BCDBoot from WinPE4 works with Windows 7 as well as Windows 8.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#11
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag

ghines, here is an interesting article about doing a similar process as you. The article uses the BCDboot on the target system partition (D: in this case) to do the file copy and only specifies the first parameter for the command. I suspect this means that the files come from the X: partition (WinPE, ie from the firmware) which must be of the same architecture (32/64 bit) as the target system. Please let us know if this helps. Anyone please correct me if I am wrong! Enjoy, John

Yes, interesting article. Thanks

What I don't understand is how BCBboot "knows" to copy the boot files to drive C? Also why was Drive D made active and not Drive C? My understanding is the boot folder and its associated files should be placed in the 100MB partition, Drive C in this case, and that should be the active partition. Reading this article suggests to me the 100MB partition is empty and is doing nothing at all except taking up space. Please correct me if I'm wrong.

Greg

#12
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,750 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

When using a System Reserved partition, that is the one that is made active. Technically, the System Reserved partition is only needed if you have more than one bootable partition. There are boot files in that partition. This is how computers with Recovery Partitions will boot to repair mode if Windows can't boot, because the boot files are kept elsewhere. During a deployment, the System Reserved partition is empty. When the OS boots for the first time from a sysprepped state, it should copy the bootloader into there.

After the OS boots and you are at the desktop, you can go look in the System Reserved partition. Any folders/files in there will be marked as Hidden System, so you'll have to dir accordingly. Also, if you assign a drive letter to it, you should unassign the letter afterwards unless you are using this just for testing.

Again, you do not need a System Reserved partition unless you have multiple bootable partitions and want to use BCD to handle them.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#13
johnhc

johnhc

    MSFN Junkie

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,362 posts
  • OS:Windows 7 x64
  • Country: Country Flag

BCDBoot x64 binary can write to both a deployed x86 or x64 OS.

Tripredacus, I have been wondering where the files/data comes from for BCDboot to write. Is it all contained in the BCDboot.exe file or on a disk (either from firmware or pointed to)? Somewhere, sometime ago, I found a statement that the WinPE and the target system of the BCDboot needed to be the same architecture. Do not have a reference handy.
ghines, you are welcome. I don't think you have answered the question from Tripredacus if you are dealing with an MBR of GPT disk. It may make a difference. I found this MS UEFI document earlier when searching for a different problem and DLed the document. I have not read the document but kept it for reference (I run a GPT disk).
Enjoy, John.

#14
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,750 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

I think maybe at stock. But I'm using WinPE 3.1 x64 with BCDBoot from WIn7pro sp1 x64, and WinPE4 with stock BCDBoot.exe. I never looked into how it does what it does. It might be true that Windows 7 BCDBoot does not work with Vista, I always try to keep new OSes separate if I can.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#15
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag

ghines, you are welcome. I don't think you have answered the question from Tripredacus if you are dealing with an MBR of GPT disk. It may make a difference.

Sorry, it's MBR.

Johnhc, Thanks for the link to the MS UEFI Document. The important couple of lines for me are:-

4. Copy the boot files to the system partition.
W:\Windows\System32\bcdboot W:\Windows /s S: /f all


Note the Source is where the Windows Image was applied and the destination is the System Partition.

Hence in my situation with Windows (WinPE) on C, Images on D and the Image applied to E (the system and boot partition) the command should be :-

E:\windows\system32\bcdboot e:\Windows /s e:

#16
johnhc

johnhc

    MSFN Junkie

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,362 posts
  • OS:Windows 7 x64
  • Country: Country Flag

E:\windows\system32\bcdboot e:\Windows /s e:

ghines, have you tried this? Does it work? Here is a MS TechNet link for the BCDboot switches. I did not know the definition of the /f switch. I think the TechNet definitions are clearer, but I am really confused now as I think they disagree with what is displaye for BCDboot /? Enjoy, John.

#17
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag

E:\windows\system32\bcdboot e:\Windows /s e:

ghines, have you tried this? Does it work?

Yes, I think the command would have worked except that WinPE was x86 and the image that was applied to Drive E was x64. Gave an error along the lines that BCDboot was the wrong version for the OS installed.

So I used:-

BCDboot e:\windows /s e:

and all was good.

Thanks for all your help johnhc, and others, it was appreciated.

Greg

#18
johnhc

johnhc

    MSFN Junkie

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,362 posts
  • OS:Windows 7 x64
  • Country: Country Flag
ghines, you are welcome - glad it worked. I assume you have booted the Windows on the E: drive? Are you using the 3.0/3.1 version of WinPE? Enjoy, John.

#19
ghines

ghines

    Newbie

  • Member
  • 23 posts
  • OS:none specified
  • Country: Country Flag

I assume you have booted the Windows on the E: drive?

Yes correct.

Are you using the 3.0/3.1 version of WinPE?

6.1.7600 which I believe is 3.0

Thanks again.

#20
ChrisQuestionMark

ChrisQuestionMark
  • Member
  • 5 posts
I've had good luck with using Visual BCD Editor.
http://www.boyans.net/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN