Ubuntu’s UUID schizophrenia

Ubuntu Linux

Actually it was more like I was losing my mind, not my Ubuntu…

But let’s start from the beginning… I have two identical 250GB hard disks so I’ve decided to create a RAID array out of them. Not a system (bootable) one as I had too much trouble setting it up (I’ve set it up but dist-upgrade broke it all too nicely; kernel panic, etc.). I’ve set up a separate 5GB system partition on the first drive, leaving the rest for RAID. This left me with 5GB of free space to spare on the second drive. Smart as I was, I decided to clone the system partition from first drive to the second one, using dd, so I’d still be able to boot if either of the drives crashed. I called it semi-RAID built-by-hand and, well, I was quite proud of it. All seemed fine as months passed (and remember, that this was a server and as such almost did not require any reboots). But time passed and suddenly there was the new Ubuntu out, the Feisty one, so I decided it was time to upgrade. As I had some minor troubles during the upgrade (obsolete packages, invalid config files that I ordered to keep, etc.), I was rebooting every few minutes. And this is where fun comes in…

After a successful upgrade to 7.04 the screen greeted me with a 6.04 prompt. Hmm… strange. Let’s see what’s going on. Okey, so this upgrade actually did go so well. No problem, let’s do it again. This time I did not reboot, but kept making other changes. At some point I had to reboot, though. Now I was scratching my head really hard. Some packages, I knew I had uninstalled previously, kept coming back. I was making changes to various config files only to see those changes not being written to the disk after rebooting. Like, WTF? Now I was rebooting like crazy… losing my mind more with every reboot. I was making directories like THIS-IS-FIRST-HARD-DISK-FOR-SURE only to see them disappear and reappear a couple of reboots later. I was almost crying with despair. I’ve came up with the idea to compare /dev/sda1 with /dev/sdb1. Funny thing, they turned out to be the same. Who knew, maybe my RAID-by-hand automatically turned into a real one?

I had dark thoughts. I was thinking about giving up on having two identical hard disks inside one PC and maybe about downgrading to Edgy, not even knowing whether that was possible. I was even thinking about giving up on those two 250GB disks. I was really desperate. I knew, I needed a break.

10 minutes and one glass of cold water later I was on the mission to find out what is exactly wrong with my Ubuntu. Or my PC. Or my hard disks. Or the world around me.

It wasn’t easy. The df command reported my system being on /dev/sda1. Mounting /dev/sdb1 did not help as it has been showing me the same partition. But then came the bright idea to try and mount /dev/sda1, despite it being already mounted. To my surprise it turned out to be a completely another partition! The lost one! The one I missed so much. I was in heaven, so I started googling, because by that time I just knew it had something to do with those weird UUIDs. And I’d found out that I was not alone. I was so happy…

Now I know that my mistake was to make the exact clone of the system partition and have those two partitions (with the same UUIDs, yeah, unique ids my ass) available at the same time. No wonder my Ubuntu felt schizophrenic, but it still does not justify all of this weird behavior I was greeted with. Some error, some syslog entry, anything would be helpful… is that too much to ask?

What I was left with after I’ve figured it all out was this nice free disk space report (notice the double /dev/sda1 entry):

$ df
Filesystem  1K-blocks     Used  Available  Use% Monuted on
/dev/sda1     5162796  1650512    3250028   34% /
(..)
/dev/sda1     5162796  1558632    3341908   33% /mnt/disk-a

The root of the problem is that I base most of my core linux knowledge on the RedHat from the 90s when /dev/hda1 was saint and meant exactly what it represented, namely the first partition of the first hard disk (presumably connected using the first cable and set as master). With UUIDs all this has changed. Apparently for the better, but leaving some folks like me scratching their heads with disbelief.

Yes, Ubuntu is Linux for human beings. Apparently not for all…

PS: For future reference, remember to set the UUID after doing any partition duplication using dd. You do it like this:

tune2fs -U random /dev/sdb1

Late night capistrano

Excerpt from my current Capistrano cheat sheet:

cap deploy_with_migrations
- will deploy normally and then run 'rake db:migrate' (SCARY!)
- 'cap disable_web' (FIRST!)
- WILL NOT RUN ANY :after_deploy methods (FUCK!)

Now don’t get me wrong, I really love Capistrano (now at 1.4) as it makes my development life a lot easier. It’s just those little bits that bite you in the ass in the most unexpected moment.

Oh, and I’m sure there’s a reasonable explanation for this behaviour.

UPDATE: It has its own ticket now.

Express Kaszubski – my second public Rails app

Express Kaszubski, a local Kaszubian (that’s in Poland) newspaper has just recently decided to stop releasing its printed edition and move entirely to the web. It was my honour to accompany during this move. The online edition took about a month to create. It’s just a basic website at the moment. No comments, no RSS feeds, although the CMS behind the scenes is quite powerful. All in Rails, of course.

Here is the snippet:

Express Kaszubski

And if you haven’t noticed by now, it’s all in Polish.

Apple against the DRM

While sensible and all, I was surprised when I’ve read it (despite it coming from Apple):

Why would the big four music companies agree to let Apple and others distribute their music without using DRM systems to protect it? The simplest answer is because DRMs haven’t worked, and may never work, to halt music piracy. Though the big four music companies require that all their music sold online be protected with DRMs, these same music companies continue to sell billions of CDs a year which contain completely unprotected music.

Source: Apple’s thoughts on music (via)

A real celebrity using my movie ratings plugin!

First I’ve received a standard support question concerning my WP Movie Ratings plugin (Help! Your plugin is not working!) from someone called Joshua J. Greene. He has a company that has something to do with the movies. I haven’t paid much attention to his website at first, but at some point I’ve decided to look him up on imdb and that’s when the surprise came. He actually had something to do with the Hoodwinked movie! He is an actor, producer, editor, cinematographer, composer and director (all in one). So I can be proudly say now that even celebrities use my plugin!

Reference: Joshua J. Greene movie ratings page.

Google and valid markup

Just a quick thought that has passed my mind while taking a shower today.

If I were at Google I would give a few more points to the page that consisted only of valid markup. Notice when I say valid, not semantic as the latter one gives you more google points beyond a shadow of a doubt. Valid markup says that the author simply cared more than the rest and as such it is more probable that its content is more relevant (but that, of course, is not true for all cases, take hosting blog services for example), so giving more points to such page would certainly makes sense.

I may, of course, be wrong :)

Kania Lodge – my first public Rails project

To be honest, I’ve been a Rails programmer/enthusiast for quite a while now (something along 1.5 years; I think I’ve first downloaded it in July, 2005) but it’s only now that I can show you my first public project using this awesome framework. So without further ado, here it is, the Kania Lodge:

Kania Lodge

The Rails part on this website is the custom CMS that is backing it all up (based on RedCloth). Most of the hard work was with the design, though (Photoshop, etc.). I know it is a hardly original design as I’m not a full-time designer, yet I’ve done my best for it to look good. I’ve aimed for simplicity, cleanliness and good overall feel/aesthetics. Did I miss or am I right on the spot? :)

WP Movie Ratings featured on the WordPress Podcast

The team that creates the WordPress Podcasts decided that my WP Movie Ratings plugin is good enough to be featured in the newest episode, the 17th. I feel so honored I’m almost blushing. Go, listen to it. Now. There’s also a local copy you can download. The part about my plugin starts at 23:11.

Now as for my surname, I was aware it’s hard to pronounce it right but the way he read it… man, you’ve made my day! :)