6

Let's say I downloaded a bootable ISO of some Linux distribution, because I want to install Linux later. I can burn that ISO onto my USB flash drive. However the device will keep the iso9660 filesystem, so it won't be writable. I can install Linux, but I cannot do anything else with my USB flash drive.

So, is it possible convert the ISO into a "normal" ext4 filesystem, and still keep the USB stick bootable?

Giacomo1968
  • 58,727

5 Answers5

5

iso9660 is not what makes it bootable here – it's the filesystem that CDs/DVDs use, and your firmware would indeed be looking for special ISO9660 header fields if you were booting this image from an actual CD, but those become completely irrelevant when booting from any other type of disk. The USB stick is bootable only because the image was a "hybrid ISO" with a traditional MBR boot sector, and/or EFI system partition, written alongside the ISO9660 data.

So yes, it is possible to e.g. create a regular ext4 filesystem (or even FAT32, as most "live CDs" have the actual Linux rootfs in a SquashFS image anyway), extract the contents of the ISO9660 into it, and install a bootloader into the USB stick's MBR – most such CDs use isolinux, so you'd install the regular syslinux/extlinux onto the USB stick and hopefully it'll pick up the existing syslinux.cfg.

Rufus and similar tools are often capable of extracting the contents of your Linux ISO into a more regular filesystem and making it bootable. (It doesn't always work 100% because such tools rely in part on recognizing the specific contents of a Linux ISO image and adapting them, but it still works most of the time.)

grawity
  • 501,077
4

Write an Ubuntu live ISO (installation media) onto a USB-memory.

IF you Boot it once (in "Try Ubuntu" mode),
you will get a "writeable" partition covering the "free" parts of the stick's memory
(i.e. those parts not occupied by the ISO-image).

Sadly this cannot be used for data transfers as e.g. gparted or any OS (besides the one booted from the stick!) does not see 'writeable' for mounting - it is likely "inside" the ISO image.

But this does work:
Before you boot the first time; use any partitioning tool and create at least one second partition

Details from @DavidAnderson 's comment below:
I used the fdisk --wipe never command to create the 4th partition. This command automatically moved the secondary (backup) partition table and header to the end of the flash drive. I used the mkfs.fat -F 32 command to create FAT 32 format volume in the new partition

Hannu
  • 10,568
3

Ventoy is a tool that will create a bootable USB device containing a partition with the HPFS/NTFS/exFAT type, where you can copy-paste .iso files. Then when booting from Ventoy, it will display the list of available ISOs. But you can also store any file on this partition.

You can also reserve space to create an EXT4 partition if you prefer.

A.L
  • 820
  • 2
  • 12
  • 29
2

I found by myself another answer. I hope this can help others. (Using Linux)

  • I formatted USB flash drive as ext4
  • I mounted the ISO file as a local disk
  • I copied all files from ISO to USB flash drive
  • I installed grub on the USB key: sudo grub-install --target=i386-pc /dev/sdc
0

This is what is currently posted to your question:

Let's say I downloaded a bootable ISO of some Linux distribution, because I want to install Linux later. I can burn that ISO onto my USB flash drive. However the device will keep the iso9660 filesystem, so it won't be writable. I can install Linux, but I cannot do anything else with my USB flash drive.

I am not sure exactly was meant by “burn”. This answer defines “burn” to mean copying the ISO file to a flash drive through the use of the dd command. This command is available from Linux, macOS and Windows.

You posted in a comment that the ISO, used in your answer, was for Linux Mint. I downloaded and burned the Cinnamon Edition of Linux Mint 22 LTS to an USB flash drive. The command I used is given below. I entered the command while booted to the current Debian release of peppermintOS.

sudo dd if=~/Downloads/linuxmint-22-cinamon-64bit.iso bs=1M status=progress of=/dev/sdb

The resultant flash drive is both BIOS and UEFI bootable. Regardless of how you boot the flash drive, a partition, with a writable Ext4 volume, is automatically created in the free space at the end of this drive.

Your post currently asks the following question:

So, is it possible convert the ISO into a "normal" ext4 filesystem, and still keep the USB stick bootable?

Converting is not necessary to solve the problem described in your post. You can solve your problem by booting the flash drive to Mint and then shutting down.


For others reading this answer, you may have a Linux ISO file which does not automatically create a new partition, when “burned” to a USB flash drive and then booted. There is also the possibility that a user would want new partition with a format other than ext4. In these cases, I would refer you to the answer posted by Hannu.