Tuesday 1 November 2011

WINLOAD.EXE Error After deployment of WIM Image - OSIM

After the creation of my 'golden image' I deployed the WIM to a VM and two physical systems. These did not deploy correctly and I faced an error:

Missing or Corrupt winload.exe (0xc000000e)

I know that the script to prepare the C: drive and deploy the WIM had ran so I looked a bit closer at the specific script. The script to deploy the WIM is located in managedpc\camenu\ the particular file we are looking at depends on the image name. %IMAGE%.cmd. I shouldn't replicate the script (as I wouldn't want to break any confidentiality agreements) but the structure is what you would normally expect.

- Connect to a server share
- Format the C drive using format c: /FS:NTFS /X /Q /V:OS /Y
- Use imageX to apply WIM
- Post install tasks etc.

After a bit of digging around on the Internet forums I noticed some people were seeing a similar issue. It looks like the C: drive hasn't been marked set in the BCD Store. A method around this is to use the bcdedit tool which is built into WinPE.

More on the bcdedit.exe located hither:

http://technet.microsoft.com/en-us/library/cc709667(WS.10).aspx

http://msdn.microsoft.com/en-us/library/windows/hardware/ff542202(v=vs.85).aspx


In order to incorporate this into the script we just need to add the following lines of code to the end of %IMAGE%.cmd (before the :END and GOTO END)

x:\windows\system32\bcdedit /set {default} device partition=c:
x:\windows\system32\bcdedit /set {default} osdevice partition=c:
x:\windows\system32\bcdedit /set {bootmgr} device partition=c:

Where X: is the WinPE drive.

Reasons behind this are still a little clouded, I'm not wholly sure if this was something relating to my previous blog on the BDEDrive (Bitlocker System Drive) or due to the UEFI as described hither. http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface