[Gllug] Mounting removable media

Casper Gasper casper.gasper at gmail.com
Wed Jan 3 16:33:03 UTC 2007


> Not so. In the past, I used to stick a CF card into the reader, a
> mount point would be created under /media by some combination of udev
> and hotplug IIRC, and an entry would be added to fstab linking the
> mount point to the correct block device. I'd then just say "mount
> /media/SD CARD", and the world would be a happy place.
>
> Sadly, in recent Fedora releases at least, the mount point is no
> longer created automatically, and nothing is added to /etc/fstab. The
> preferred solution seems to be to use some combination of
> gnome-volume-manager, gnome-mount, hald, dbus and who knows what else?
> So all I'm trying to do is get back to a point where I can easily
> mount removable media. Ideally, I'd be able to do it solely via udev,
> and indeed the udev FAQ even shows a crude way of doing it by volume
> label. But that requires knowing the volume label in advance. I'd like
> to have it sufficiently generic that I can plug in *any* card and have
> ti do the right thing. Even the udev FAQ tells me I should be using
> HAL :-(
>

Well, it's pretty easy (but not automatic) even if you're not running
an X session.
Connect your device, then after a few seconds try:

$ lshal | less

and then just look for the relevant block.device which will show you
the /dev entry that udev has created, and from there you can just
mount it.

  I don't know, but I'm guessing whatever KDE/GNOME use to
automatically mount devices just queries HAL.  There are binding for
Perl, Python etc, so you could knock up a script fairly easily that
would find out the filesystem type, number of partitions etc and add
an entry to /etc/fstab.  Maybe someone's already written one?

Casper.
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list