WinPE – Dual Boot External USB Drive

It’s always a good habit to back-up your computer; the saying goes that computers’ users could be divided into two groups: ones that do backup and the others that are sorry.
This post is the fourth one in the series of posts about Microsoft WinPE (i.e. Windows Preinstallation Environment is a minimal operating system with limited services, built on the Windows kernel). In my second post about WinPE 5.0 GUI, I had provided information and scripts about the requirements and steps to be taken in order to build an interface for WinPE using Microsoft PowerShell.

LaptopWitDrive

ImageX is a command-line tool that enables original equipment manufacturers (OEMs) and IT professionals to capture, to modify, and to apply file-based disk images for rapid deployment. I am sure that everyone could use ImageX to do a backup. ImageX allows you to take complete backup of a Windows® volume and save an image to a file. You can then restore any system with its original image in just a few minutes as long as you apply it on the same hardware.

 Note:The solution explained in this post provides scripted way to capture, and to apply file-based disk images using ImageX.exe tool. It does not provide scripted way to use Sysprep, a tool used (by IT professionals) to configure new installations of Windows for duplication, prior to capturing image by ImageX. You could use my WinPE – Dual Boot External USB Drive application on a computer without running Sysprep /generalize to backup your computer’s Windows® partition. Moving or copying a Windows image to a different computer with different hardware without running sysprep /generalize is not supported.

There is an ongoing SID debate: to Sysprep or not to Sysprep. Mr. Mark Russinovich, a software engineer and author who works for Microsoft as a technical fellow, has addressed this issue in his blog: http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx

My position is that you can capture a non sysprepped image of your home computer or a workgroup computer. You should capture a non sysprepped image of a reference computer just prior to running Sysprep tool, and you have to sysprep an image in Active Directory / Windows Server Update Services (WSUS)) domain environment.

To determine whether a computer system has previously been sysprepped, look under the following registry key: HKEY_LOCAL_MACHINE\System\Setup

