gnome-mount is the new ed

19.10.2008 17:21

It is bad enough when you encounter software that doesn't work. It's absolutely infuriating when it adds insult to injury and stubbornly refuses to do your bidding.

Historically, the most famous such stubborn piece of software is ed, the standard editor. As the urban legend goes, a typical user session looks like this:

golem$ ed
?
help
?
?
?
quit
?
exit
?
bye
?
hello? 
?
eat flaming death
?
^C
?
^C
?
^D
?

You could forgive the brave authors of the Unix dark ages for trading in a bit of user friendliness in exchange for precious core memory and teletype paper. And you can also be forgiven for thinking that today we are beyond such compromises.

Let's try an exercise similar to the one above with gnome-mount, a command-line utility that is used by various parts of Gnome Desktop to mount removable drives.

galxpolx$ gnome-mount --device /dev/hdb
gnome-mount 0.7
galxpolx$ gnome-mount --device /dev/hdb1
gnome-mount 0.7
galxpolx$ gnome-mount --device /dev/hdb1 --mount-point /media/sdcard
gnome-mount 0.7
galxpolx$ gnome-mount --device /dev/hdb1 --mount-point /media/sdcard --fstype vfat
gnome-mount 0.7
galxpolx$ gnome-mount --verbose --device /dev/hdb1
gnome-mount 0.7
galxpolx$ gnome-mount --verbose --hal-udi /org/freedesktop/Hal/devices/usb_device_cf2_6225_146030377350_if0
gnome-mount 0.7
galxpolx$ gnome-mount --eat-flaming-death
gnome-mount 0.7

At this point you can see that gnome-mount is as consistent in its output as ed. After several minutes of trying it has firmly established that you are in fact running version 0.7 of gnome-mount, but offers no additional clues on why it will not mount the freaking SD card.

Yes, I understand that gnome-mount is meant only to be ran by other processes and not by the user directly. However, the whole point of the Unix software model is that you have modular design, where each module can be individually tested manually. Giving no feedback on why an operation has failed is the worst kind of programming offense. And why is there a --verbose flag if it doesn't do anything?

In general, this is one of the things that bother me the most on the modern Linux Desktop. I don't expect everything to work out of the box. On the contrary, I'm prepared to research the issue and make corrections when something doesn't work. But with complicated systems in place on recent installations like udev and hal it happens more often than not that I hit a brick wall with software that will just not tell you what's wrong with it. It will simply just not work. With a problem description like that it's even futile to ask for help on a project mailing list until you've thoroughly studied the source code of several utilities.

It's been so last time with my efforts to make brightness buttons play nicely with gnome-power-manager on my Eee PC and it's also looking that way with the more recent problem with automatic mounting of removable volumes.

Posted by Tomaž | Categories: Code

Comments

I agree wholeheartedly. I've wasted quite some today trying to work massage gnome-mount into compliance.

I believe the second command will work...
$ gnome-mount --device /dev/hdb1 --mount-point /media/sdcard
... if you make the mount point "sdcard". The G_DIR_SEPARATOR isn't allowed in the mount point, so I'm still struggling to discover how to mount things in ~/mnt.

Posted by Chad Versace

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)