Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2005 08:13:36 -0500
From:      Eric Anderson <anderson@centtech.com>
To:        "Daniel O'Connor" <doconnor@gsoft.com.au>
Cc:        freebsd-current@freebsd.org
Subject:   Re: panic after removing usb flash drive
Message-ID:  <4315AD00.70809@centtech.com>
In-Reply-To: <200508312230.20301.doconnor@gsoft.com.au>
References:  <1125452228.740.3.camel@arbitor.homelinux.com> <200508311306.46876.doconnor@gsoft.com.au> <4315A757.5020108@centtech.com> <200508312230.20301.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4315AD00.70809>