If you don't want Ventoy:
- Wipe the USB:
wipefs -a /dev/sdb - Copy the ISO image to the USB:
dd of=/dev/sdb if=/path/to/image/linux.ISO bs=1M status=progress - Make the data partition in the free space:
cfdisk /dev/sdb, don't remove the iso9660 signature, create partition in the free space, and Write. - Format the partition with filesystem of your choice:
mkfs,cryptsetup, etc.
(everything as root, replace /dev/sdb with the location of your USB)
As is, this only leaves exactly enough for the ISO you are currently working with, sealing the fate of the data partition if you need to swap out the ISO. I suspect there is a workaround in theory, but I haven't gotten around to that yet.
Also see https://github.com/thias/glim, a GRUB-based alternative to Ventoy, albeit with less compatibility.
Edit: this will not work with Windows ISOs and the data partition won't show up in certain versions of Windows, in case anyone is wondering
For posterity, what I originally thought, don't do this
Wipe the drive and partition it so the first partition is large enough for your ISO, then the second partition for your data spans the remaining space. I chose MBR over GPT so I could boot on both modern and legacy BIOS machines. Then dd your ISO to the first partition. Set the bootable flag on that partition if it isn't already. Format the second partition with whatever filesystem you'd like.
My Clonezilla recovery drive is set up like this, but it's been a while so I might have forgotten something. Let me know if I did.
all 10 comments