Subject: Re: Detaching live sd devices
To: Jukka Marin <jmarin@embedtronics.fi>
From: Lars Nordlund <lars.nordlund@hem.utfors.se>
List: tech-kern
Date: 07/25/2005 20:03:14
On Mon, 25 Jul 2005 20:41:04 +0300
Jukka Marin <jmarin@embedtronics.fi> wrote:

> On Mon, Jul 25, 2005 at 01:22:47PM -0400, Allen Briggs wrote:
> > On Mon, Jul 25, 2005 at 08:16:52PM +0300, Jukka Marin wrote:
> > > No modern operating system should have the user do things like this unless
> > > he/she has a specific reason for it.  The users don't even know what
> > > mounting a disk means.
> > 
> > No, but most people know about disabling or "putting away" the
> > device before removing it.  Dragging it to the trashcan in MacOS
> > or right-clicking on it on Windows (or whatever you do there).
> 
> On the Amiga, you just ejected the disk.  If the OS had any dirty buffers,
> it would ask the user to reinsert the disk so it could flush the buffers.
> It also flushed the buffers when a timeout expired after the "last" disk
> access.

What happened if you inserted another floppy instead of the one you
just removed? Did it destroy that floppy with the other floppy's dirty
buffers?

I have been thinking about something like this for NetBSD. If it is
possible to store a checksum of the MBR(?) (or some other kind of
identity of the mounted media) so the OS can safely flush dirty buffers
later. If a media disappears the kernel would just write "reinsert media
previously mounted at /memorystick now!" on all ttys.


Best regards
	Lars Nordlund