Eee 701 Planetoid


Automounting removable drives with devmon

Filed under: Linux, Software — Tags: , , , , , , — Tim @ 18:46

One of the early issues I grappled with when I installed Arch Linux on my Eee, was that removable drives were not mounted automatically when connected—i.e. it was not a case of “plug and play”.

This isn’t a case of “oh, Linux can’t do that”—distributions like Ubuntu come ready to automount removable drives “out of the box”. This behaviour is standard with desktop environments such as GNOME or KDE (which usually take care of it themselves), but as you’ll know if you’ve been reading here for a bit, my Eee 701 isn’t running a DE, but “simply” the Fluxbox window manager (mostly for the sake of speed).

Also, the “keep it simple” philosophy of Arch Linux, doesn’t tend to add features “by default” because not all users will want or need them. If you want your Arch system to include a given feature, most likely the maintainers and community have provided the means (applications and guidance) to add it, but it’s down to the user to do the “donkey work” from there.

I certainly wanted to have automounting enabled on my Eee, so after some Googling and Arch wiki/forum-ing I found a udev rule which looked as if it would fit the bill. And so it did… within limitations. The rule would create a mountpoint directory within /media/, and mount the drive contents there; however, it wouldn’t “clean up” after itself, leaving the mountpoint directory within /media/ once the drive was umounted. Also, the rule usually failed to mount some drive volumes, and most annoyingly, wouldn’t mount the disc inside my USB CD/DVD drive.

This last is what led me to the Arch wiki page on udev, which suggested using a “udev wrapper script” (these have their own wiki page) for handling optical drives. The wrapper page in turn put forward a few candidates, of which devmon came at the top of the list. It’s in the AUR rather than the main Arch repositories, but no matter—I built the package and installed devmon as per the instructions on its home page. I also moved the “old” udev rule to another location where it couldn’t be accessed by udev itself, just in case it might disagree with the newcomer.

In short: how I wish I’d found devmon earlier.

So far, it has handled the mounting of almost every device I have “thrown” at it, including my optical drive. I have assigned a Fluxbox key combination (Ctrl-Alt-J) to devmon‘s command for umounting and ejecting an optical disc, though I’d prefer to find out how to have devmon eject the disc on receiving an umount from elsewhere (e.g. the wmvolman dockapp, which doesn’t even display the mounted optical disc). The script also removes the device’s mountpoint upon umounting, which I definitely appreciate.

The only “drive” that devmon has yet to work with, is the “mass memory” on my Nokia N8, which the old udev rule couldn’t handle either. I suspect this is something to do with the device number that shows up when the phone is connected to the Eee in “mass storage” mode (/dev/sdX rather than /dev/sdX1), but this is something I have to look into further when I can be bothered 🙂 It’s not the fault of devmon, as far as I can see, as the udev rule also exhibited the same issue. (Update (2011/10/17): I have a lead on this—see the update below…)

In summary: if you’re assembling a Linux system without GNOME or KDE (and certainly if you want to use a “light” window manager like Fluxbox or Openbox), but you would still like the system to automount removable drives, you owe it to yourself at least to give devmon a try.

Update (2011/10/17):

I received an email from the developer of devmon, who judging by the script’s home page, is often on hand to help users who run into issues. Between us, we confirmed my suspicions that devmon isn’t the source of the N8 mounting problem—it looks to be a bug in udisks, which devmon interacts with.

Just like to point out I haven’t had any other issues with the script, and am grateful to “IgnorantGuru” for helping to clear that up 🙂


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: