Unpack the “Russian doll” of a F11 live CD

Fedora 11 live CDs are like Russian Matryoshka dolls – a filesystem within a filesystem within a filesystem.

On the outside they have to be in the standard CD ISO format because that’s what CDs require. However the CD ISO format is pretty useless, slow, limited filename length, and no support for SELinux labelling. So …

Inside the ISO is another filesystem, a Linux squashfs. (Question: why do they use the squashfs?) That’s not the end though, because …

Inside the squashfs is the final ext3 filesystem as a blob.

In libguestfs / guestfish 1.0.62+ I’ve added some commands to make it easy to unpack this, so you can read out the contents of the inner ext3 filesystem.

All without needing to be root, of course.

Here’s how:

$ guestfish -a Fedora-11-i686-Live.iso

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help with commands
      'quit' to quit the shell

><fs> mkmountpoint /cd
><fs> mkmountpoint /squash
><fs> mount /dev/sda /cd
><fs> mount-loop /cd/LiveOS/squashfs.img /squash
><fs> ls /squash/
><fs> ls /squash/LiveOS/
><fs> mkmountpoint /ext3
><fs> mount-loop /squash/LiveOS/ext3fs.img /ext3
><fs> ls /ext3/

After this, the inner ext3 filesystem is mounted inside guestfish as /ext3 and you can go ahead and read out files from it. (But not, unfortunately, edit it because ISO images are read-only. See my earlier posting about that).



Filed under Uncategorized

2 responses to “Unpack the “Russian doll” of a F11 live CD

  1. Pingback: Tip: Use guestfish to look inside an Arch Linux ISO « Richard WM Jones

  2. Pingback: Making a bootable CD-ROM/ISO from virt-builder | Richard WM Jones

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.