Tag Archives: filelight

Why has the libguestfs appliance grown by 281 MB?

a.k.a guestmount + filelight are awesome!

Click to see the full image


If you want to reproduce the same diagrams yourself, just do:

$ mkdir /tmp/mp
$ guestmount --ro \
    -a /var/tmp/.guestfs-1000/appliance.d/root \
    -m /dev/sda /tmp/mp
$ filelight /tmp/mp


Filed under Uncategorized

KDE Filelight with guestmount

Prompted by Adam Williamson’s comment, I decided to see if we can use filelight on a guestmount (FUSE-mounted) virtual machine.

Obviously the answer is yes, but it’s pretty slow. It took a few minutes for filelight to scan /usr/share/doc from the virtual machine (about 5300 files). I gave up on scanning the whole VM disk.

The reason is that filelight makes ordinary system calls to scan the disk. These are redirected through the magic of FUSE through to discrete libguestfs calls into the appliance (see the libguestfs architecture diagram here). Compare that to the “du” example which is far more efficient — a single “du” message is sent to the appliance which then processes everything internally before sending a single response message back. The du command is far faster, even though it must be doing roughly the same amount of work.

If filelight (or baobab) was able to make native libguestfs calls, then we could make it a lot more efficient.

1 Comment

Filed under Uncategorized

Why “minimal” is 225 MB

As I mentioned in the last post a “minimal” febootstrap Fedora install clocks in at a staggering 225 MB. When I say minimal, I mean just bash and the simplest command-line tools from coreutils:

$ ls /bin
arch      chgrp  cut   echo   fgrep  ls      mv    rmdir  stty   true
basename  chmod  date  egrep  grep   mkdir   nice  sh     su     uname
bash      chown  dd    env    link   mknod   pwd   sleep  sync   unlink
cat       cp     df    false  ln     mktemp  rm    sort   touch

Where does all the space go?

Thanks to KDE’s filelight tool, we can easily visualize the disk usage, in a nice interactive graphical way.


34% of the total disk space (76 MB) is taken up with a single file, /usr/lib/locale/locale-archive. We suspect this is an optional file that contains all locale information and is mapped into every glibc-using process. Since the minimal image I have in mind is non-interactive, there doesn’t seem to be much point in having locales at all, and this can be deleted. Obviously if you wanted an interactive, internationalized Fedora, you can’t just go and remove this file.

Another 34% is taken up with the yum cache, ie. the packages that we installed. This just needs to be deleted, and febootstrap should have an option to do this automatically.

6% (15 MB) are the locale files. As explained above, these can go.

3% (8 MB) is, extraordinarily, cracklib. It turns out that coreutils requires pam, which requires cracklib to test the strength of passwords. This is completely useless for us, because the virtual machine image won’t even have a login prompt, never mind the ability to change passwords.

A further 5% is documentation, man pages and i18n stuff that we don’t care about.

Just removing the above brings the image down to 38 MB. The next step will be to do some much more aggressive minimization, based on analyzing the binaries that we’re actually going to use and their dependencies.


Filed under Uncategorized