autofs - automatic unmounting / syncing. how does HAL help?

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Sep 16 10:13:05 PDT 2004


okay.

the reason why i am abandoning my hacked-up version of usbmount, most
of which i moved into an autofs script /etc/auto.usb.sh, is because
of integration with the desktop.  and i was getting into a muddle.

the issue(s) are:

- usb floppies and usb card readers tend to get left plugged in
  permanently, whilst the media on them is arbitrarily removed.

- it's NOT reasonable to expect users to cope with "oo you have
   to run umount" - they just won't care.

- some usb pendrives, some usb floppies, and also some usb card
  readers, will either have a partition on them (/dev/sda) or
  they may have a partition table (/dev/sda[1-4]).

- usbmount _was_ smart enough to read /sys in order to determine
  partition information should it be there (so i was able to
  create an fstab-equivalent for the autofs.usb.sh script to
  parse and understand...

- ... but of course that doesn't help you for a usb removable
  media which might happen to have a partition on it, it might
  happen to have a partition table, you won't know until the
  media is plugged in and tested.

  usbmount made the assumption that there might be one or
  the other, but only one partition (ultimately) and used
  "/sbin/fdisk" to check (!)  you ended up with either /dev/sda
  or /dev/sda1 (but never /dev/sda[1-4]).

so.

i understand that HAL captures hotplug events from usb card reader
"media insert" events, is that correct?

because if so (and usbmount certainly couldn't cope with that)
then part of the problem is solved: media in, redo entries,
notify KVM, off we go.

this still leaves two issues outstanding:

1) how can HAL help with automatic unmounting?

   should this be hacked into KDE?

   should i continue to investigate autofs?

   should i write an /etc/hal/device.d/autofs-update.hal
   script that mirrors what fstab-update.hal does?

2) usb floppies: these definitely don't generate usb hotplug
   notify events (mine doesn't... just checking.... nope!)

help help i need to get something working - fast!

l.

-- 
--
Truth, honesty and respect are rare commodities that all spring from
the same well: Love.  If you love yourself and everyone and everything
around you, funnily and coincidentally enough, life gets a lot better.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:lkcl at lkcl.net"> lkcl at lkcl.net </a> <br />

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list