How can I create a bootable Windows 10 USB drive from Linux ?
Please note:
dd
method didn't work as well.Beside this, I've tried creating a GPT partition table and one partition of type ef00 and formatted as fat32, and then copied all ISO contents to it. It boots OK, but when I go to start installation it shows the prompt for media dialog.
Update
Another try:
The installation starts ok, but at start of progress shows error 0xc0000005 (if i remember correctly).
Notice, that Windows 10 October 2018 release has an installation file sources/install.wim
larger than the maximum FAT32
file size, so we will format USB drive to NTFS
. Windows installer also cannot work with an EFI partition (code ef00
), so we will use Microsoft basic data
partition type (code 0700
).
Steps for creating USB drive with name /dev/sdc
(Replace all commands with YOUR device name!):
mount -l | grep '/dev/sdc'
, then unmount with sudo umount /dev/sdcX
(X is partition number).gdisk /dev/sdc
, configure it as GPT
and create Microsoft basic data
partition (code 0700
), then write changes and quit (Next steps will destroy partition table in your USB drive!!!).sudo gdisk /dev/sdc
o
> This option deletes all partitions and creates a new protective MBR.
> Proceed? (Y/N): y
n
> Partition number ... > hit Enter
> First sector ... : > hit Enter
> Last sector ... : > hit Enter
> Current type is 'Linux filesystem'
> Hex code or GUID (L to show codes, Enter = 8300): 0700
p
> Should print something like:
> Disk /dev/sdc: 15646720 sectors, 7.5 GiB
> Model: DataTraveler 160
> Sector size (logical/physical): 512/512 bytes
> Disk identifier (GUID): ...
> Partition table holds up to 128 entries
> Main partition table begins at sector 2 and ends at sector 33
> First usable sector is 34, last usable sector is 15646686
> Partitions will be aligned on 2048-sector boundaries
> Total free space is 2014 sectors (1007.0 KiB)
> Number Start (sector) End (sector) Size Code Name
> 1 2048 15646686 7.5 GiB 0700 Microsoft basic data
w
> Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
> Do you want to proceed? (Y/N): y
q
-Q
idea):sudo mkfs.ntfs -Q /dev/sdc1
mkdir ~/tmp-win10-usb-drive
sudo mount /dev/sdc1 ~/tmp-win10-usb-drive
mkdir ~/tmp-win10-iso-mnt
sudo mount Win10_1809Oct_English_x64.iso ~/tmp-win10-iso-mnt
rsync
to see progress):sudo cp -rT ~/tmp-win10-iso-mnt/ ~/tmp-win10-usb-drive/
sudo umount ~/tmp-win10-iso-mnt/ ~/tmp-win10-usb-drive/
rmdir ~/tmp-win10-iso-mnt/ ~/tmp-win10-usb-drive/
I've used woeusb on Ubuntu the following way (Warning: this will overwrite your whole partition table!):
sudo woeusb --tgt-fs NTFS --device Win10_1809Oct_Hungarian_x64.iso /dev/sdc
If you encounter this error message:
Partition is still detected after wiping all signatures, this indicates that the drive might be locked into readonly mode due to end of lifespan.
do the following: sudo fdisk /dev/sdc
, and choose d
and then finally w
.
(Source: https://github.com/slacka/WoeUSB/issues/219.) After this, try again to run the above command.
Anyway, with this method woeusb created a gpt partition table with two partitions:
partition file system label size flags
----------------------------------------------------------------
/dev/sdc1 nfts Windows USB 57.00 GiB
/dev/sdc2 fat16 UEFI_NTFS 512.00 KiB lba
unallocated 4.00 MiB
Finally, all I had to do is to put the boot flag with gparted for the /dev/sdc2 partition (alongside lba).
This way, I could sucessfully boot in UEFI mode and install Windows 10 from my USB stick.
You did all right. Make gpt table with fat32 and copy all data from iso on it. But you also need to set flag "msftdata"(not "boot") on this partition with e.g. parted.
I did some search, and found a perfect script: windows2usb.
Since woeusb doesn't support UEFI, this tool supports BIOS and UEFI(with rufus driver), FAT32 and NTFS.
Update: If the NTFS driver in windows2usb fails for you, you may also try ventoy. It's easier to use if you have multiple OS images in one USB stick.
Try using Rufus with Wine.
Regards.
The EFI partition must be Fat32. It is in the EFI spec. Your system will never boot if you put the installer files onto an NTFS partition.
You don't even need any special software. GPT / FAT32 for the installer, extract all files from the iso (I assume you have the latest iso using media creation tool, as it includes the November update), and set the "boot flag" using gparted. It will then boot into the installer in EFI mode assuming you select EFI USB from the boot options when your computer starts.
Pingers.
I needed to create a bootable win10 USB drive for a UEFI system and this script was amazing: https://github.com/jsamr/bootiso/ try it!
In Summary:
First, install the bootiso by running these command:
git clone --branch latest https://github.com/jsamr/bootiso.git
cd bootiso
make install
Note: Make sure you have dependencies that you need. A list and a description can be found here.
Note 2: You can also install the bootiso from some package managers here.
Then run this to get some information about your *.iso file (Optional):
bootiso -p file.iso
Then run this to get some information about your available USB devices (Optional):
bootiso -l
Run this to format the USB
bootiso -f --device DEVICE_NAME (from the previous step)
Finally run this to install:
bootiso --mrsync file.iso --device DEVICE_NAME (from the previous step)
Done!
User contributions licensed under CC BY-SA 3.0