USB memory stick hotswap problems

Mike mspam at www.ideaway.net
Sat Sep 25 13:50:37 PDT 2004


Although I fully understand your reasoning, there is still a major
problem here that really should be resolved.  I don't claim that I
have a solution - but I think I have an example that really requires
for this to be solved in some way other than "you must unmount the
USB device before unplugging".
If you have a USB key, sure, you can have the requirement that it
must be unounted before being unplugged.  But what about devices like
a digital camera for example?  Most of these have an automatic
inactivity shutdown - I plug it in, I mount the umass device, I copy
out some files to my home directory and am browsing through the
pictures - while I do this, the camera decides that it's been inactive
for over 60 seconds and that it should save on battery power, so it
turns off.  dmesg shows that usb device went away, but the mount point
(naturally) remains.  Now trying to unmout it says the device is busy,
which is clearly false; forcing the camera back on causes for the
next device to be allocated (if the first was da0, now it's da1), and
(incidentally) using umount -f causes an instant reboot in -BETA4 for
me.  clearly all of these are bad, and in all cases I must either live
with a randomly mounted non-existent device or reboot to remove it.
(if there is some way of dealing with this situation currently that I
am just not aware of, please do enlighten me)
Mike

On Sat, 25 Sep 2004, Doug White wrote:

> On Sat, 25 Sep 2004, Ivan Voras wrote:
>
>> What is the expected behavour when umounting USB drives which have
>> already been unplugged? :)
>
> panic.
>
> You must unmount volumes before removing them from the system. Otherwise
> there is unflushed dirty data that will get lost, causing data corruption
> on the volume.  You will get a panic since the system doesn't know what to
> do with the data and wants to avoid causing any further damage.
>
> --
> Doug White                    |  FreeBSD: The Power to Serve
> dwhite at gumbysoft.com          |  www.FreeBSD.org
> _______________________________________________
> freebsd-current at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"





More information about the freebsd-current mailing list