I am trying to create a Linux Live USB drive from an isohybrid (.iso) image.
To accomplish this task, I have taken these steps in the past:
Securely wipe the flash drive using the command:
sudo dd bs=4M if=/dev/zero of=/dev/sdxCreate an
msdospartition table on the flash drive withgpartedCreate a new partition (
/dev/sdx1) that is the entire size of the flash drive with afat32filesystem (for cross-platform compatibility) aligned to cylinder withgpartedSet the
bootableflag on the newly created partition (/dev/sdx1) usinggpartedCheck the filesystem on the newly created partition (
/dev/sdx1) to make sure all of the disk formatting operations were carried out properly usinggpartedWrite the
.isoimage to the flash drive using the command:sudo dd bs=4M if=<distro>.iso of=/dev/sdx
However, after completing the last step, when I inspect the disk again with gparted, it reports that all of the space on the flash drive is unallocated and that there is no partition table on the disk. I suspect that this may have something to do with the Master Boot Record (MBR) being overwritten or corrupted when I write the .iso to the flash drive using the dd command.
When I mount the flash drive all of the files that were contained within the .iso appear to be properly extracted from the .iso, and I am sometimes able to boot the live USB. However, I have had various reliability issues using this method during boot up and also when trying to install a distro on a hard drive using the live USB. Like I mentioned before, I suspect that this may have something to do with the partition table being corrupted and the fat32 filesystem not being properly detected after the .iso is written to the flash drive, which may be leading to some reading and writing issues with the disk when booting and installing.
Is there a way to prevent these reliability issues from occurring and the partition table from being corrupted, while still using only gparted and dd?