I had an interesting discussion with “bonnyrsa” in #ubuntu-za today. He’d re-arranged his partitions with gparted, and copied and pasted his / partition, so that he could move it to the end of the disk.
However this meant that he now had two partitions with the same UUID. While you can imagine that this is the correct result of a copy & paste operation, it now means that your universally unique ID is totally non-unique. Not in your PC, and no even on it’s home drive.
Ubuntu mounts by UUID, so now how do we know which partition is being mounted?
However neither were correct.
Mounting /dev/sda4 (ro) produced “/dev/sda4 already mounted or /mnt busy”.
Aha, so we must be running from /dev/sda4.
/dev/sda2 mounted fine, but then wouldn’t unmount: “it seems /dev/sda2 is mounted multiple times”.
Aaaargh!
I got him to reboot, change /dev/sda2s UUID, and reboot again (sucks). Then everything was better.
This shouldn’t have happened. Non-unique UUIDs is a really crap situation to be in. It brings out bugs in all sorts of unexpected places. I think parted should (by default) change the UUID of a copied partition (although if you are copying an entire disk, it shouldn’t).
I’ve filed a bug on Launchpad, let’s see if anyone bites.
PS: All UUIDs in this post have been changed to protect the identity of innocent Ubuntu systems (who aren’t expecting a sudden attack of non-uniqueness).
The CS Department at UCT has some Wireless APs on Channel 13. This is quite cool (for geeky reasons), but my MacBook (purchased in the US) did not agree. As far as it is concerned, the only 802.11g channels in existence are 1-11.
The reason for this is that my Atheros (madwifi) network card is a software-defined radio. Atheros interprets the FCC regulations to mean that it cannot provide an Open Source driver for this card, allowing it broadcast on any random channel. Thus the madwifi driver contains a binary HAL, produced by Atheros, which is responsible for regulating frequencies and power levels. (This HAL has been reverse-engineered by the OpenBSD people, but not for my card, unfortunately).
The card has two values stored in it’s EEPROM, a “countrycode”, and a “regdomain”. The countrycode is overrideable in software (you modprobe ath_pci countrycode=710), but only if the countrycode you specify is valid for the card’s regdomain. Some cards have a 0x00 or 0xFF regdomain (wildcard values), but mine had 0x64. This meant that whenever I tried to specify a country code, I’d get an error, and the madwifi module would refuse to load:
Feb 11 11:34:11 beethoven kernel: [ 2047.669023] MadWifi: ath_getchannels: Unable to collect channel list from HAL; regdomain likely 100 country code 710
There has been some success with changing the regdomain in the EEPROM, using the hard-to-find ar5k utility (or possible the ath_info utility?). However, again this didn’t work with my model. But I found an e-mail from somebody who’d been playing with similar stuff. I mailed Salvatore, and he replied almost instantly, pointing me to a public Windows utility for changing regdomains. It depends on a special driver, available in the demo of “CommView for Wireless”.
I installed Windows in my swap partition (it’s not an operating system I normally have around). (Naturally, I forgot to have an Ubuntu CD handy, to rebuild my grub, but that was easily remedied.). After a few blue screens of death (install all necessary drivers first), I got my regdomain changed to 0x37, which is the regdomain for South Africa & Europe.
Now, I’m writing this from a couch in the CS department, using a channel 13 AP. Success.
Even before school, my future interests were clear: I tied-up the house with wires and made “electrical gadgets” out of old electrical junk. I remember being given my first battery, light bulbs, and wires. From there it was downhill.
My first computer was a [HP 9816][]. It was a year older than me, had a 6800 Processor, 128k RAM, and an (external) pair of single sided 3.5” floppy drives.
It had a ROM BASIC board, and a set of [VisiCalc][] floppies (with manual shutters), so I spent my time
Quick post. If you have multiple IP addresses (i.e. a range) assigned to you server, and you want to listen on all of them (i.e. multiple SSL sites), then rather than using the ancient eth0:1 syntax, you can hack /etc/network/interfaces to use iproute2 properly.
Assuming the IP 10.2.3.4, with the extra range of 10.5.4.110-10.5.4.118 (yes these extra ranges often ignore class-boundries):
auto eth0
iface eth0 inet static
address 10.2.3.4
netmask 255.255.255.0
network 10.2.3.0
broadcast 10.2.3.255
gateway 10.2.3.1
# Extra IPs:
post-up for last in `seq 110 118`; do ip addr add 10.5.4.$last/32 dev $IFACE; done || true
pre-down for ip in `ip addr show dev $IFACE | sed -n 's@.* inet \([0-9.]*/32\) .*@\1@ p'`; do ip addr del $ip dev $IFACE; done || true
Yes, it’s ugly as shit, but I can’t think of a neater way to do it
This might sound like a silly topic, but it’s infuriating.
It’s only very recently (since July) that I’ve adopted the Ctrl-Alt-Arrow Virtual Desktop bindings. Call me an old todger, but up until now, I’ve always remapped Alt-F1 through Alt-F6 as my Virtual Desktop keys. That’s how I always switched desktop, and I couldn’t bring myself to change to the Ctrl-Alt style.
I try to slowly align myself with the new defaults, so that I have to do less customisation to feel comfortable when I sit down at a box. With the MacBook which infuriatingly requires Fn+ for the F-keys, I thought I’d switch. It took a bit of re-training to switch, and now I’m comfortable. But, every now an then, I accidentally press Ctrl-Alt-Backspace and kill X. This combination is supposed to be highly unlikely to be accidental, and used to be. But with the default gnome bindings, it’s quite common. You just finish editing some text, and switch desktop, to find that your right hand hadn’t fully released the backspace key before the Ctrl+Alt went down.
I think either the X kill key needs to be changed, or we have to get rid of this silly gnome desktop-switching binding.
OTOH, I’m almost entirely in line with the modern GNOME defaults. On a foreign machine, I need to set up Dvorak keyboard, change the terminal to grey-on-black, and I’m pretty much ready to go. (My .ssh/config is also nice to have, as are my firefox quick links)
Launchpad bug 59695 has been gathering a huge amount of activity since I wrote about this issue. The issue seems to be that the hardware manufacturers (BIOS and HDD firmware) set very aggressive values for power management. And every other OS (Windows & Mac OSX) override these values to something more sane. The manufacturers only test their equipment in Windows, so they don’t see any problems :-)
This kind of thing seems to happen to Linux quite regularly - we all remember the ACPI debacle caused by manufacturers using Microsoft’s broken ASL compiler, which worked in Microsoft’s broken ACPI environment (or was overridden with driver updates).
So in my opinion, Ubuntu (and every other distributor) has to step in and override these aggressive settings. And, by the look of the bug report, Gnome Power Manager should provide the user with a slider to set the balance between power savings and hardware lifetime.
There is already the obligatory ubuntu is killing your Hard Drive blog, and a closed for cooling off Ubuntu forums thread, if you want get involved and start swinging your battle-axe.
Oh, and the workaround I posted last week obviously doesn’t cover the case of the machine resuming from suspend. You have to use an ACPI event script for that.
I’ve just come across a rather scary, and worryingly old launchpad bug, which talks about real hardware damage. There is more on the problem here. But basically, by default, Linux is far too optimistic with spinning laptop hard drives down, and you can reach number of spin-up/downs that your drive is rated for over it’s entire life-time, in a few months.
My laptop (3 months old), is already at 160000 Load/Unloads: Around half it’s rated life.
The easy solution is
# hdparm -B 180 /dev/sda
Or, the following in /etc/hdparm.conf
/dev/sda {
apm = 180
}
Lets hope that this gets resolved soon, or the problem isn’t as bad as it appears.
I see that Matthew Garrett (the Ubuntu Laptop Tzar) is subscribed to this bug, but doesn’t seem to have commented on it. I find that a little odd, considering its seriousness.
I was lucky enough to win a Nokia N800 at LugRadio Live 2007, because I’d come from South Africa. I’ve had it for 3 months now, and the successor was announced last week, so I think it’s time to blog about it, properly.

