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

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.


Solution 1:

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).