Pages

Showing posts with label automounting. Show all posts
Showing posts with label automounting. Show all posts

August 05, 2008

automounting - part 2

Here is a brief (!) summary of the problems I encountered in setting up automounting in SkinnyDebbie and what I did to get it to behave. The whole process relies on hal and ivman. Maybe there is a better way to do this; if so I would love to learn how.

In no particular order ...

If media is present when user starts machine, the media automounts under ivman's account, and then a regular user can't unmount it.

Solution:
  • Disable ivman daemon so that the ivman user doesn't do any mounting:
    # update-rc.d -f ivman remove
  • Start ivman under the user's account at login so the regular user can mount via ivman.
In other words, have ivman run as user and do not have it run as ivman (which is what the daemon makes happen). The major consequence of this approach is that it will only work if one user at a time is logged into the machine or only one user at a time is authorized to use automounting.

Turning off the ivman daemon is handled by the SkinnyDebbie installer. I wrote a custom script (start-ivman) to handle user startup that checks the above at IceWM startup. I also wrote a control panel widget that repairs the above if it breaks (e.g., after an ivman package update).

The default SkinnyDebbie behavior is that automounting will be started for the first user that is logged in and not for subseqent users until the first user logs off. In practice this is fine because SkinnyDebbie is intended for single-user logins. The start-ivman script warns the user if someone else is already using automounting.

Not all media automounts, USB hard drives in particular

Solution:
These are done automatically by the SkinnyDebbie installer, except for removing CDROM and DVD links from /. The repair control panel applet also removes directories in /media that do not appear in /etc/fstab.

It's not at all obvious to the regular user where/when removable media is inserted

Solution:
  • Edit ~/.ivman/IvmConfigActions.xml so that:
    ROX-Filer announces the insertion of media and prompts the user for desired action (e.g., open /media directory, launch CD ripper, etc.)
    ivman scans on init
  • Add /media link to the desktop
  • Add /media link to Rox's bookmarks
  • Add /media link to IceWM's "start" menu
SkinnyDebbie's ~/.ivman/IvmConfigActions.xml is configured to handle CD-ROM, CD-Audio, DVD-video, and USB-based storage devices. At the present time I don't know what it will do with other removable media ( e.g., Compact Flash). It will also scan on init.

There are several custom "annc" scripts (anncRoxMedia, anncCDDA, anncDVDvideo) that get called per media type. These scripts check to see if ROX's pinboard is running; if it is, then it will announce the insertion of media. The IceWM startup delays the start of ROX's pinboard by a few seconds so that the user doesn't get bombarded with media announcements when logging in.

If user logs off without unmounting stuff, the folders remain in /media but the media is not mounted

Solution:
  • Write script pumountall that pumounts everthing and use it to unmount everything at logoff (via ~/.icewm/shutdown).

User needs guidance in good habits (i.e., unmount before remove)
Solution:
  • Write script pumount-fb, which does pumount with GUI feedback.
  • Tell ROX-Filer to use script pumount-fb to unmount.

CD and DVD media don't mount ... ever
See "Not all media automounts, USB hard drives in particular" above.

July 13, 2008

automounting

To be concise, automounting of removable media in Linux hurts.

SkinnyDebbie's first release has been held up by issues surrounding automounting. Getting automounting to sorta work is easy. Getting it to be reliable and usable is another story. I think I've finally gotten things figured out to the point where the system is sufficiently usable and reliable. But I would like to make sure that there are no gremlins hiding in the works. When mountpoints go bad, the results can be fairly ugly.

I also want to add a bit of UI sweetness to the automounting deal: I'd like the the appropriate folder to open in the file manager when the media is mounted to let the user know that the media has, in fact, been mounted. This shouldn't be too tough -- but then that's what I thought about automounting in general.

One annoying thing: Linux does not consider audio CDs and video DVDs mountable media. That means that you literally cannot mount either of these kinds of discs and browse their files on the command line or in your file manager. This doesn't mean you can't open discs in applications designed to read from them (e.g., VLC, Xine, Audacious); it just means that you can't ls, mv, cp, etc. the files on the discs. In theory, it's possible to set things up so that when you insert, say, an audio CD, an application that can read audio CDs will launch and open the CD in the application.

I'm dithering on whether this is a good idea or not. It's a good idea because it makes the life of the end user easier. But it's a bad idea because the application the system designer thinks is best for reading CDs or DVDs may not be the application the user prefers to use. In this case, the psuedo-automount is just a nuisance to the user. As near as I can tell, configuring what application is associated with CD/DVD media isn't that easy either.

Like I said, it hurts.