ubuntu

Just what is Universally Unique

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?

  • “mount” said /dev/sda2
  • /proc/mounts said /dev/disk/by-uuid/c087bad7-5021-4f65-bb97-e0d3ea9d01a6 which was a symlink to /dev/sda2.

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 Journey to being a Linux Geek

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.

The first PC:

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

That was *camp

I’m now sitting in Arniston, on a horribly slow GPRS connection, after *camp, which was this weekend, at AIMS. It was a BarCamp-like “unconference”, organised by the geekdinner crowd. I put off having the weekend at Arniston for *camp, and for me, I think that was worth it.

The event was really good. I haven’t been very involved in the organising, and didn’t come prepared with a talk (just equipment). At the start, it felt like there were never going to be enough talks to keep us going, but as soon as it started, it began rolling, and continued for 2 days. The talks were varied, from technical, to psychological, to practical. I was really impressed. The quality of the talks was quite high - I was rarely bored (although I did have IRC distractions).

As usual, I had Jonathan Carter’s camera, and videoed everything. I’m going to go home to around 8 hours of video that needs editing, synchronizing, encoding, and uploading to archive.org. It’ll take a while, guys, be patient.

Today, I got involved with setting up the lab for practical demos. We had 9 PCs lent, and needed Ubuntu on them. Of course, the natural approach is netinstall - I’m familiar with netinstalling Ubuntu, and it is a great way to set up a pile of computers. However, we ran into problem after problem.

  1. We were using dnsmasq (on my laptop) for DHCP and TFTP, but it wasn’t the router. So I set the router DHCP option. This seemed to break dnsmasq - PCs stopped accepting leases and DHCPDECLINED them. I’ve never seen that before. So I had to route through my laptop - no biggie.
  2. AIMS is behind a 400kbps connection, and while thy have an apt-cacher, it seemed badly seeded, and it looked like it was going to take us hours to install, so I went to my car and collected a set of Ubuntu archive DVDs that I happened to have on hand, and loaded them via a cluster of laptops and rsync ;-)
  3. Of course those DVDs didn’t have udebs on them (the debian-installer bits and pieces), so I had to quickly write a script to download all the udebs, and their necessary support structure.
  4. Now the machines netboot installed really fast, but at the very end of the install, it failed, due to some package signature problem.
  5. I ran debmirror, to ensure that my mirror was up to date, and it was. I ran the md5 sum checks, and they passed. I have no idea what the problem was.
  6. Eventually, the lab was installed with 3 install CDs, and then clubbed into shape with clusterssh. 5hrs or so after starting - what a waste of time, we should have started with CDs…

So, lesson for next time, test your netboot setup in advance, don’t assume that a mirror will be in working shape. We should have set up the lab on day one, for use on day 2.

The upshot of this is that I didn’t see any talks today (excepting a practical in the lab, on scribus, once it was up). I’ll have to watch the videos later.

Now, I’m going to enjoy a few days in Arniston, and then come home to graduate.

Multiple IP addresses on Debian

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

Gnome virtual desktop bindings

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)

Ubuntu Releases

Is it just me, or is the Ubuntu development tree more stable than the releases?

I don’t know if I’ve just had bad luck, but the few Ubuntu releases have seen me abandon the stable release, almost straight away in search of some stability in the development tree. I remember Breezy being a stable release. Dapper was quite good, too - well polished. However, edgy was (as people said at the time), a little edgy, and for me it went down from there…

My first foray into Ubuntu development was from edgy to feisty. My laptop (Acer Ferrari 4005) was horribly unstable - a new, young chipset. Also, the tifm SD card reader wasn’t supported. I found feisty development to be quite stable and I pushed The Shuttleworth Lab into running it too, as a work-around for a nasty NFS bug which wasn’t going to ever be fixed.

Feisty development was fun. There was one update when mkinitrd broke, and the systems was completely unbootable (I still have a “rescue” monolithic kernel hanging around from that incident). But otherwise, it was pretty much like life on Debian testing: stable enough.

With the feisty release, prism54 broke, so my Ferrari headed for gutsy, straight away. (My secondary WiFi card is a prism54, the Ferrari wifi is broadcom)

Then I bought a new laptop, a mid-2007 Macbook - a carefully considered machine that should mostly contain well-supported hardware (Intel everywhere and Atheros wifi). Feisty was totally unstable on it, and I had to dive into Gutsy development again. Even gutsy didn’t support my wireless, which is only supported in the bleeding-edge madwifi trunk. No effort has been made to bring this driver into Ubuntu, as far as I know.

Now, I find myself wanting to get away from gutsy as fast as possible, because of a string of bugs. When a distribution is still in development, bugs get fixed, but as soon as it released there is too much red tape involved, and more to the point, the developers aren’t personally impacted by the bugs. Gutsy development has been a treat - pretty stable and reliable, and things worked.

