How to create windows 10 bootable usb in linux

How To Make A Bootable Windows 10 USB On Linux Using The New WoeUSB

New WoeUSB command line

WoeUSB is no more. At least in its original form. The tool that’s used to create bootable Windows USB drives from Linux has been split into a command line program called WoeUSB, which is under active development, and a GUI called WoeUSB-frontend-wxgtk that’s currently unmaintained.

There’s also an independent Python port of WoeUSB, called WoeUSB-ng, that’s actively maintained.

The new WoeUSB, which is now just a command line tool, supports creating a bootable Windows USB drive from Linux with support for both Legacy PC and UEFI booting. The filesystem can be either FAT32 or NTFS, and the source can be a disk image or a physical installation disk. It’s also wroth noting that WoeUSB supports non-ASCII filenames.

As for supported Windows installation images, WoeUSB supports Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10, in any language or edition. Windows PE is also supported.

How to install WoeUSB (command line tool)

The new WoeUSB has the following dependencies: Bash >= 4.3, Coreutils, util-linux, Grep and Gawk, Find Utilities, Parted, and Wget. p7zip is an optional dependency, required for example when the Windows 7 installation media doesn’t ship with the USEFI bootloader in the proper location.

On Debian, Ubuntu, and Linux distributions based on these, like Pop!_OS, Linux Mint, Zorin OS, etc., you can install these dependencies by using (most are already installed, but just in case; I’m skipping some packages that are almost always installed, like Bash or Find):

sudo apt install coreutils util-linux gawk parted wget p7zip
sudo dnf install coreutils util-linux gawk parted wget p7zip
sudo pacman -S coreutils util-linux gawk parted wget p7zip

Now you can install the new, command line only WoeUSB somewhere in your PATH (the commands below download it and install it to /usr/local/bin):

wget https://raw.githubusercontent.com/WoeUSB/WoeUSB/master/sbin/woeusb -O /tmp/woeusb

sudo install /tmp/woeusb /usr/local/bin

Another command line tool that can create bootable USB drives from Linux and Windows ISO files is bootiso.

How to use WoeUSB command line tool to create a bootable Windows USB drive

1. To get started, plug the USB stick you want to use to create a bootable Windows installation, into your computer. Wait a couple of seconds, then use the command below to list all disks connected to your computer, including the USB drive:

Example with this command showing an USB drive attached to my computer:

$ sudo parted -l

.
Model: USB DISK 3.0 Pro (scsi)
Disk /dev/sdd: 31.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 31.0GB 30.9GB primary boot
2 31.0GB 31.0GB 33.6MB primary fat16 esp

In this example output you can find the USB device name by looking under Disk , so in this example’s case it’s /dev/sdd . The partitions are listed below the Disk Flags , so in this example you can see 2 partitions: 1 and 2 (and since the device name is /dev/sdd , the partitions are /dev/sdd1 and /dev/sdd2 ).

Читайте также:  Обновление плагина криптопро linux

2. Unmount any mounted USB drive partitions

In case the USB drive you’ve just inserted was mounted, unmount it before proceeding using:

Replace /dev/sdXN with the USB device partitions (see step 1).

3. Create a bootable Windows drive from Linux using WoeUSB

There are 2 ways you can do this. The device creation method completely wipes the entire USB storage device, then build a bootable Windows USB device from scratch. The partition creation method copies the Windows ISO files to an existing partition (that you choose) of an USB storage device and make it bootable, only overwriting files that already exist under the same name on the USB.

To create a bootable Windows USB drive from Linux using WoeUSB in device mode, use:

sudo woeusb --device /dev/sdX --target-filesystem ntfs
  • —device specifies the device creation mode, «device» in this case
  • /path/to/Windows.iso — replace this with the path to the Windows ISO you want to use for the bootable USB media creation
  • /dev/sdX is the USB device you found out under step 1 (for example /dev/sdd ).
  • —target-filesystem ntfs specifies to use NTFS as the target filesystem, instead of the default FAT32. Without this, you’ll get into an error in most cases, saying that the source image has exceeded the FAT32 4GiB file size limitation, like this: Error: File «/media/woeusb_source_1602672597_513603/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.

Important: double-check that the USB device is correct before running the command! All the data on that drive will be lost!

To create a bootable Windows USB drive from Linux using WoeUSB in partition mode, use:

sudo woeusb --partition /dev/sdXN
  • —partition specifies to use the WoeUSB partition mode, which copies the Windows ISO files to an existing partition (that you choose) of an USB storage device and make it bootable, only overwriting files that already exist under the same name on the USB
  • /path/to/Windows.iso — replace this with the path to the Windows ISO you want to use for the bootable USB media creation
  • /dev/sdXN is the USB device partition to which you want to copy the Windows files to. You can find the device and partition by using sudo parted -l , as explained under step 1 (for example /dev/sdd1 ).

We’re not specifying the partition target filesystem type when using WoeUSB in partition mode, because this only copies the files to a partition on the USB stick, so the partition is already supposed be NTFS.

Reminder: double-check that the USB device and partition are correct before running the command! All the data on that drive will be lost!

Читайте также:  Canon mf4410 драйвер linux ppd

For more WoeUSB options, like specifying your own label for the newly created filesystem, apply a workaround for a BIOS bug that won’t include the device in the boot menu if no partition has a boot flag toggled, and more, see the application help ( woeusb —help ).

