panic after removing usb flash drive

Eric Anderson anderson at centtech.com
Wed Aug 31 13:13:23 GMT 2005


Daniel O'Connor wrote:
> On Wednesday 31 August 2005 22:19, Eric Anderson wrote:
> 
>>>Although last time I saw this discussed I came away with the impression
>>>that it wasn't possible for the kernel to do this..? (without substantial
>>>work anyway)
>>
>>Why not just use the automounter to mount/umount this for you?  This
>>probably won't get around umounting while in use, but you might be able
>>to tell amd to use a umount -f on it.
> 
> 
> I would have thought you'd still get a panic anyway..?
> The VM will try and flush the dirty pages when you umount and consequently 
> panic.

My thinking was that amd would auto-unmount the filesystem when it isn't 
being used, and if the timeout is set low (I think the default is 5 
minutes), then once done using the flash, it would have time to umount 
before it was unplugged.  Now that I think about it though, if he is 
using it (and open files), it won't even attempt to unmount it anyhow.

This is where I think it would be great to have a sort of 'flashfs' - 
something like a UFS2 filesystem, but read only until a write happens, 
and all writes would be synchronous, and after the write occurs, the fs 
goes back to a 'read only' state.  Maybe this could be done with 
gjournal or even unionfs - mount the usb flash read only, do all writes 
to a memory backed disk, and then flush the writes out to the usb flash 
periodically.  Not perfect, but maybe this will stir some ideas up.

Eric



-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------


More information about the freebsd-current mailing list