Now almost simultaneously with the release, a pair string of bugs appeared that break my Suspend/Resume:

Am I destined to always run the development version?

People ask me if Ubuntu works. I say yes, it works almost perfectly on most machines. But in the back of my mind, I’m thinking well - it does during the development cycle, but as it approaches releases, bugs creep in.

Of course this rant could be explained away in a couple of ways. I came to Ubuntu from Debian (which I still use), so I’m a CLI user, who started with the expectation that any laptop-ish support is better than nothing. My expectations have since risen to the point where everything should just work out of the box on a 6-month old machine. And a brand-new machine, should at least mostly work.

The Ubuntu release cycle coincides very badly with my academic schedule. Releases occur during term time, during the peak project hand-ins and tests month. So while I’m quite active in launchpad-crawling during development, as releases approach and the updates reach a fever-pitch, I’ve got less and less time to test them. This doesn’t lead to particularly merry releases for me.

Maybe I should follow Adrian Frith’s (rather ephemeral) lead, and switch to running Debian on my laptop. It might make a grumpy geek happier :-)

An update on Laptop Hard Drives & Linux

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.

A serious warning to Linux Laptop users

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.

And I thought our Ubuntu mirroring was a success

Due to archive.ubuntu.com’s saturated links atm, I switched to using mirror.ac.za as our upstream, but forgot to take their different URL scheme into account. We don’t use rsync’s —max-delete option on debian mirrors, so voom, our entire ubuntu archive mirror vanished. I’m resyncing it UWC, who we have a 10Mbps wireless link to…

Disk Usage Graph

Congratulations on Ubuntu 7.10

Congratulations to the Ubuntu team, on a successful gutsy release. While gutsy is currently a little buggy for me, the millions of eyes will hopefully find all the bugs responsible… (and I must get around to filing the relevant launchpad bugs)

I run a teeny weeny little mirror (by International standards, for South Africa, it’s OK), so I’ve followed the release process, and been hanging out on #ubuntu-mirrors since last night. Preparing an Ubuntu release is quite an undertaking. In total, each mirror needs to carry around 20-30 CD images, and 4 DVD images. That’s reasonable chunk of data, and it takes a lot of coordination for everybody to get it.

I see many distros release, we normally pick them up automatically, and notice their presence the next day. But there’s definitely something special about Ubuntu releases. They have the feel of a release. The tension builds up the night before, and the #ubuntu-release-party channel fills up (when I popped in, around 500 people). Then, a few hours before the release is announced, people start noticing that it’s on the mirrors. Pointing this out on the release-party channel is not allowed (it would disturb the otherwise rowdy party of 500 users pressing F5 every 10 seconds), but pretty quickly, before the release is even announced, all the mirrors that carry Ubuntu CDs get flat-lined. If they don’t, then it’s a sign that their hardware isn’t up to scratch, and they have to find & fix their bottlenecks. On the #ubuntu-mirrors channel, you can see sysadmins from around the world showing off graphs of flat-lined, multi-gigabit links and sharing server tuning tips. If you want any experience in widely-distributing large files, run an ubuntu mirror at release-time, you’ll gain the experience fast.

I don’t know if this massive assault means Ubuntu is the most popular distribution out there. Most Ubuntu users don’t need the new ISO. They rather need click the big “upgrade” button, and hammer their local mirror to the tune of about a gigabyte. Ubuntu is based on Debian’s awesome package management system, that (if used correctly) should never require a re-install. There are Debian systems out there that were installed once, back in the 90s, and have been upgraded (both distro versions and hardware) continuously since then. Do people not know that, or do they want the thrill of booting up with the new Gutsy CD? Debian is widely considered to be the most popular distribution, and a Debian release hardly raises eyebrows (other than somebody saying “Debian released? Has hell frozen over?”, and scheduling an upgrade for some time in the next 6 months). If nothing else, this shows how different distributions’ user-base can be, while being technically very similar.

I’ve done my bit to help out the Ubuntu release:

  • I’ve been running Gutsy since it’s fork, and filed god only knows how many bugs on launchpad.
  • I’ve created my unofficial package DVDs, for people without Internet connections.
  • My mirror & toaster had the CD images in advance, and we’ll have the DVDs by tomorrow morning.
  • I’ve got a UK server with a 100Mbps link seeding Ubuntu DVD torrents. I was the sole seed for many hours, and have uploaded over 200GB, so at least I did some good ;-)

Now, as the release traffic dies down again (i.e. heavy but not quite flat-lining), I hope the sysadmins and release-party-goers sleep well, you all deserve it.

Syndicate content