Create A Bootable Windows 10 USB Using Linux¶
Prerequisite¶
Assumptions¶
- Instructions using Arch Linux operating system
- Instructions done via the command line interface (CLI) (terminal/console)
- Have a Arch Linux AUR helper previously installed
- Have a USB flash drive that can be cleared of data
- Tested using Windows 10 Build 1909
- Steps prefixed with a "$" (dollar sign) represents the CLI prompt. The text after the "$" is to be entered at the CLI.
- Steps prefixed with a "#" (number sign) represents the CLI prompt with elevated user permissions (e.g. root). The text after the "#" is to be entered at the CLI.
Preparation¶
Install the following Arch Linux packages. Similar packages maybe used on other Linux distributions.
$ pikaur -Sy ms-sys ntfs-3g rsync
Note
The "rsync" package is optional.
Instructions¶
- Download the latest Windows ISO from Microsoft.
- Plugin the USB flash drive.
- Locate the USB device name.
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:32 0 238.5G 0 disk ├─sda1 8:33 0 499M 0 part /boot └─sda2 8:34 0 238G 0 part /srv sdb 8:48 0 1.8T 0 disk /mnt/data sdc 8:64 0 7.47G 0 disk └─sdc1 8:65 0 7.47G 0 part sr0 11:0 1 1024M 0 rom
- Unmount USB flash drive.
# umount /dev/sdc1
-
Create USB flash drive partition.
# fdisk /dev/sdc
- Press D then press Enter to delete all partitions.
- Press N then press Enter to create a new partition.
- Press Enter to accept default (p for primary).
- Press Enter to accept default partition number, 1.
- Press Enter to accept default first sector.
-
Press Enter to accept default last sector.
Note
Say yes if prompted for "Do you want to remove the signature".
-
Press T then press Enter to change partition type.
- Press 7 then press Enter to set partition type to HPFS/NTFS/exFAT.
- Press P to verify.
Disk /dev/sdc: 7.47 GiB, 8011120640 bytes, 15646720 sectors Disk model: USB Flash Drive Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x16a59ab8 Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 15646719 15644672 7.5G 7 HPFS/NTFS/exFAT Filesystem/RAID signature on partition 1 will be wiped.
- Press W then press Enter to write table to disk and exit.
-
Format partition file system to NTFS.
# mkfs.ntfs -L win101909 /dev/sdc1
- Create mount points.
# mkdir /mnt/{iso,usb}
- Mount Windows ISO.
# mount ~/Downloads/Win10_1909_English_x64.iso /mnt/iso
- Mount USB partition.
# mount /dev/sdc1 /mnt/usb
-
Copy files from Windows ISO to USB flash drive.
Note
Use only one of the examples below.
# rsync -avrP /mnt/iso/* /mnt/usb/
# cp -avr /mnt/iso/* /mnt/usb/
-
Make USB flash drive bootable.
# ms-sys -7 /dev/sdc
- Run sync to ensure all operations have completed.
# sync
- Unmount USB flash drive.
# umount /mnt/usb
- Unmount Windows ISO.
# umount /mnt/iso
- Remove mount point directories.
# rm -R /mnt/{iso,usb}