If you find a value named CloneTag under this key, the system has been sysprepped (i.e. generalized) and the value of this key will tell you when this was done (https://support.microsoft.com/en-us/kb/180962).

How the WinPE – Dual Boot External USB Drive gets installed

  • You need to have Windows ADK 8.1 installed; download the Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Update here: http://www.microsoft.com/en-us/download/details.aspx?id=39982.
  • Download WinPE-DualBootExternalUSBDrive.zip package from the download section, under Application folder. After you download the file, please do the following:
  1. Unzip the file (for example C:\ WinPE-DualBootExternalUSBDrive).
  2. Connect your external USB Drive to your computer.
  3. Find the Create-DualBootExternalUSBDrive_x64.exe file (there are two files: one for 32 bit and one for 64 bit architecture, I am using in my example the 64 bit executable).
  4. Ran as administrator the Create-DualBootExternalUSBDrive_x64.exe tool in order to create Media files that are necessary to make the external USB drive bootable.

This is a two steps process, please see the picture below:

CreateDualBoot_01

Picture 01: in the first step you will create Bootable Media files

During the first step, please select the folder named WinPE-DualBootExternalUSBDrive by clicking ‘Browse Source’ button, and once this folder is selected, please click ‘Start’ button to start creation of the Media files (i.e. the files and applications essential for dual booting USB drive). Please do not close PowerShell Command line windows as shown below.

CreatingMedia_01

Picture 02: Media files being created, do not close command line window

Once all Media files are created, please proceed to the second step in order to make USB Drive bootable. First click on ‘View USB Drive(s)’ button to display all available USB drives; select one or more USB drives form the list, and (for ones that you want to make bootable) click ‘Run’ button. See the pictures below. Please note that this process will delete any data previously stored on the selected USB drives.

CreateDualBootUSB_01

Picture 03: selected external USB Drive is being formatted

CreateDualBootUSB_02

Picture 04: Media files are copied to the selected USB drive

Finally, at the end of the second step, you will have a bootable USB drive. If you explore the contents of the newly created USB drive you will see the list of folders as displayed in the picture below.

USBDriveFolders

Picture 05: List of folders and files on the newly created external USB drive

Please do not delete any of the listed folders; note the ‘Images’ folder (with two subfolders: 32-BIT and 64-BIT) which serves as a container for all 32 bit and 64 bit images and the ‘Owner Files’ folder, which purpose is to house all the data files that you want to have stored on the external USB drive.

How WinPE – Dual Boot External USB Drive works

To see how your external USB drive works, please connect it to your computer (IMPORTANT: you should not connect/plug into your computer any other USB drives except this one), power up the computer and press the key that will display the boot option menu. After you get to the boot menu, locate the bootable USB device and then choose USB drive to boot from.

Please remember that we have dual boot USB drive, and at the very beginning you will have to choose to boot into either “WinPE5.0_x86–32BIT” or “WinPE5.0_x64–64BIT”. In my example, I select 64 BIT option and with this option the ‘Images\64-BIT’ folder on external USB drive is predetermined to house all my captured images and/or to display the ones previously captured.

As soon as the computer finalizes booting into external USB drive, the application with three tabs appears: Computer Info, Create Image and Apply Image. On all tabs there is an image, named “Computer Hard Drive”, courtesy of “FrameAngel” at FreeDigitalPhotos.net.

The first tab, The Computer Info, displays info about computer’s hardware (make, model, serial, NIC, etc.) and the content of the external images folder. By clicking on ‘Delete’ button, you can delete the checked image files and their descriptions; the rest of the buttons you can use to refresh displayed info, to restart or shutdown a computer.

WinPEusb_ComputerInfo

Picture 06: displays info about computer’s hardware and captured images inside Images folder.

The second tab, Create Image, as shown in the picture below displays the process of capturing an image. You have to provide the name of the image file while the description is optional. I would strongly suggest that you always provide a description for an image in a form of an answer to the 5Ws.

WinPEusb_Capture

Picture 07: displays the process of capturing an image.

The third tab, Apply Image, lists all the previously created images that you can use with this WinPE. For example, you would first select an image file and click on ‘Apply’ button to start the process of applying image on the computer’s hard drive as shown in the picture 08.

WinPEusb_Apply

Picture 08: displays the process of applying selected image file.

Important: when you apply an image, the computer’s hard drive will be formatted; the scripted process creates two partitions, a hidden one that is 300 MB in size (i.e. system reserved partition used for bootmgr and bitlocker), and the remaining hard drive space is used to create a second partition. At the end the script makes Windows partition bootable.

WarningMessage

Picture 09: Warning message – only one drive detected.

To download the WinPE – Dual Boot External USB Drive application, please go to the site’s download section, and expand the Application folder.





Please note: Although the author has made every reasonable attempt to achieve complete accuracy of the content, he assumes no responsibility for errors or omissions. Also, you should use this information as you see fit, and at your own risk.

12 thoughts on “WinPE – Dual Boot External USB Drive

  1. Sam Hy

    Hi,

    I’m trying to create a WinPE dual boot external USB drive. I have Windows ADK 8.1 installed on a Win 8.1 system. When I click on Start in either the x86 or x64 .exe, I get the PowerShell window, but it just flash on for a second. I think there is an error. Any idea what I’m doing wrong?

    Reply
    1. admin Post author

      Make sure you have PowerShell version 3.0 installed and you right-click on either x86 or x64 exe and Run as Administrator.

      Reply
  2. Curtis

    Getting same error as Sam. Powershell opens briefly, then closes. Can’t tell what the error message says. Have ADK 8.1 installed, and PSVersion 4.0. Extracted files to C:\WinPE-DualBootExternalUSBDrive, choosing (run as administrator) either Create-DualBootExternalUSBDrive_X32 or Create-DualBootExternalUSBDrive_X64 produces the same result.

    Reply
  3. Robert

    This is awesome! Works excellent!
    However, I also need this to boot on a Surface Pro 2/3 and capture/apply Windows 8.1, which requires Fat32, which limits the size of the .wim files to 4 GB. So, you either have to split the .wim to .esd files, or have the folders for storing the files on a separate NTFS partition.

    I currently use a 500 GB drive split into 2 partitions- a 4GB Fat32 partition and the 2nd partition using NTFS and the remainder of the disk.
    I then use DISM to create the 1st partition as my WinPE boot.

    I can plug this in to any PC and capture/apply any image (Win 7/8 both x86 and x64), storing my .wim files on the 2nd partition, as well as my ‘createpart.txt’ file to format the target drive before applying the image.

    Any way to make this point to the 2nd partition/drive to store the .wim files?
    Also, I used your 64-bit version to create my external drive, will using the 32-bit version create a Fat32 disk instead of x64 and allow me to boot on the Surface? The Surface has UEFI only.

    Reply
      1. admin Post author

        The “64-BIT” and “32-BIT” refers to the 64/32 BIT versions of imagex.exe command-line tool used to create images. But the external USB drive is formatted with NTFS file system in order to allow creation and copying of large files (note that the external drive is used as data drive as well). If you want to format external USB drive using Fat32 file system, you have to edit/change the line # 136 of the Create-DualBootExternalUSBDrive.ps1 PowerShell script.
        Current line is: ADD-CONTENT -Path $env:TEMP\MakeBootable.txt -Value “FORMAT FS=NTFS QUICK”
        Change it like this: ADD-CONTENT -Path $env:TEMP\MakeBootable.txt -Value “FORMAT FS=FAT32 QUICK”

        Reply
        1. Robert

          OK, but how to make it a 2-partition drive, one partition as Fat32 for the PE and the 2nd as NTFS for .wim files larger than 4 GB and have the Images folder created on the 2nd NTFS partition (data)?
          Your app is the closest to what I’ve been looking for and is really appreciated. I’ve started using this for the Win7 machines I’m imaging, but would like to use it for the Surface Pro as well. I use SCCM at work but have found manually running DISM is much faster. SCCM can take awhile to image, DISM takes about 15 minutes.
          I know I’m asking a lot, and I know this is a free app, but I’m willing to donate to you if you can do this (I don’t see a “Donate” button).
          Actually, I’d like to donate now w/just the current work you’ve done.
          And, again, thank you VERY much for what you’ve done already!

          Reply

Leave a Reply

Your email address will not be published. Required fields are marked *