10

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

Note - Any Windows PE ISO available on web which supports creating a bootable USB from linux will be helpful (please mention the steps or reference as well).

Background - I have Hiren’s BootCD PE and wanted to create a bootable USB from Linux. Followed this but the problem is that all answers refer to a HBCD folder which doesn't exist anymore in the ISO.(A weird thing I noted that even menu.lst file refers to the HBCD folder)

Other guides need Windows to create the bootable USB but currently I have access to Linux only (and trying to troubleshoot windows which isn't booting)

Directly booting from USB created using unetbootin doesn't help.

I don't like running wine so answers without using them will be helpful.

Thanks in advance!!!

2 Answers 2

9

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>

4
  • Have a look at this answer and the comment - need to install Grub4DOS as they aren't hybrid ISO : askubuntu.com/a/146128
    – Madhubala
    Jan 18, 2020 at 15:07
  • 1
    The Ask Ubuntu answer is 8 years old. If you follow the link in the comment to Hiren's it doesn't mention Grub4DOS - it says "Hiren’s BootCD PE supports UEFI booting from DVD and USB flash drives. To format, re-partition your USB drive and to copy the ISO content into your USB drive properly, we have developed Hiren’s BootCD PE" . In any case this answer is not using dd but mounting ISO and then copying contents. I tested on a Arch Linux machine and the resulting USB booted fine (in UEFI mode on a MacBook).
    – lx07
    Jan 18, 2020 at 15:33
  • 1
    Under fdisk I have to hit a, not b to toggle bootable flag! Jun 14, 2021 at 5:46
  • @F.Hauri - corrected, thanks!
    – lx07
    Jun 14, 2021 at 6:21
1

Using Woeusb I was able to create the bootable USB for Windows PE.

2
  • As you know,  the question asks for detailed steps and references. Jan 19, 2020 at 20:43
  • A really simple and universal solution that does not require additional details.
    – ybeltukov
    Feb 20, 2022 at 9:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .