Home Home
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Author Archive

Today in Factory: A smart gdb

May 13th, 2009 by

I have no idea who came up with this, but I just fell over a gdb that teached me to use zypper while
debugging a problem I’m having:

Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C "debuginfo(build-id)=41d4f203d690d7db47fbcc38c3f47a2cdcc6848f"

And so I did, and it installed glibc-debuginfo. Smart!

Qemu network speed

May 7th, 2009 by

I’m working on a solution to automatically test drive factory installations every day and one thing that bothered me majorly was the download speed I had with kvm. I couldn’t get faster than around 300K/s, which makes a factory installation take around 5 hours. Not really practical for my purpose, and it was quite frustrating taking that the host gets almost 3MB/s out of download.opensuse.org (I get various german mirrors). So I asked around and Jan suggested the setup of Gladiac, but it didn’t want to fly for me. So I continued experimenting and went to Luwdig for some firewall advise. And his suggestion was much simpler: using pcnet. So my kvm call looks like this now:


qemu-kvm -net user,hostname=factory-pc -net nic,model=pcnet -drive ....

Now I have about the full performance – and I’m ten steps closer to automating bootchart generation of daily factory 🙂

I got Network!

May 6th, 2009 by

I tried an installing using the USB images on the Acer Aspire One I’m using to test these things (and to test preload on SSD systems).

And I wasn’t able to connect to wifi, because the NetworkManager didn’t want to give out wireless networks to the applets. The reason was in the logs: it thought the radio kill switch was on. But fortunately Helmut gave me the golden tipp:

echo "blacklist acer-wmi" > /etc/modprobe.d/coolo.conf
rmmod acer-wmi
rcnetwork restart

It’s one of these things that frustrate you, because they are very easy to work around if you find the right spot in the internet. And that’s the reason I create this blog entry: to allow the next with the problem to fix his wlan. Happy surfing and thank Helmut not me 🙂

BTW: it’s fixed for newer kernels, but 2.6.30 is too fresh for me.

Profiled Live CDs

May 6th, 2009 by

As said earlier, the Factory Live CDs are using clicfs for compression and write access. This has one performance problem: booting on ext3 accesses many different blocks (4096 bytes each) that are on many different places in the file system. Squashfs has a structure that makes it a better fit to livecds as it compresses metadata independent from file data. This doesn’t give you a huge difference, but it’s there. Especially with CDs that are very slow to seek from track to track. Booting the gnome 64bit live cd loads about 177MB (out of >2200MB in total on the CD) when booting into an autologin session. This comes with around 1700 seeks – and one seek can be as slow as of half a second (even though most don’t take that long).

But what’s worse: as clicfs (and squashfs) create larger blocks for gaining better compression (128KB for both), you will in effect decompress way more data than you need – and while the decompression used isn’t a big problem for nowadays computers (and you don’t necessarly expect the live cd to fly on yesterday’s computers), it adds quite a lot to the boot time of the live cd.

As I talked a lot with real file system developers about the problem, a pretty simple idea came up: reshuffle the blocks in a way that they are just in the right order – both within the larger compression blocks as on CD to avoid seeks as much as possible. That’s the reason clicfs and mkclicfs both take a -l option. If you mount the container with -l, it will output things like this to the logfile:


access 0+11
access 189+4
access 32957+4
access 65536+4
access 98493+4
access 131072+4
access 164029+4
access 196608+4
access 229565+4
access 262144+4
access 295101+4
access 327680+4
access 360448+4
access 393216+4
access 425984+4
access 458752+4
access 491520+4
access 524288+4
access 557056+4
access 589824+4

That’s actually the first couple of accesses on booting said live cd. It’s resize2fs that’s reading 16K here and there on the file system – accessing 20 compression blocks, decompressing 132K for each of these accesses. But the good news: if you pass this log file to mkclicfs -l, it will put all these blocks as first blocks while creating the container. Of course you need to make sure both clicfs and mkclicfs are talking about the same ext3 file system, otherwise it will be nonsense data.

So what I do is abusing the build service in a sense. I let kiwi create a live cd with fast compression as first step – fast compression because I’m only interested in the ext3 file system. Then I download and boot these live cds in kvm and grab the clicfs log. These I upload back into the project and as third step I have a package that will depend on the live cds from step 1 and the logs from step 2 to generate the real live cds with good compression.

This makes up for the initial disadvantage in performance – it’s actually the opposite, the factory live booted 12% faster than the 11.1.

Rebooting icecream

May 6th, 2009 by

Our icecream scheduler is moved to another room, so I thought I share the statistics
(just telnet <scheduler> 8766)

200-ICECC 0.8.0-make-it-cool: 5261077s uptime, 61 hosts, 0 jobs in queue (53255934 total).

So this is still the pre-0.9 code and it served in 60 days over 10 jobs per second on average.

Factory USB Images

May 4th, 2009 by

If you’re interested in USB images, I’m publishing factory USB images built in the build service. They are completely fresh and see no testing at all, so if you find a problem, send me a patch 🙂

They are compressed .bz2, so the download is roughly the same as a CD ISO, but they are actually .raw images. So you can deploy them on a USB stick and carry around your personal linux hard drive. But you will need something > 3G. Installing them is pretty easy.

Put your USB stick in your computer, then check /dev/disk/by-id/usb* for the name of your stick. Mine is named /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0. You can double check by looking if it points to the same sdX that you see last in dmesg. Like this:

sd 29:0:0:0: [sde] Assuming drive cache: write through
sde: sde2
sd 29:0:0:0: [sde] Attached SCSI removable disk


