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!!!
Best Answer
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
.wim
is 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.
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 tablen
,p
, Enter, Enter, Enter,y
to create new primary partition accepting defaults and deleting any filesystem signature.t
,b
to change partition type to FAT32a
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>