Feb 1 2010

Swap-o-Rama (¡UUID Es Me Llamo!)

(Just for the sake of remembering my own damn self — and maybe helping someone else.)

Earlier, I attempted to hibernate my desktop. Never done it in the 15 months I’ve had Ubuntu 8.04 LTS on here, so I figured “Hell, why not?” I hit the dropdown, and the system commenced its hibernating shutdown action. But it neither shut off nor came back to life. I ssh’d into it to discover via the system logfile that the hibernate was halfway through its operations when the power daemon discovered “Oh Hell! There’s no resume device on this machine!” at which point it ceased and attempted to raise the machine from the dead.

After manually power-cycling the system, I did some digging. Turns out the UUID of the swap/resume partition had been changed somewhere along the way, so both /etc/fstab and /etc/initramfs-tools/conf.d/resume were stuck with the old UUID from way back when the system was installed. That UUID no longer exists.

I’m not sure what caused it to change; such an idea is disturbing, considering this is supposed to be the super-stable, LTS build of Ubuntu. The UUID of the swap partition is usually set with the mkswap -U command, and can be set on an ext2/ext3 partition with the tune2fs command. But anything can go wrong.

So. How to make fix? A quick check with sudo blkid will list the block devices on the system:

oldman@Deskie:~$ sudo blkid
/dev/sda1: UUID="c97b2e80-a5b2-4371-a60e-126a8d1402a5" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="f3a3cd16-f0c8-40a1-8a7d-578c57296c6b"
/dev/sda6: UUID="775a56e3-0244-453f-8d8a-fd1eb42a82f6" /
SEC_TYPE="ext2" TYPE="ext3"

The swap partition has the UUID f3a3cd16-f0c8-40a1-8a7d-578c57296c6b and is the device /dev/sda5. Copy and paste the UUID into the fstab and resume config files to replace the UUID that was there. Execute sudo swapon -a to mount your swap partition, and you should be golden. Verify with free -m to check for a nonzero swap size.

oldman@Deskie:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          3962       1784       2178          0        154        660
-/+ buffers/cache:        969       2993
Swap:        11601          0      11601

The value 11601 tells me I’m gettin’ my swap on. Aw yeah.


Jan 17 2010

Ubuntu Have No Idea How Debian I Am On Freshness

I spent some time Saturday night nerding out by upgrading my laptop’s OS from Ubuntu 9.04 to Debian Testing (Squeeze).

I say “upgrade” because moving to Debian is a major step up from Ubuntu. Canonical, Inc., the company that publishes Ubuntu, essentially takes a snapshot of the entire Debian project and all its software packages and over the span of a few months sorts out which packages are worthy of going into the next Ubuntu release, and which ones are too incomplete to make the cut. Meaning that by the time a Ubuntu version is released, the software within, especially from the active projects, is at least a few months old.

If you’re one of those late adopters, like me, by the time the dust settles after a release and you finally decide to install the new version, you could easily be trying to tolerate software that’s over a year old. And if you’re using one of the LTS (Long Term Support) versions, like I am on my desktop, then you’re looking at 2 years with no functionality improvements; nothing but security updates. That’s unacceptable.

The straw that broke the camel’s back is the crappy bluetooth stack that was packaged with Ubuntu 9.04. They froze the BlueZ package during a time when the project was undergoing a major push in improvement, so the version that got frozen was largely incomplete and had gaping holes in its functionality and stability. Again, this was largely unacceptable, because the best versions were posted, available for installation, right on the project’s website and was available as a package on Debian Testing, but nowhere to be found on Ubuntu.

See, I come from the Windows world, which to me means I can grab any piece of software, no matter how fresh or stale, and install it for use at any time. I’m used to that paradigm. But that kind of capability isn’t part of the Ubuntu/Debian package management ethos, and it sticks in my craw. Case in point, my desktop system is saddled with Firefox version 3.0.16 — the latest is 3.5. All I’ve gotten for the past 2 years is security updates. On any other OS, I could be rocking with the latest version’s bells and whistles. But not Ubuntu. This is weak sauce.

Hopefully sticking with the Testing branch of Debian will help me get the freshest packages; once any project publishes a new version with bugfixes and functionality improvements, Debian picks it up, does some essential testing during the Unstable phase, and then pushes it upstream to Testing. Following this track means taking some measured risk; in trying to keep up with the newest stuff, breaking something fundamental to the system’s function is a possibility (incompatible libraries being the biggest risk). It also means more frequent updates are required to stay current. But, right now, I feel it’s a worthwhile gamble.

Ubuntu’s coup de grâce is that they take the bother of finding the right drivers for most hardware and package them into their distribution media so most computer systems function right out of the box. This is their strength. They also take the hassle of putting together a cohesively-matched set of packages that work well together with hardly any configuration necessary. A beginner can throw Ubuntu on a box and within the evening be doing their thing with almost no effort. That’s commendable. Contrast that with the driver confusion I experienced (video and wireless drivers weren’t loaded so automatically), and you can understand why people who say “Yeah, I need to learn Linux” try Ubuntu first.

But I’ve already taken that class. Now it’s time for my bluetooth mouse and I to graduate.