Current-Users archive

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

Re: usb flash drive removal (Re: Desktop NetBSD needs your help)



On Wednesday 11 February 2009, Stathis Kamperis wrote:
> 2009/2/11 Jared D. McNeill <jmcneill%invisible.ca@localhost>:
...
> >
> > Maybe we should add it to the Google Summer of Code project list.
> >
> > Jared
>
> It is already there:
> http://www.netbsd.org/contrib/soc-projects.html#disk-removal

I wonder if there is a simpler (80%) solution -- and forgive me if this has 
already been suggested or if it is is impractical to implement (I am only 
marginally familiar with the file system code).

I notice the USB devices usually (always?) contain a light that flashes while 
the device is being accessed -- sort of like floppy drives in the old days.  
This serves as a strong reminder to the user that she should not unplug the 
device.  The issue therefore is what to do if the user unplugs an idle device.  
Here's my suggestion:

1) Sync a device after it has been idle for a short period.  The time interval 
should be short so that the user does not have time to remove the device 
before it has been synced (say 0.2 to 0.5 sec.).

2) Unmount any device that has been unplugged.  I am assuming this can be made 
to work without the device being present.  In most cases the device should 
already have been synced and therefore ready to be unmounted.

3) Any device that gets plugged in must be mounted (and fscked if needed) 
before if can be used.  The assumption is that (1) would eliminate the fsck in 
most cases.

Regards,
Sverre



Home | Main Index | Thread Index | Old Index