[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: usbmount: automatically mount and unmount USB mass storage devices



martin f krafft <madduck@debian.org> writes:

> also sprach Martin Dickopp <martin-deb@zero-based.org> [2004.10.26.1955 +0200]:
>> I have have written and packaged a script which automatically
>> mounts USB mass storage devices when they are plugged in, and
>> unmounts them when they are removed. It is primarily intended for
>> use with USM memory pens. The package depends on udev and does not
            ^^^
Sorry, I meant USB here.

>> assume that the device always gets the same device node. Please
>> see below for package details.
>
> Neither USB nor hotplug provides for unplug notifications. Together
> with caching, this is bound to cause data loss. Thus, you will have
> to mount the filesystems with the 'sync' option, at which point in
> time you might just use floppies or serial cables instead.
>
> Or how else does this software handle unmounting?

Like floppies, USB memory pens cannot be locked by software, so if the
pen is pulled before all data is written, this inevitably results in
data loss. Therefore, my script does indeed mount the device with the
sync option, and a comment in the cofiguration file warns the user that
removing this option will result in data loss.

When the device is pulled from the USB port, the script kills all
processes that have been accessing the filesystem and then unmounts it.
Since udev runs the script immediataly /after/ the device has been
pulled, it is too late for any attempt to still save any data then.

It is of course possible to just unmount the filesystem manually before
pulling the device. In this case, my script does nothing.

I must have misunderstood your point about using floppies instead, but
the main benefit of USB memory pens is their capacity of typically 128,
256, or 512 MB. In all other respects, they are indeed very similar to
floppies.

Thank you for the quick reply!

Martin


-- 
   ,--.                                          ,= ,-_-. =.
  / ,- )    Martin Dickopp, Dresden, Germany    ((_/)o o(\_))
  \ `-'        http://www.zero-based.org/        `-'(. .)`-'
   `-.                                               \_/



Reply to: