«

»

Aug 12

Print this Post

Adding additional boot options to your deployment USB key

Having a USB key that will install multiple versions of Windows is great, but what if you want to add other Windows PE images to it, above and beyond the installers?  For example, what if you wanted to add a recovery environment, like the Microsoft Diagnostics and Recovery Toolset (DaRT), or a BartPE environment, or any other Windows PE-based environments?  Well, it’s not that hard to do, and I’ll document how to do it with the Microsoft DaRT x86 and x64 recovery ISOs that it creates in this example.

Adding the DaRT files

First, you will need to copy the files from the MS DaRT WinPE ISO image to your “Content” folder that was created when you used MDT 2010 as per my previous post.  The content folder should look something like this:

000

And the contents of the MS DaRT ISO image, once extracted to the hard disk, will look something like this:

001

You will need to go through this folder structure (boot, EFI, and sources) and copy to your “Content” folder anything from the MS DaRT contents that does not already exist as a file or folder in your “Content” folder.  For example, the MS DaRT media is on the left, and the “Content” media is on the right:
002 

And the “Content” folder looks like this afterwards:
003

The same with the EFI and sources folders from the MS DaRT media:004

And the “Content” folder looks like this afterwards:
005 

Since most WinPE distributions use a “boot.wim” file in the “sources” folder, and we’re going to have multiples, you’ll want to rename any boot.wim files you copy here to something else, preferably something descriptive.  For example, I’ve renamed the boot.wim file from the x64 MS DaRT media I just copied over to “msdart64.wim” – this will be important later, when we create our boot entries:

006 
007

 

I’ve repeated the above process for the x86 MS DaRT media as well, and renamed the boot.wim from that media to “msdart86.wim”:

008 

Once you’re done with all of this, the last bit needed is to use bcdedit to add the new .wim files to your boot menu, and copy the updated “Content” folder to your USB key.

Using bcdedit to modify the boot menu

You’ll need to open a command prompt into the \boot folder of your “Content” media folder, and execute some bcdedit commands to modify the boot menu.  To make sure you’re in the right folder, the dir listing output should look something like this:

009 

What you will need to do is use bcdedit to edit the “bcd” file you see here – that file actually contains the boot configuration data used during boot, and we’re going to modify it to add the new .wim files we just copied over.

First, let’s look at the current boot configuration stored in this file.  Run the command “bcdedit /store bcd /enum” to show the current boot manager configuration stored in the bcd file.  You’ll note that we already have 2 entries here – one labeled “Litetouch Boot [MEDIA001] (x86)” and another labeled “Litetouch Boot [MEDIA001] (x64)” – also make a quick note of the default GUID in the {default} entry at the end of the device and osdevice lines, because you’re going to need this later:

010

To create a new entry, you just need to create a copy of the {default} boot entry, and give it a name.  Use the command “bcdedit /store bcd /copy {default} /d “<name>” to create a new entry called “<name>”.  I’ve created a new entry called “Diagnostics and Recovery x64” by using the command “bcdedit /store bcd /copy {default} /d “Diagnostics and Recovery x64” – please note very carefully the GUID that the entry was copied to – you will need this to further modify the entry in the next steps:

011

The next thing you need to do is add the DEVICE that this boot entry is going to use – this is the .wim file that the entry is going to point to, and you do this via the “bcdedit /store bcd /set <GUID for the new entry> DEVICE ramdisk=[boot]\<path to .wim file>,<GUID of default entry>”.  I’ve edited the new entry to point to the msdart64.wim file via the command “bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]\sources\msdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}” (remember I told you you’d need the GUID for the new entry, as well as the GUID from the default entry? – here is where you use them):”

012

You will next need to add the OSDEVICE that this boot entry is going to use.  This command is basically identical to the previous, except that “DEVICE” in the previous command is replaced with “OSDEVICE” – “bcdedit /store bcd /set <GUID for the new entry> OSDEVICE ramdisk=[boot]\<path to .wim file>,<GUID of default entry>”.  I’ve edited the new entry to point to the msdart64.wim file via the command “bcdedit /store bcd /set {c77ebc03-8748-11de-8cb4-00137228d4cf} DEVICE ramdisk=[boot]\sources\msdart64.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}”:

013

If everything was successful, you should be able to run “bcdedit /store bcd /enum” and see your new entry at the end of the list:

014

If you want to add another (for example, I’m adding the x86 version of MS DaRT as well), just do the same steps over again for the new .wim file:

015 
016

Once you’re done, you can replace what’s on your USB key with the new contents of the “Content” media folder.  If you want to create an ISO image (for burning to DVD, or testing in a VM), you can open the Deployment Tools command prompt from the Windows AIK start menu folder, and run oscdimg on the “Content” folder.  The command is “oscdimg –b”<path to etfsboot.com>” –h –u2 –m -l<Volume Name> “<path containing content to be copied to ISO>” “<path and name of resulting ISO image>” (note that –l in the command is a lower-case “L”, not an “I”).  I’ve created my image via the command “oscdimg –b”C:\Program Files\Windows AIK\Tools\PETools\amd64\boot\etfsboot.com” –h –u2 –m –lINSTALLER D:\Hybrid_Media\Content D:\Hybrid_Media\installer.iso”:

017 

Seeing it in action

If you boot your new USB key (or ISO image), you should now see the new boot entries:

018

 

That’s it – and you could theoretically do this with any Windows PE-based .wim file.  I used MS DaRT for this example, but you could use something like BartPE or any other Windows PE image.

Permanent link to this article: http://www.cluberti.com/blog/2009/08/12/adding-additional-boot-options-to-your-deployment-usb-key/

Bad Behavior has blocked 195 access attempts in the last 7 days.