Linux: woeusb – creating Windows USB boot flash drive

By | 03/04/2019

Well – sometimes have to do a bit weird things…

Need to create bootable USB flash drive with WIndows 10 using console on Linux.

There are various solutions but today I found the woeusb utility and it works pretty well plus it can format a drive to a necessary filesystem.

Intsall on Arch Linux from AUR:

[simterm]

$ yaourt -S woeusb

[/simterm]

Find your flash drive:

[simterm]

$ lsblk 
NAME             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                8:0    0   477G  0 disk 
├─sda1             8:1    0     1G  0 part /boot
├─sda2             8:2    0    16G  0 part [SWAP]
└─sda3             8:3    0   460G  0 part 
  ├─vg_arch-root 254:0    0    50G  0 lvm  /
  └─vg_arch-home 254:1    0   410G  0 lvm  /home
sdb                8:16   0 931.5G  0 disk 
└─sdb1             8:17   0 931.5G  0 part /backups
sdc                8:32   1  14.3G  0 disk 
└─sdc1             8:33   1  14.3G  0 part

[/simterm]

Here it is in this case – /dev/sdc.

Run WoeUSB:

[simterm]

$ sudo woeusb --device Downloads/Win10_1809Oct_English_x64.iso /dev/sdc
WoeUSB v@@WOEUSB_VERSION@@
==============================
Mounting source filesystem...
Error: File "/media/woeusb_source_1550995484_30256/sources/install.wim" in source image has exceed the FAT32 Filesystem 4GiB Single File Size Limitation and cannot be installed.  You must specify a different --target-filesystem.
Refer: https://github.com/slacka/WoeUSB/wiki/Limitations#fat32-filesystem-4gib-single-file-size-limitation for more info.
Unmounting and removing "/media/woeusb_source_1550995484_30256"...
You may now safely detach the target device

[/simterm]

Okay…

Check the filesystem type on the device:

[simterm]

$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 14.3 GiB, 15376000000 bytes, 30031250 sectors
...
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 30029823 30027776 14.3G  c W95 FAT32 (LBA)

[/simterm]

There is ready solution in the documentation here>>>.

Run woeusb again with the --target-filesystem option and set the NTFS:

[simterm]

$ sudo woeusb --target-filesystem NTFS --device Downloads/Win10_1809Oct_English_x64.iso /dev/sdc
WoeUSB v@@WOEUSB_VERSION@@
==============================
Mounting source filesystem...
Wiping all existing partition table and filesystem signatures in /dev/sdc...
...
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
...
Mounting target filesystem...
Copying files from source media...
...
Installing GRUB bootloader for legacy PC booting support...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing custom GRUB config for legacy PC booting...
Resetting workaround to prevent 64-bit systems with big primary memory from being unresponsive during copying files.
Unmounting and removing "/media/woeusb_source_1550995613_701"...
Unmounting and removing "/media/woeusb_target_1550995613_701"...
You may now safely detach the target device
Done :)
The target device should be bootable now

[/simterm]

Done.