Creating a bootable Windows 11 USB flash drive in Linux
How to create a bootable Windows 11 USB flash drive in Linux.
Below is the procedure for creating a bootable USB flash drive with Windows 11.
The same process should also work with any HDD/SSD connected to your system.
1. Download Windows 11 image
https://www.microsoft.com/software-download/windows11
$ sha256sum Win11_English_x64v1.iso
4bc6c7e7c61af4b5d1b086c5d279947357cff45c2f82021bb58628c2503eb64e Win11_English_x64v1.iso
2. Plug your USB flash drive
Linux detected /dev/sde
as the USB stick, in your case it will most likely take a different name.
3. Format your USB flash drive
Work as root account and make sure to replace /dev/sde
with your USB flash drive!
Use lsblk
and dmesg | tail -50
commands to locate your USB flash drive.
# wipefs -a /dev/sde
# parted /dev/sde
(parted) mklabel gpt
(parted) mkpart BOOT fat32 0% 1GiB
(parted) mkpart INSTALL ntfs 1GiB 10GiB
(parted) quit
Check the drive layout now:
In my case I've used 100% instead of 10GiB when created the "INSTALL" ntfs partition - mkpart INSTALL ntfs 1GiB 100%
. But you can use anything that should be larger than 6 GiB to fit the data from Windows ISO image.
# parted /dev/sde unit B print
Model: SanDisk Extreme (scsi)
Disk /dev/sde: 62742792192B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1048576B 1073741823B 1072693248B BOOT msftdata
2 1073741824B 62742593535B 61668851712B INSTALL msftdata
4. Mount Windows ISO somewhere
I mounted it to /mnt/iso
directory:
mkdir /mnt/iso
mount /home/<your user>/Downloads/Win11_English_x64v1.iso /mnt/iso/
5. Format 1st partition of your USB flash drive as FAT32
mkfs.vfat -n BOOT /dev/sde1
mkdir /mnt/vfat
mount /dev/sde1 /mnt/vfat/
6. Copy everything from Windows ISO image except for the sources
directory there
rsync -r --progress --exclude sources --delete-before /mnt/iso/ /mnt/vfat/
7. Copy only boot.wim
file from the sources
directory, while keeping the same path layout
mkdir /mnt/vfat/sources
cp /mnt/iso/sources/boot.wim /mnt/vfat/sources/
8. Format 2nd partition of your USB flash drive as NTFS
mkfs.ntfs --quick -L INSTALL /dev/sde2
mkdir /mnt/ntfs
mount /dev/sde2 /mnt/ntfs
9. Copy everything from Windows ISO image there
rsync -r --progress --delete-before /mnt/iso/ /mnt/ntfs/
10. Unmount the USB flash drive and Windows ISO image
umount /mnt/ntfs
umount /mnt/vfat
umount /mnt/iso
sync
11. Power off your USB flash drive
udisksctl power-off -b /dev/sde
Done
Now you are ready to boot off of your USB flash drive to install Windows 11.
19 Comments
Thank you for this great tutorial, it is very nicely organized, and it is very much needed.
Very well done! Turns out this is the proper procedure for the latest Windows 10 ISO as well.
Thanks you!
Warn that it takes a few minutes to unmount
Yeah, the OS writes cached data to the disk upon unmount. If you have slow disk it will take few minutes.
this is why it is recommended to do a 'sync' before powering off the USB key
This is some l33t stuff by today's standards. Maybe it's just me, but the hacker community seems to have become more about just using third party tools rather than understanding the basic mechanisms required to get things done. Kudos to you for showing me how to use native tools to create a bootable USB. Now I know the chances of my media being backdoored are greatly reduced. Native tools and technical understanding for the win!
This worked great! Thanks!
Didn't work for me. I repeated the steps thrice in 12 hours, couldn't get the laptop to boot from the device. though I am sure the third time I was being very careful.
Not that I am trying to find a fault here. The problem definitely is in the BIOS of my laptop. However, any other linux distribution gets booted from usb, and not a windows usb prepared via this method.
I will have to find a solution to my problem.
thanks for the post. :)
What's your laptop? It might be that BIOS is too old and doesn't support / read UEFI properly which is the method this USB is formatted for (UEFI).
You can try booting that USB on a different modern computer/laptop.
Currently, there is no mkpart command under Linux Mint 21. slamlander@DBMS-1:/media/slamlander/USB 8GB Win$ mkpart INSTALL ntfs 1GiB 8GiB mkpart: command not found
Looks like you forgot to run the "parted" command first.
Thanks for a well writen tutorial. It worked for me! Someone mention that it can take some time to umount. I read somewhere that there is a bug(?) with umouting a big 2.0 USB stick on 3.0 USB port or something like that, can't rembeber what was the couse. But for me it took a VERY long time but eventually it gets it done
Currently following this tutorial, as others said, the unmount takes a lot of time.
To see how much data is been read/written, you can use iostat (installed with sudo apt install sysstat)
iostat -p /dev/sde
Or "watch iostat -h -p /dev/sde"
For me rsync on /mnt/ntfs/ failed. Also to my surprise kernel now thinks that the drive is read only and I'm unable to wipefs or format it by just anything from fdisk, parted, cfdisk, gdisk. I don't understand how that could even happen but it did it to two USB sticks (I thought first one might have simply went bad). So now I'm at step -1 trying to just make the thumb-drive work again.
Yeah, looks like a faulty stick / usb port / connection.
nothing happens when I try to boot from this USB, I select the drive and click enter and nothing happens (it loads for 0.5 seconds and it's right back to the way it looked before where I can select the bootable drive). Any pointers?
Kinda annoyed that 3rd party tool tutorials don't spell out the partition requirements very well. Honestly, this should be ranked first when you google how to build a bootable windows USB in ubuntu. Very well done!
Thank you for step by step instructions! I much prefer this to downloading some third party software to create the image, particularly since that software needs to run as root!
This is a breath of fresh air after having to breath through a gym locker clothes hamper. So much crap on the web with titles just like your's, but this article delivers. And saved me time and turmoil. Thank you so much.
ps: wish you were on the fediverse! :-)