Tip: Use guestfish to look inside an Arch Linux ISO

Simples!

$ guestfish --ro -a archlinux-2010.05-core-x86_64.iso

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

Type: 'help' for a list of commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
><fs> list-devices
/dev/vda
><fs> list-partitions
/dev/vda1
><fs> vfs-type /dev/vda1
udf
><fs> mkmountpoint /iso
><fs> mkmountpoint /root
><fs> mount /dev/vda1 /iso
><fs> ll /iso
total 334378
dr-xr-xr-x 3 root root       296 May 16 15:00 .
drwxr-xr-x 4 root root      4096 Sep 13 19:14 ..
dr-xr-xr-x 3 root root       556 May 16 14:53 boot
-r--r--r-- 1 root root 179900416 May 16 15:00 core-pkgs.sqfs
-r--r--r-- 1 root root       454 May 16 15:00 isomounts
-r--r--r-- 1 root root      8192 May 16 14:55 overlay.sqfs
-r--r--r-- 1 root root 162484224 May 16 14:55 root-image.sqfs
><fs> mount-loop /iso/root-image.sqfs /root
><fs> ll /root
total 5
drwxr-xr-x 20 root root  302 May 16 14:51 .
drwxr-xr-x  4 root root 4096 Sep 13 19:14 ..
-rw-r--r--  1 root root   11 May 16 14:51 .arch-chroot
drwxr-xr-x  2 root root 1158 May 16 14:51 bin
drwxr-xr-x  4 root root   82 May 16 14:51 boot
drwxr-xr-x  2 root root   54 May 16 14:50 dev
drwxr-xr-x 33 root root 1715 May 16 14:51 etc
drwxr-xr-x  2 root root    3 Feb 26  2010 home
drwxr-xr-x  8 root root 3486 May 16 14:51 lib
drwxr-xr-x  2 root root   63 Apr 16 12:51 lib64
drwxr-xr-x  5 root root   46 Feb 26  2010 media
drwxr-xr-x  2 root root    3 Feb 26  2010 mnt
drwxr-xr-x  2 root root    3 Feb 26  2010 opt
drwxr-xr-x  2 root root    3 May 16 14:42 proc
drwxr-x---  2 root root    3 Feb 26  2010 root
drwxr-xr-x  2 root root 3251 May 16 14:51 sbin
drwxr-xr-x  4 root root   38 Feb 26  2010 srv
drwxr-xr-x  2 root root    3 May 16 14:42 sys
drwxrwxrwt  2 root root    3 May 16 14:51 tmp
drwxr-xr-x  9 root root  149 May 16 14:50 usr
drwxr-xr-x 13 root root  159 May 16 14:51 var

Explanation:

  1. guestfish --ro -a foo.iso opens “foo.iso” (or any disk image) read only.
  2. list-devices and list-partitions are ways to see what there is in a disk image. You can also use virt-list-filesystems.
  3. vfs-type looks at a partition or other device and tells us what sort of filesystem it contains. UDF is the format used by DVDs.
  4. Install CDs typically contained nested filesystems, nested squashfs filesystems in this case, so we use mkmountpoint to create some more mountpoints (because we can’t just mount everything on the root mountpoint).
  5. mount mounts the first partition.
  6. mount-loop loopback mounts the root-image squashfs filesystem from the file.

Previously and previously.

About these ads

1 Comment

Filed under Uncategorized

One response to “Tip: Use guestfish to look inside an Arch Linux ISO

  1. Thanks for this post. This one post make me want to learn more about guestfish.

    I’m installing it as I type. Its amazing what you learn by just subscribing to Planet Fedora.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s