From owner-freebsd-questions@FreeBSD.ORG Tue Feb 3 07:59:18 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AFAC16A4CE for ; Tue, 3 Feb 2004 07:59:18 -0800 (PST) Received: from gatekeeper.oremut02.us.wh.verio.net (gatekeeper.oremut02.us.wh.verio.net [198.65.168.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5517543D4C for ; Tue, 3 Feb 2004 07:59:17 -0800 (PST) (envelope-from fclift@verio.net) Received: from mx.dmz.orem.verio.net (mx.dmz.orem.verio.net [172.16.146.6]) 380391E4934 for ; Tue, 3 Feb 2004 08:59:17 -0700 (MST) Received: from vespa.dmz.orem.verio.net (vespa.dmz.orem.verio.net [172.16.146.130])i13FxG1e055493 for ; Tue, 3 Feb 2004 08:59:16 -0700 (MST) (envelope-from fclift@verio.net) Date: Tue, 3 Feb 2004 08:59:16 -0700 From: Fred Clift To: freebsd-questions@freebsd.org Message-ID: <20040203084956.O91207@irfcn.qzm.berz.irevb.arg> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: usb umass flash drive mount/umount questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 15:59:18 -0000 Ok - I've got a lexar 64Mb flash drive - aka 'thumb' drive. I've modified my usbd.conf to automatically mount the device on insertion. I have a single slice and a single FreeBSD partition with a ufs filesystem on it. I am wondering if there is any way I can have the device unmounted automagiclaly on removal - it seems that by the time the OS gets a message about the usb device detaching, that it is to late to flush pending writes to the device since the device is already gone. So, are there other fstypes, or some kind of filesystem tuning or mount flags I can use to say "always flush all writes synchronously" so that if the device disappeared it would be consistent and have the right contents. And, on top of that, is there some way that I can convince the OS to not barf when trying to unmount a device that has already gone? Or can I hook the usb code to somehow do an umount before the daX device goes away? I _think_ that a dos filesystem might meet the first requirement, but how can I do the second? Even then, I'd rather not have to use a dos filesystem since it limits possible filenames. This still doesn't take care of unmounting the device properly at removal. I know there are packages like mtools that just use the device file and never actually mount the device -- this isn't really acceptable either... For now, I have a ufs filesystem, I automatically mount on insertion and I manually have to unmount. Anything better to be doing? Fred -- Fred Clift - fclift@verio.net -- Remember: If brute force doesn't work, you're just not using enough.