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
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.
- 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.
- 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.
- 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/sdcand then following options:oto create a new empty DOS partition tablen,p, Enter, Enter, Enter,yto create new primary partition accepting defaults and deleting any filesystem signature.t,bto change partition type to FAT32ato set partition bootable.wto 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/dvdCopy everything from ISO to USB (assuming USB mounted at /run/media/user/Volume)
sudo cp -R /mnt/dvd/* /run/media/<user>/<Volume>
Using Woeusb I was able to create the bootable USB for Windows PE.
2