Ubuntu 11.04 Beta 1

08 Apr 2011 21:05

Let's talk about Ubuntu 11.04 Beta 1. Honestly I don't think it really should be beta already. It just doesn't work for me. I think the only reason the "release" is called beta is that it's April already and the stable version of the system should be delivered to the end of it to justify the 11.04 name/version.

Let's start from the beginning. I'm having a Sony Vaio laptop with dual graphics system. During boot I can switch if nVidia or Intel graphics card is used. While on nVidia card, I didn't encounter any problems but the thing in "Extra Drivers" no nVidia card was detected. I'm not sure, maybe this "automatic" 3rd party driver installation is only activated after a real install.

I really wanted to see the new Ubuntu interface, so I switched to Intel graphics card and rebooted the machine. After a while I was able to "Try Ubuntu", I started the Firefox and then I noticed I don't have a network connection configured, so I clicked the network manager icon, chose my wifi network and tried to enter the password, but this caused compiz to close unexpectedly. Multiple times. After I managed to click "cancel" button the window decorations were gone and keyboard focus was not passed to clicked field, which made my system unusable. The standard shortcut to run command in Ubuntu: Alt-F2 didn't work either.

This was a pretty short test, but not passed at all. Ubuntu 11.04 doesn't deserve beta status, there are stability issues. For example trying to suspend the laptop in nVidia mode (without any commercial drivers) froze it instead so i had to reboot :-(.

Comments: 0

Sony Vaio VGN-SZ640 Ubuntu Maverick

04 Nov 2010 20:21

Recently I updated the Ubuntu I'm using on my laptop to version 10.10 (codename Maverick).

Although things work pretty good, I had to do some tricks to make it work in specific areas.

Broken suspend

It seems tpm* modules (who knows what they are for?) break this. Putting file like this:

# With these modules loaded suspend doesn't work
blacklist tpm
blacklist tpm_bios
blacklist tpm_tis
blacklist tpm_infineon

to /etc/modprobe.d/blacklist-tpm.conf (and rebooting) solves the problem for me.

Brightness buttons not working

Run this code in terminal:

while true; do
    line=`acpi_listen | head -n 1`;
    if echo "$line" | grep 'sony/hotkey SPIC 00000001 00000010'; then
        xbacklight -dec 25 -time 0 -steps 1
        smartdimmer -d
    if echo "$line" | grep 'sony/hotkey SPIC 00000001 00000011'; then
        xbacklight -inc 25 -time 0 -steps 1
        smartdimmer -i

You need to have smartdimmer and xbacklight package. The keys kind of work now (but quite lamely).

Other stuff

The Ubuntu font is great. I love it. It seems nouveaux driver (for nVidia card) is really good. It supports multi-monitor configuration via xrandr and other standard stuff. Unfortunately you won't get 3D effects (Compiz) with it and you'll need to install nVidia commercial drivers for it.

Consult Sony Vaio SZ Series And Linux for more (mostly old) information.

Comments: 0

Playing Unreal Tournament On Ubuntu Lucid

17 May 2010 07:16

I wanted to play Unreal Tournament on Ubuntu 10.04 (Lucid Lynx) 64-bit. Linux is theoretically supported by Unreal Tournament, by using custom installer. So this is how to do it:

Get Unreal Tournament

The most likely version to obtain is UT GOTY (Game Of The Year edition).

Get Installer

Go here:


There are two installers. Download both using BitTorrent client. For me the one witout "goty" worked.

Run installer like this:

sudo bash /path/to/unreal.tournament_436-multilanguage.run

Probably it won't run, because you don't have GTK 1.2. Bad news, GTK 1.2 isn't even available in system repository. The last Ubuntu version that shipped GTK 1.2 was Ubuntu Jaunty. My favorite trick to get packages from older distros is as follows:

sudo sed s/lucid/jaunty/g /etc/apt/sources.list -i
sudo aptitude update
sudo aptitude install -y libgtk1.2
sudo sed s/jaunty/lucid/g /etc/apt/sources.list -i
sudo aptitude update

Try to run the installer, it should work now.

