📌 19 de Dezembro, 2024

Windows: Installing on External Disks

Informática · Windows

The windows setup program refuses to install Windows to external USB drives but that’s not a problem as there’s a way around it. It’s absolutely possible to run Windows from any modern external drive eg. windows installed on an USB SSD disk.

I tested the following method with Windows 10 Enterprise x64 and it work perfectly from a generic USB-C SSD drive. Here’s what you’ll need:

  • A Windows machine running Windows 10, can be a real PC or a Virtual Machine – it is safer if you’re using a VM;
  • A blank external drive, I would say something fast, SSD or NVMe connected via USB 3.1 with at least 32 GB;
  • A Windows ISO – you can get it here.

Before you start:

⚠️ WHOLE DISK WILL BE ERASED, I cannot be responsible for data loss. ⚠️

Now open Command Prompt or Windows Terminal as Administrator and run the diskpart command. This program will allow you to manually partition the external hard drive for Windows.

First we need to identify the number of the USB hard drive:

diskpart

# List all your disks, and identify the external hard drive
list disk

# In my case the USB drive is disk 1, so we will select it
select disk 1

Once you’re confident about the external hard drive number, we can erase it and set it as GPT.

⚠️ This operation will delete all the data in the disk:

clean
convert gpt

If the disk is already GPT, you can safely skip any error message.

Now we proceed to create the partitions required by Windows:

# Create an EFI partition
create partition efi size=500
assign letter=B
format quick fs=FAT32

# Another partition for the Microsoft Reserved Space
create partition msr size=6128

# Now the main Windows partition
create partition primary
assign letter=K
format quick fs=NTFS
exit

On the last partition we didn’t set a size=, the program will automatically set that partition to fill the remaining space on the disk for us.

Now mount the Windows ISO (double click) and note the drive letter, shows up as E:\ in my case. Then use dism to find the index of the Windows version we want to install:

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

Windows 10 Enterprise is listed as index=3 and now we can install it:

dism /Apply-Image /ImageFile:E:\sources\install.wim /index:3 /ApplyDir:K:\

Complete the process by installing the boot files into the EFI partition:

K:\windows\system32\bcdboot K:\windows /f ALL /s B:

And that’s it.

Now you can plug that USB drive into any computer and boot from it. You’ll have a perfectly normal Windows installation with all your files ready to go.