1

I've built a developer image and am deploying it to workstations. It's a sysprepped image but I'm facing one issue at the end that I'm hoping someone can help me resolve which is where the machine is not bootable.

Because this is for a relatively small subset of people in the organisation (developers) I'm not using WDS or some other similar deployment mechanism, just a bootable USB key and Windows PE.

My commands are:

diskpart
sel disk 0
clean
cre par pri 500
format quick fs=ntfs
active
cre par pri
active
assign letter=c
exit
dism /apply-image /imagefile:{foo.wim} /index:1 /applydir:c:\

(where {foo.wim} is the name of my WIM file)

The WIM file gets applied, and upon reboot the machine isn't able to boot. Fortunately it's easily solved by booting from an install disk and choosing to Repair. After this all's fine.

Screenshot at initial post WIM apply stage

I'd like however, not to have to do this last step so if someone could point out the step I'm missing I'd appreciate it.

I've added @Elliot Labs suggestion but that still isn't doing it, unfortunately

bootsect /nt60 C: /mbr
noonand
  • 287
  • 1
  • 7
  • 25
  • `The WIM file gets applied, and upon reboot the machine isn't able to boot` - How about giving us some details. What happens exactly? – joeqwerty Jan 31 '17 at 13:56
  • All the commands I run are listed in the question. It's the DISM command that applies the WIM file. Upon reboot I get a message that boot configuration data isn't accessible. The Repair option on the install disk fixes this – noonand Feb 01 '17 at 08:05
  • How many HDDs/SSDs are used in the deployment process (I am going to build you a command to rebuild the BCD from scratch)? – Elliot Huffman Feb 03 '17 at 12:19
  • Check my new answer. It has information on how to rebuild your BCD. – Elliot Huffman Feb 03 '17 at 12:48
  • So how exactly are you running these commands? I'm trying to figure out why an install.wim and media from MDT won't be available, especially since MDT _makes_ a bootable image that you can run from a USB stick – Jim B Feb 03 '17 at 21:53

3 Answers3

2

You are far better off using MDT to build your deployment. It looks like none of your steps create boot partitions.

Jim B
  • 23,938
  • 4
  • 35
  • 58
  • Thanks for that, but I don't have the ability to do that in this instance. Do you have any idea which command I could use within the constraints of my existing process? – noonand Jan 31 '17 at 13:49
2

There other posible way, and it seems simply:

  1. Create USB boot key with Windows installer (copy disk image content to prepared flash drive)
  2. Remove from it sources\install.wim file
  3. Rename your WIM image to install.wim and place to sources\ folder on your USB key
  4. (Can be omitted) Prepare autounattend.xml file to your taste and place in root of your USB key (Windows SIM can help you)
  5. Boot from you USB key and installer will deploy your image!

Note! You WIM image must contains partition with Windows system installed. Windows system MUST be syspreped before WIM capturing (otherwise installed system will have guaranteed issues)

Slipeer
  • 3,255
  • 2
  • 18
  • 32
  • I did this in a circuitous fashion using ImgBurn, Rufus and Hyper-V. Alas it doesn't work and even refuses to boot. Sorry about that! – noonand Feb 10 '17 at 15:23
1

Complete rebuild of boot files

bcdboot X:\windows /s Y: /f ALL

The above command "installs" the BCD bootloader to the location of your choice. This should correct any BCD corruption by generating a new set of files.

Where X: is the drive to the active Windows folder (PE's windows directory) and Y: is the letter of the drive that is the target drive for the new BCD files. Usually the destination contains the deployed windows installation or is the system reserved partition, if you use such a beast.

/f ALL specifies that it should deploy both a UEFI and BIOS for maximum compatibility. Use /f BIOS or /f UEFI for a more minimal install.

/s Y: Specifies the destination drive for the bootloader deployment.

X:\Windows Specifies the windows directory that should be used as the source for the new boot files. This command does not generate new files by itself.

For more information use bcdboot /?


Boot sector:

You can deploy a boot sector to use a bootloader such as bootmgr (BCD) by using the following command:

You can do that by executing bootsect /nt60 X: /mbr

Where X is the mounted drive letter. Use /nt52 for Windows XP and the sorts. Use bootsect /? for more info


Extra info:

WIM files are file based (higher level) storage mediums and do not copy the sectors of a HDD/SSD. So you cannot copy the file system's boot code with the WIm format since boot code is more of a sector based thing (lower level).

If you did want to copy the boot code too then you might want to go with the VHD(x) format as that emulates an entire HDD and therefore the sectors which contain the bootcode can also be copied or deployed.


Tl;Dr:

Your BCD database is corrupt. Rebuild it.

For good measure, reconfigure your boot sector too.

Elliot Huffman
  • 1,169
  • 1
  • 10
  • 22
  • 1
    If you ever have the chance, MDT is an amazing tool. I understand if your infrastructure can't support it. MDT does have USB/CD/DVD modes if pxe/network is not an option. – Elliot Huffman Feb 01 '17 at 18:22
  • I'm familiar with MDT and WDS but it's just in this instance none of those options are available to me hence the hand-rolling ;-) – noonand Feb 01 '17 at 20:40
  • Did my answer correct your issue? Thanks! – Elliot Huffman Feb 01 '17 at 20:42
  • It's night time here (in Ireland) - I plan on trying tomorrow and will let you know then ;-) – noonand Feb 01 '17 at 20:44
  • Sorry, no joy. See edited question above – noonand Feb 03 '17 at 11:33
  • I don't think this will ever work since he's not creating anything to boot from, using a VHDx might work, but it also means you get to rebuild it with every patch. I've asked above exactly why an MDT stick is unavailable, because that will do a real install. – Jim B Feb 03 '17 at 21:58
  • What do you mean he is not creating anything to boot from? If the boot repair system works on his install then there is definitely something to boot from... – Elliot Huffman Feb 03 '17 at 23:17
  • @elliotlabs I suspect there is no boot volume available to repair. I'm still hung up on why this can't be done via mdt (or any actual deployment tool)- and as an FYI MDT doesn't use or require PXE, by default its purely bootable installation media creation. – Jim B Feb 08 '17 at 14:20
  • @JimB He said "Fortunately it's easily solved by booting from an install disk and choosing to Repair. After this all's fine." That means that the system has been deployed. All that is left is to fix the boot system. – Elliot Huffman Feb 08 '17 at 14:48
  • @noonand Did the `Complete rebuild of boot files` part of the answer fix your issue? Thanks! – Elliot Huffman Jul 14 '17 at 11:41