Run Windows from an external USB drive

By setting up Windows on a bootable external USB drive you have a way to boot into a computer that made need maintenance or if you want to easily switch between different Operating system copies.

USB Drive vs. Flash

The directions below will work with a USB Drive but will only work with a USB Flash Drive if you can get the Removable bit turned off.

Windows doesn’t like USB Flash Thumb Drives to boot off of if the Removeable bit is set. The Removable bit on the USB causes windows to not allow partitions and hangs Windows on boot from the USB.

Supposedly bootit will flip a Lexar to remove the removable bit but I never got a USB Flash Thumb Drive to work.

Note: I’ve tried USB Flash on Windows 10 preview with some limited success.

Windows Versions

Not all versions of Windows can be used. I’ve gotten the Following to work.

Windows 8
Windows Server 2012
Windows 10
Windows Server 2016 Technical Preview 4

Formatting the Disk

We’ll use DiskPart to format the disk and set an active partition.

Run DiskPart as administrator. Its important on Windows 8 to make sure you run as administrator.

In Disk type

DISKPART> list disk

The disks along with your USB drive should be displayed. Be careful pick the right disk and remember the disk number.

Select the Disk with the select disk # command substituting your disk number for the #

DISKPART> Select Disk #

Run the following commands to erase the disk, create a primary partition, mark the primary partition as active, format it and then assign it a letter.

DISKPART> Clean
DISKPART> Create Partition Primary
DISKPART> Select Partition 1
DISKPART> Active
DISKPART> Format FS=ntfs  quick
DISKPART> Assign

Make note of the assigned drive letter. The examples in the next steps will use e: but you will need to substitute in the letter assigned to your drive.

Find the install.wim file

On the Windows DVD the install.wim is at sources\install.wim. If you have the .iso and windows 8 you can mount the .iso as a disk and use that. I found its faster if I mount the .iso and then copy the install.wim file to my local disk.

For our purposes lets say we have the install.wim at location f:\sources\install.wim

Pick the image index to install

The install.wim can contain multiple images. For Windows 8 there is only one but for Windows Server there are multiple choices. To see the list of available image you can run the following command from and administrator cmd prompt (Always use administrator on Windows 8).

dism /get-wiminfo /wimfile:f:\sources\install.wim

Install the image

You now have all the information you need. Just Dism the image you want to the disk.

The following command will  apply the image index 1 on disk f: to the disk on E:

dism /apply-image /imagefile:f:\sources\install.wim /index:1 /applydir:e:\

This can take awhile so be patient.

Mark the drive as bootable

Next you  need to set the boot on the new e:. In your administrator command prompt run bcdboot.

bcdboot e:\Windows /s e: /f ALL

 Boot from your USB

Computers have different ways to select to boot off USB, Bios, Esc, F12 that goes beyond the scope of this post. You’ll need to figure out the steps for your specific computer.

Couple of hot tips:

Sometimes my USB drives don’t start fast enough to show in the boot menu. If this happens press ctl-alt-delete to restart the machine for it to show up.

Depending on your BIOS when using Windows 8 and higher you may have to specify from Windows Advanced Settings to reboot and give you a chance to choose what disk to boot off of.

 

Leave a Reply

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