Default options are generally OK, so you can keep them. Once "enter CD" dialog appears, you need to either enter the CD or mount the ISO image using the following command:

sudo mount /path/to/the/iso-file.iso /media/cdrom

Click OK, and the installer continues to run. If you're asked to enter CD2 and you don't have one, try the second installer (the one without "goty") from loki site.

Running UT

I had no luck in running UT:

quake@vaio ~ $ ut
Signal: SIGIOT [iot trap]

From this thread I've learned it could be solved by doing this:

cd /usr/local/games/ut/System
for i in ../Maps/*.uz ; do sudo ./ucc-bin decompress $i ; done
mv *.unr ../Maps

After doing this, you should be able, to run ut successfully.

Changing resolution

I was not able to change resolution (once I changed it, it was going back to 640x480 after a few seconds). Open file ~/.loki/ut/System/UnrealTournament.ini, locate "640" and "480" in it and change to desired resolution.

High speed

When I run UT it seemed going about 5 times faster than it should. After reading much about -cpuspeed option and playing with CPU downclocking I figured out that without sound it runs OK. After some experimenting it seems, that it's pulseaudio is causing it, once I killed it and prevented to run (it auto-respawns for some reason) UT finally worked at good speed.

sudo chmod -x /usr/bin/pulseaudio
killall pulseaudio

The problem with this is that some process continuously tries to run pulseaudio, which causes CPU to be loaded and ut to run not smoothly.

So this should work:

sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.original
echo -e '#!/bin/bash\nsleep 10000' | sudo tee /usr/bin/pulseaudio
sudo chmod +x /usr/bin/pulseaudio
killall pulseaudio

Remember to do this after playing ut:

sudo mv /usr/bin/pulseaudio.original /usr/bin/pulseaudio

If you have some problems with sound after playing UT, log out and in again, and it should be OK.

NOTE: this trick should be equivalent to running pasuspender ut, but for some reason it does not work.

More tricks

When playing on LAN party we discovered more tricks:

To let UT correctly determine CPU speed, you need to set CPU frequency (using some applet or cpufrequtils) and disable additional cores (leaving one):

echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu2/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu3/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu4/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu5/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu6/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu7/online

(if you have 8 cores, cpu0 will be online, the rest offline).

Next trick is disabling desktop effects or window composing. For one person this meant much smoother graphics, for other it meant working sound (which is very weird, but yes, that's true).

UPDATE: Maverick Audio

It seems that on maverick the pulseaudio hack is not working, but here's what you can do instead:

  • edit /usr/local/bin/ut (may be located somewhere else, find when you installed the game)
  • find this line: ./$GAME_BINARY "$CMD_ARGS" "$@"
  • replace with: padsp ./$GAME_BINARY "$CMD_ARGS" "$@"
  • (make sure you have the padsp binary, just run try to run it)
  • then just run ut and sound works :-)

UPDATE: this works, but gives significant audio lags (200-300 ms!). This basically sucks. So the other workaround is:

  • having alsa-oss installed (program aoss)
  • having a proper .asoundrc in home directory:
ctl.!default {
  type hw
  card 0

pcm.dmixer  {             #this virtual device does the mixing of 
  type dmix               #the various signals
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 44100
  bindings {
    0 0
    1 1

pcm.!default {             #this means that applications use the mixer
  type plug                #by default, so you can hear everything
  slave.pcm "dmixer"
  • having 32 bit alsa-oss libs installed (getlibs -p alsa-oss)

You need /usr/lib32/libaoss.so. Once you have it backup /usr/lib/libaoss.so and link it to the 32 bit version: /usr/lib32/libaoss.so. Then edit the ut script like before but instead of padsp use aoss. This works for me. WARNING: this overrides all ALSA applications. If you want the default configuration (that routes the audio to pulseaudio), you'll need to change .asoundrc file name after playing UT.

Comments: 4

Home Directory Snapshots

25 Oct 2009 16:12

Your home directory is where the most important data is stored.

But from time to time you just simply rm -Rf ~ and your all precious data is totally out of luck. Backups you say, don't you?

So let's think how do you do backups. cp /home/quake /my/distant/location ? On my 24 GB home directory? It would take hours. cp /home/quake /home/backups/quake/date ? Better, this will take a few minutes, but wait, I have like 120 GB of disk space, which means I can have no more than 5 backups.

What to do with this? There are two posibilities. Either you minimize data to backup to only backup important data (but figuring out what data is important may take some time and be inappropriate) or move to smarter solution, like incremental backups. Or snapshots.

Having brtfs as the filesystem for my home directory, I chose to make a snapshot of it each hour. It takes between 0 and 1 second to complete and uses almost no disk space. Why? Btrfs is copy-on-write filesystems, which means cloning a filesystems is instant as it only makes it available under two locations. And then modifying one of the two makes a real copy of the modified fragment of it and changes that copy.

OK. How to do it.

First create a btrfs filesystem (you'll need a recent kernel and btrfs-utils):

# mkfs.btrfs /dev/sda7

(sda7 is partition for my /home directory)

Then mount it somewhere else than /home, let's use /vol as an example:

# mount /dev/sda7 /vol

Create some volumes on that filesystem: home, quake, snapshots:

# btrfsctl -S home /vol
# btrfsctl -S quake /vol
# btrfsctl -S snapshots /vol

The volumes are accessible as the subdirectories of /vol:

# ls -la /vol
drwx------  1 root  root     36 1970-01-01 01:00 .
drwxr-xr-x 24 root  root   4096 2009-10-25 15:04 ..
drwx------  1 root  root     20 2009-10-25 15:51 home
drwx------  1 root  root  11488 2009-10-25 16:17 quake
drwx------  1 root  root     76 2009-10-25 15:40 snapshots

But you can mount then separately:

# mount /dev/sda7 /home -o subvolume=home
# mkdir /home/quake
# mount /dev/sda7 /home/quake -o subvolume=quake

Fix permissions:

# chown quake:quake /home/quake /vol/quake /vol/snapshots
# chmod 0755 /home/ /home/quake

Now you're ready to do snapshots. Now populate the /home/quake directory:

$ mkdir /home/quake/abcd
$ mkdir /home/quake/dddd
$ mkdir /home/quake/abcd/eeee
$ echo testtest > /home/quake/testfile

Aaaaaand, make snapshots!

$ btrfs -s /vol/snapshots/quake-`date +%Y%m%d-%H%M` /vol/quake

I figured out, that it's quite important to point to /vol/quake and not /home/quake. At first it seams that it's totally the same, but on /home/quake there can be some other filesystems mounted (like .gvfs for GNOME virtual file systems) and /vol/quake contains "pure data". When doing snapshots of /home/quake with filesystems mounted under it, the filesystems freezes for me (btrfs is still experimental, they say). So as noted above, it's better to snapshot pure data directory.

Now, the /vol/snapshots/quake-20091025-1653 (or whatever your date is) and /vol/quake should list the same files and the operation of "cloning" should be just instant no matter how much data you have. But now modifying the contents of /vol/quake should not change anything in /vol/snapshots/quake-20091025-1653 (but of course should in /home/quake).

Also the snapshot doesn't really take any disk space as long as you keep the /vol/quake directory unchanged. Once you change some file from /vol/quake, it needs to really keep two copies of it, so this is when additional space is allocated.

To sum up let's have a table listing possibilities to have the same contents in two directories:

method file copy symbolic link hard link bind-mount btrfs' clone
how cp -a dir1 dir2 ln -s dir1 dir2 ln dir1 dir2 mount -o bind dir1 dir2 btrfs-bcp dir1 dir2
time long instant instant instant instant
takes disk space yes no no no no (only the difference)
points to the same data
(changing file in dir1 changes it in dir2)
no yes yes yes no
notes not on Linux (Mac only?) btrfs-bcp not distributed in Ubuntu's btrfs-tools

More notes on btrfs and snapshotting:

  • What can be done with btrfs-bcp on directories level can be done with snapshots on volumes level (as described in this post)
  • Snapshots in btrfs are not removable yet. You can clear them and reclaim the space taken by saved difference from the starting point. Still a few bytes is taken by having the directory that is not removable. Deleting snapshots is to be implemented in stable version of btrfs.

Comments: 1

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License