How can I create a bootable USB using Windows PE ISO on linux?

The Hiren’s BootCD PE contains both BIOS and UEFI loaders. You can therefore simply copy the contents of the ISO onto a suitably formatted USB key. The same procedure will work with other pre-built PE (such as Kyhi or Gandalf) or a Windows ISO as long as the .wimis less than 4GB.

Format USB

If you want a USB that can boot on either BIOS/CSM or UEFI you need to format it with a MBR partition table containing a FAT32 partition marked active.

  1. BIOS/CSM will only boot Windows from MBR partitioned drives while UEFI will boot from either MBR or GPT so you want MBR partition scheme.
  2. BIOS/CSM will boot from either FAT or NTFS. UEFI may boot from NTFS (if there is a UEFI driver in firmware) but will definitely boot from FAT. The largest file on the Hiren’s Boot.wim is 1.32GB and as this is less than 4GB there is not reason not to use FAT32. If you had larger files you could make separate FAT and NTFS partitions and include a UEFI NTFS driver but this is not required.
  3. BIOS/CSM will only boot if partition is marked active, UEFI doesn’t care so mark it active.

Assuming your USB key is sdc (check with lsblk) you can do this as follows:

  • Create partition table and partition using fdisk. Enter sudo fdisk /dev/sdc and then following options:
  • o to create a new empty DOS partition table
  • n , p, Enter, Enter, Enter, y to create new primary partition accepting defaults and deleting any filesystem signature.
  • t, b to change partition type to FAT32
  • a to set partition bootable.
  • w to write changes.
  • Disconnect and reconnect USB to pick up partition.
  • Format partition using mkfs : sudo mkfs.fat -F 32 /dev/sdc1

Copy data

  • Mount ISO (assuming Hiren’s in Downloads directory).
  • sudo mkdir /mnt/dvd/
  • sudo mount -o loop ~/Downloads/HBCD_PE_x64.iso /mnt/dvd
  • Copy everything from ISO to USB (assuming USB mounted at /run/media/user/Volume)
  • sudo cp -R /mnt/dvd/* /run/media/<user>/<Volume>

Create a bootable USB of Windows PE on linux

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *