Subject: Re: device attachement detection from userland
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Jonathan A. Kollasch <jakllsch@kollasch.net>
List: tech-kern
Date: 10/17/2006 14:26:18
--CE+1k2dSO48ffgeK
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
>=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
>=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.
>=20
> 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?
>=20
> You can mount with synchronous I/O, and umount -f when the device gets
> removed. Won't that work?=20
>=20

	Refraining from ranting,
	Jonathan Kollasch

--CE+1k2dSO48ffgeK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)

iD8DBQFFNS5aOjx1ye3hmokRAqpQAJ9WFAo+bUM7kAbhCqVzmMy446PGrgCcDBqH
zLWjddo4TRenLnQrG1yGjZU=
=IkBh
-----END PGP SIGNATURE-----

--CE+1k2dSO48ffgeK--