Источник

Create a bootable Windows 10 USB drive (UEFI) from Linux

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.

  1. Created a GPT
  2. Created a FAT32 at end of drive of 50 MB
  3. Created NTFS at remaining space
  4. Put UEFI:NTFS on FAT32
  5. Copied ISO content to NTFS

The installation starts ok, but at start of progress shows error 0xc0000005 (if i remember correctly).

7 Answers 7

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.

You cannot put all data onto a FAT32 drive as of June 2019. The latest update contains a windows.wim which is larger than 4.1 GiB.

@Ben You can when you compress the install.wim file using dism or wimtools , see tqdev.com/2019-cannot-copy-windows-10-install-wim.

I tried this and didn’t work (and a lot of other things like exFat format for newer Windows 10 isos) So in the end I gave up, went to Windows and downloaded their Media Creator Tool. After that I checked and the USB worked. I checked the flags and they are boot and lba

Windows 10 October 2018 release UEFI bootable USB drive on any Linux distribution.

Notice, that since Windows 10 October 2018 release the installation file sources/install.wim is 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 ).

Variant A (For PCs with NTFS support)

Steps for creating USB drive with name /dev/sdc (Replace all commands with YOUR device name!):

  1. Insert USB drive to computer and make sure it is unmounted. Some distributions like to automount USB drives, so make sure you unmount them. Mounted partitions can be found with mount -l | grep ‘/dev/sdc’ , then unmount with sudo umount /dev/sdcX (where X is partition number).
  2. Open USB block device using 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 
mkdir ~/tmp-win10-usb-drive sudo mount /dev/sdc1 ~/tmp-win10-usb-drive 
  1. Download Windows installation ISO, create new temporary directory in your home and mount it there:
mkdir ~/tmp-win10-iso-mnt sudo mount Win10_1809Oct_English_x64.iso ~/tmp-win10-iso-mnt 
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/ 

Variant B (For PCs without NTFS support)

Steps for creating USB drive with name /dev/sdc (Replace all commands with YOUR device name!):

  1. Insert USB drive to computer and make sure it is unmounted. Some distributions like to automount USB drives, so make sure you unmount them. Mounted partitions can be found with mount -l | grep ‘/dev/sdc’ , then unmount with sudo umount /dev/sdcX (where X is partition number).
  2. Open USB block device using gdisk /dev/sdc
  3. Configure it as GPT
  4. Create first partition of 1GB size and type Microsoft basic data (code 0700 ).
  5. Create second partition of rest of the size and type Microsoft basic data (code 0700 ).
  6. 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: Enter > First sector: Enter > Last sector: 1G > Type: 0700 > n > Partition Number: Enter > First sector: Enter > Last sector: Enter > Type: 0700 > p # Should print something like: > Disk /dev/sdc: 30031250 sectors, 14.3 GiB > Model: Ultra USB 3.0 > Sector size (logical/physical): 512/512 bytes > Disk identifier (GUID): C657C0AF-3FE2-4152-8BF1-CE3CCA9F3541 > 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 30031216 > Partitions will be aligned on 2048-sector boundaries > Total free space is 4061 sectors (2.0 MiB) > Number Start (sector) End (sector) Size Code Name > 1 2048 2048000 999.0 MiB 0700 Microsoft basic data > 2 2050048 30031216 13.3 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 
sudo mkfs.fat -F32 /dev/sdc1 sudo mkfs.ntfs -Q /dev/sdc2 
mkdir ~/tmp-win10-fat-usb-drive mkdir ~/tmp-win10-ntfs-usb-drive sudo mount /dev/sdc1 ~/tmp-win10-fat-usb-drive sudo mount /dev/sdc2 ~/tmp-win10-ntfs-usb-drive 
  1. Download Windows installation ISO, create new temporary directory in your home and mount it there:
mkdir ~/tmp-win10-iso-mnt sudo mount Win10_1809Oct_English_x64.iso ~/tmp-win10-iso-mnt 
  1. Copy following files with from mounted ISO to FAT32 formatted USB drive (basically copy everything besides sources/ but include sources/boot.wim ):
sudo cp ~/tmp-win10-iso-mnt/* ~/tmp-win10-fat-usb-drive/ sudo cp -r ~/tmp-win10-iso-mnt/boot ~/tmp-win10-fat-usb-drive/ sudo cp -r ~/tmp-win10-iso-mnt/efi ~/tmp-win10-fat-usb-drive/ sudo cp -r ~/tmp-win10-iso-mnt/support ~/tmp-win10-fat-usb-drive/ sudo mkdir ~/tmp-win10-iso-mnt/sources ~/tmp-win10-fat-usb-drive/ sudo cp ~/tmp-win10-iso-mnt/sources/boot.wim ~/tmp-win10-fat-usb-drive/sources 
sudo cp -rT ~/tmp-win10-iso-mnt/ ~/tmp-win10-ntfs-usb-drive/ 
sudo umount ~/tmp-win10-iso-mnt/ ~/tmp-win10-usb-fat-drive/ ~/tmp-win10-usb-ntfs-drive/ rmdir ~/tmp-win10-iso-mnt/ ~/tmp-win10-usb-drive/ 

Источник

Оцените статью
Adblock
detector