The hardware is pretty decent. The screen is very bright and vivid (great for photos), and just big enough to read websites comfortably. There are enough buttons to fulfil the basic tasks without reaching for the stylus, but you generally work it with the stylus (or a finger). It has quite a few hardware features:
The battery life is comperable to my cellphone (about a week of non-use, or a day or two of use), and I’m happy with most of the hardware, but I do have a few issues:
The power button isn’t sufficiently recessed for it’s soft carrying case. This means that I can’t carry it off in my bag, it’ll turn itself on eventually, and run it’s battery flat from spurious touch-screen clicks. The solution is to always leave it on, and screen-locked (it supports an auto-lock). For a cellphone manufacturer, I’d have thought they’d get this right.
The webcam’s position at the far left means it gets a good view of the left side of your face. This can be a little disconcerting.
The USB port is (without some serious hackery) only in peripheral mode. I’d really like to be able to plug a USB keyboard into this device (bluetooth keyboards are way too expensive).
There’s a bottleneck in the system (processor presumably), that stops it playing youtube videos at full framerate. Mplayer seems to just be able to handle QVGA video at 24fps, but nothing more.
# cat /proc/cpuinfo
Processor : Some Random V6 Processor rev 2 (v6l)
BogoMIPS : 320.37
Features : swp half thumb fastmult vfp edsp java
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant : 0x0
CPU part : 0xb36
CPU revision : 2
Cache type : write-back
Cache clean : cp15 c7 ops
Cache lockdown : format C
Cache format : Harvard
I size : 32768
I assoc : 4
I line length : 32
I sets : 256
D size : 32768
D assoc : 4
D line length : 32
D sets : 256
Hardware : Nokia N800
Revision : 24202524
Serial : 0000000000000000
The software stack of the N800 is everything I could desire. It runs a Debian derivative of Linux, Maemo. Maemo uses proper Debian package management, the GTK widget set (with addons), Telepathy for IM, and Gstreamer for media. This makes it a doddle to port existing X applications to the N800.
When you first turn on the N800, after unboxing (or reflashing), you go through an install wizard. It sets the hostname, timezone, and pairs with your bluetooth cellphone. The bluetooth phone pairing is well thought out, and beats anything I’ve ever come across on any platform. Unfortunately it suffers from the same problem as Windows - it doesn’t set your Home Town, etc. based on the time-zone.
The default web browser is Opera-based, but a Gecko engine is available, and a WebKit one remoured to be on the way. It has a (proprietary) flash plugin, so you can watch YouTube, and the CACert.org root certificate is pre-installed :-)
The device has 4 input modes:
I find the input fine, although slow, for everything except passwords. Multi-case, symbol-laden passwords really bring out the worst of all the input systems.
The default software selection is passable, but not great. The device really ships with “internet tablet” software, with a few decent games thrown in. The major problems are the media player doesn’t play oggs or video, and the e-Mail program’s IMAP support, which is a joke, at best (It uses IMAP as if it was POP).
But I enabled a few extra repositories and soon my N800 became a really cool device:
My repositories:
http://catalogue.tableteer.nokia.com/certified/ bora user
http://catalogue.tableteer.nokia.com/non-certified/ bora user
http://repository.maemo.org/ bora free non-free
http://repository.maemo.org/extras/ bora free non-free
http://www.claws-mail.org/maemo/ bora user
http://maemo-hackers.org/apt bora main
It’s a cool device for a geek to own, no doubt, but what’s the actual point of it?
I can answer that in a few ways:
But in the end, all that matters is that it runs Linux , and has Python dammit, so it’s a piece of cake to write any software for it that I want to. I think that reason on it’s own makes it a device worth owning.
I’ve just implemented shared mailboxes in dovecot (which rocks, btw). It isn’t difficult, but I don’t think it’s very well documented…
The preferred way to do this is with IMAP Namespaces. My natural approach would be to create something like a Maildir tree /srv/mail/shared, and make this the “public” namespace. Then set filesystem permissions on subtrees of that, to define who can see what. Unfortunately, dovecot uses strict Maildir++, and won’t let you create mailboxes inside each other (on the filesystem) /Foo/Bar is stored as a Maildir called .Foo.Bar, so subtrees don’t exist, so this isn’t an option. The up-comming dbox format should allow something like this, but it isn’t usable yet.
My solution was to create multiple namespaces. One for each shared mailbox. Users are given permission to use them via file-system permissions (i.e. group membership), example:
# Default namespace, needed if you add namespaces
namespace private {
prefix =
separator = /
index = yes
}
# Office inbox, available to receptionists, office managers, and directors:
namespace public {
prefix = office/
separator = /
location = maildir:/srv/mail/office/.Maildir:CONTROL=~/.Maildir/control/office:INDEX=~/.Maildir/index/office
hidden = no
}
# Umask for shared folders
umask = 0007
Setting CONTROL and INDEX mean that dovecot’s metadata is stored in the user’s personal Maildir, so users who don’t have permission to see the shared mailbox don’t get errors.
The permissions of the mailbox should be done as follows:
# touch /srv/mail/office/dovecot-shared
# chown -R mail.office-mailbox /srv/mail/office
# find /srv/mail/office -type d -print0 | xargs -0 chmod 2770
# find /srv/mail/office -type f -print0 | xargs -0 chmod 660
If you want a common subscription list, you have to manually symlink:
ln -s /srv/mail/office/subscriptions ~luser/.Maildir/control/office/
Seems to work well. (at least with thunderbird)
Finally, it’s got easy to install the codecs we can legally use in this country:
Medibuntu now has a non-free-codecs package, an all-in-one virtual package.
Nice job!
Personally, I’m still in favour having them there by default, and the installer removes them if you select a patent-encumbered country as your time-zone, but I can see why people are wary of that approach….