Subject: Re: device attachement detection from userland
To: Emmanuel Dreyfus <>
From: Jonathan A. Kollasch <>
List: tech-kern
Date: 10/17/2006 14:26:18
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 14, 2006 at 11:32:10AM +0200, Emmanuel Dreyfus wrote:
> > >In an ideal world, an userland daemon could be notified that a new
> > >device has been attached, and do the nescessary steps for automounting
> > >filesystems.=20
> > This can (almost) be done by amd.=20
> IMO, amd badly sucks. You have to actually access the filesystem to get
> it mounted, and the first access can get painfuly delayed. It can even
> just hang if there is a problem. That problem is especially sensible
> with slow devices such as floppy or CD-ROM.=20
> Moreover, removable devices partitions are not always at the same
> disklabel letter. Some USB key feature DOS partitions with a MBR (and
> pop up as sd0e), some without (and pop up as sd0d or sd0c). I just don't
> know how to handle that properly with amd.
> I want something that works better. MacOS and Windows are able to have
> removable devices automatically appearing in the filesystem, I'm looking
> for a similar behavior.=20

That's the key, "appearing".  AIUI, recent versions of OS X and Windows
still like to have you notify the system that a block device on which
a file system is mounted is to removed.

> > The tricky part however is: how do you manage removal of the device?
> You can mount with synchronous I/O, and umount -f when the device gets
> removed. Won't that work?=20

	Refraining from ranting,
	Jonathan Kollasch

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.5 (NetBSD)