desdemona:~ # ls -l /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0
lrwxrwxrwx 1 root root 9 4. Mai 15:47 /dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0 -> ../../sde

Bot are sde – fine. What partitions are on it, doesn’t matter – all data will be erased by this.

Now the command (for gnome.x86_64 – there are 3 other choices):

wget -O - http://download.opensuse.org/repositories/openSUSE:/Factory:/Live/images/openSUSE-11.2-usb-gnome.x86_64-2.8.0-Build18.1.raw.bz2 | bzcat | dd of=/dev/disk/by-id/usb-Kingston_DataTraveler_II+_5B751D8C1994-0:0 bs=4M

Depending on the speed of your USB stick, this can take a while, but the good thing is that this command doesn’t require any temporary space. My stick is a very fast one and it takes around 10 minutes to download and “burn”. After that, either reboot or put the stick in the computer you like to boot. On first boot, it will expand to the size of your USB stick, creating another partition.

Note that this images come without live installer, but you can of course zypper in yast2-live-installer and xdg-su -c /sbin/yast2 live-installer.

What’s behind “lzma compressed livecds”

April 28th, 2009 by

There are various ways to build a live cd and since 11.2 Milestone 1 there is a new one: clicfs. I’ll try to explain:

The challenge with a live cd is the size of the CD and what you put on it, 700MB is not enough for a typical desktop experience. So most (if not all) distributions use compression to squeeze about 2GB on a CD. There are various compression file systems, most famous is squashfs – which is since 4.0 even in the kernel mainline (>= 2.6.29) and uses gzip compression, even though there exist patches to make it use lzma. These lzma patches are not very often refreshed and not officially supported by the squashfs authors. This might actually change soon as kernel 2.6.30 has lzma decompression built in – but it’s not there yet.. There is also cloop, which I think is exclusive to Knoppix. It’s also gzip compressed and has a different semantic than squashfs. More to that later.

But however you compress, it comes with a catch: your compression will create a read only file system. But you need to write to it, not to all places, but in various (/var/run, /var/tmp, /tmp/, often in /etc, surely in /home). For a long time, the live cds existent created one large tmpfs and symlinked all the places and files that needed writing. But this is pretty unflexible and also takes more memory than really necessary. The new solution was first unionfs, which has a long history with many ups and downs and then later aufs. Aufs is Another unionfs and is the reason for one of the downs of unionfs. With a union you can generate a file system that is actually a map of two: the read only part and a read write part. But neither of them has good short term prospect of getting in the kernel mainline (aufs is trying hard at the moment, but still my personal guess is: 11.2 will pass without it being in mainline).

Some distributions have no problem with using large kernel patches, but for openSUSE it became more and more of a problem. Every kernel update broke it and the way aufs works is not easy to adopt to kernel changes – which is the reason the aufs author is pushing into mainline. Let’s wish him luck.

So I looked around and tried unionfs-fuse and deltafs. Both are fuse file systems avoiding the need of large kernel patches to create a compressed read write file system. Both had their issues, deltafs is just a prototype at the moment and unionfs-fuse is still pretty young too (unionfs-fuse fixed most of my issues meanwhile, so possibly it will come back to me 🙂

Then I looked closer at what Fedora(10) does: they do it completely different than most distributions I checked so far. They use a huge ext3 file system with their read only content, compress it in squashfs and then use a device-mapper snapshot on top of it to make it read write into a device-mapper copy-on-write file. Very interesting, in theory very slow – not slower than 11.1 in practise. So kiwi supports that mode since v3.29 (called “dmsquash”). But as the 11.2 kernel OOPSed with such loopback mounted file systems (fixed meanwhile) I kept on looking for alternatives. And as unionfs-fuse was so close and has also support for cow, I thought if I can’t do my own fuse filesystem that combines the best of all. Actually I thought out loud while eating doener with Michael and Jan and so I hacked doenerfs as prototype in just an afternoon.

The idea is very simple: Instead of using device-mapper with squashfs snapshot and copy-on-write file I put the ext3 file system in another file system just made to compress it: doenerfs. That filesystem uses xz libraries. So you can mount the compressed image and then mount the ext3 file system loop and get a read write file system. Of course it comes with a catch: the writes don’t go anywhere but in the memory of the fuse driver. The more you write, the bigger the process gets. But in the end it doesn’t matter what uses your RAM, tmpfs or fuse mounts.

Meanwhile I extended the code quite a bit in adding some possibly unique features and renamed it to clicfs: Compressed Loop Image Container. The 11.2 Milestone 1’s Live CDs use it’s first version.

As the file system is explicitly made to compress another file system, I only need to support one file with a fixed name and with a known size and all that – a lot of complexity of other file systems is gone. So I could spend most time developing the interesting parts 😉

The fuse driver has only 3 options and each of them marks a feature:

  • -m adds sparse blocks at the end of file. The actual ext3 file system has 0 blocks free, the sparse blocks are appended during boot of the livecd. After that the live cd will resize the file system to match the gained room. And only blocks actually written to will end up in memory. Sparse blocks are only marked as not yet existent. Current live cds hard code 470MB, but it’s just some /proc/meminfo left to do and then it will have free space depending on RAM amount. So far the free space was limited by either what the ext3 image left free (fedora) or how much is in the tmpfs (aufs solution)
  • -l logfile will create a log file with the access pattern. You can pass this log to mkclicfs to group the ext3 blocks in order in the compressed image. I use this while building the livecds to avoid seeks on the CD.
  • -c cowfile puts the blocks that are written to in an extra file instead of RAM. This makes it possible to store them on an usb stick and load them at later boots. This is the newest and least tested feature.

The sources are at git.opensuse.org.