How can ISO 9660 coexist with a Linux filesystem on a Live CD partition?

7

I'm confused by this. My understanding is that a live CD is sometimes accessed through the ISO 9660 driver (like when you're accessing the file without booting), but obviously a different filesystem is used when the system is booted up. Let's take for example a Linux Live CD with the Ext3 filesystem that is to be accessible by Windows when not booting. When Windows accesses it, it needs to have some kind of formatting that Windows can read; I assume this would be ISO 9660. But to be bootable, the partition needs to be formatted as a Linux filesystem. How can a partition be formatted as both an ISO 9660 filesystem and a Linux filesystem? I know there's something fundamental that I'm getting wrong here, but this isn't the sort of question you can just Google and expect to get an answer.

Zen Hacker

Posted 2018-07-28T00:07:02.107

Reputation: 353

3Actually, it would theoretically be possible for two filesystems to share the same space. As long as the metadata doesn't collide (for example, if one filesystem stores its metadata at a fixed address at the beginning and the other at a variable address at the end), then they can share the raw file data, and mark the metadata area of the respective other filesystem as unused space. Obviously, this only works for read-only file systems. I don't know whether this would work for ISO9660 and Ext4, for example, but it could theoretically work. – Jörg W Mittag – 2018-07-28T07:28:55.653

3In fact, this is how the UDF Bridge format works, where a UDF file system and an ISO9660 file system share the same physical medium. – Jörg W Mittag – 2018-07-28T07:35:54.027

Answers

11

But to be bootable, the partition needs to be formatted as a Linux filesystem

Well, for one, no – it just needs to be a filesystem understood by Linux and capable of storing basic POSIX permission bits. ISO 9660 with the Rock Ridge extensions would do the job. (So would NTFS with ntfs-3g, or the weird "umsdos" in the early days.)

But for most live CDs, the OS root filesystem isn't directly kept on the CD – it's inside a image file (more commonly squashfs, not ext3) which is mounted using losetup.

If you run findmnt inside a running live CD, you'll see that / is some kind of overlayfs/unionfs which has a squashfs image as the lower layer (containing the read-only files), and a tmpfs/ramdisk as the upper layer (containing volatile changes).

user1686

Posted 2018-07-28T00:07:02.107

Reputation: 283 655