i have a 32 gigs usb drive and, given that most isos are around 2-5 gigs, it's such a shame to see nearly 30 gigs of perfectly good free space go to waste whenever i need to use it as a bootable drive. is there any way i can burn an iso image to the usb drive while still being able to use its free space?

all 10 comments

sorted by: hot top controversial new old
[–] 9 points 11 months ago* (last edited 11 months ago) (2 children)

If you don't want Ventoy:

  1. Wipe the USB: wipefs -a /dev/sdb
  2. Copy the ISO image to the USB: dd of=/dev/sdb if=/path/to/image/linux.ISO bs=1M status=progress
  3. 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.
  4. 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 thisWipe 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.

  • source
  • hideshow 2 child comments
  • [–] [S] 2 points 11 months ago* (last edited 11 months ago) (1 child)

    it didnt work sadly. all i got was a blank screen

    edit: actually i think i got it right this time, i just needed to format it as an empty partition on gparted. brb edit 2: nope. blank screen again (even though the dd'd partition got recognized by gparted this time)

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 11 months ago

    Sorry about that, you are right. The way I originally envisioned would have disrupted the partitioning of the original ISO. Tried it myself and ran into the same issue, then finally recalled how I actually did it. See my edited comment above. Unfortunately, changing out the ISO non-destructively might be harder than I originally thought.

  • source
  • parent
  • [–] 14 points 11 months ago (2 children)
  • [–] 4 points 11 months ago

    Wanna weigh in for whatever it's worth.

    Was super excited when i found Ventoy. Had 2 partitions on the same flash drive, 1 for Ventoy and .isos and one for backing up various files. It was supposed to be the one to rule them all.

    When it came to actually using Ventoy to create a new Linux installation, the installation failed and the Ventoy partition became completely corrupted, rendering it unusable and the .isos were gone.

    Not sure what happened, but going with Ventoy is not really worth the hassle if I can reliably flash a usb drive that I know will work.

  • source
  • parent
  • [–] 4 points 11 months ago

    I wonder if you could create a partition as you would.with a hard disk or SSD.

    A not totally unrelated stack post:

    stack post

  • source
  • [–] 3 points 11 months ago

    Sounds like you need to create two partitions and format them with relevant filesystems

  • source
  • [–] 1 point 11 months ago

    Yes, it's not special. If the partition is big enough, you can just put files on it. If it's not, either expand it or create a new one and just use it like normal.

    But keep in mind, depending on the tool you use, it might wipe the whole drive next time you write an ISO.

  • source
  • [–] 1 point 11 months ago

    You can use Ventoy and burn even more isos on it, for example rescue distros, Windows, etc.

  • source