From owner-freebsd-stable@FreeBSD.ORG Wed Jul 18 20:09:37 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42B0016A406 for ; Wed, 18 Jul 2007 20:09:37 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2FAA513C4BE for ; Wed, 18 Jul 2007 20:09:37 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 137511CC05D; Wed, 18 Jul 2007 13:09:37 -0700 (PDT) Date: Wed, 18 Jul 2007 13:09:37 -0700 From: Jeremy Chadwick To: Kris Moore Message-ID: <20070718200937.GA15560@eos.sc1.parodius.com> Mail-Followup-To: Kris Moore , freebsd-stable@freebsd.org References: <200707181541.l6IFf4ht051775@lurza.secnetix.de> <20070718170559.GA11915@eos.sc1.parodius.com> <20070718173406.GA16748@soaustin.net> <200707181942.45045.idiotbg@gmail.com> <469E61DB.4000402@pcbsd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <469E61DB.4000402@pcbsd.com> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: freebsd-stable@freebsd.org Subject: Re: removing external usb hdd without unmounting causes reboot? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2007 20:09:37 -0000 On Wed, Jul 18, 2007 at 11:54:19AM -0700, Kris Moore wrote: > That being said, I think it would be a good idea to at least have the > kernel / HAL or some process maybe warn the user that they should > unmount the USB disk first, to prevent data loss at minimum. But I think > this can be improved, so you don't have to deal with an entire system > panic :P When that happens you gotta reboot, fsck, and run the risk of > something really being corrupted on the drive :( So there's two issues here: 1) Kernel panics when a device (regardless of type (USB, SATA, etc.)) is removed from the system with filesystems mounted, 2) Concern over data loss when device is removed. As I mentioned earlier in the thread, Windows addresses #2 by marking all filesystems on USB storage devices (thumb drives, HDDs, etc.) as synchronous (e.g. mount -o sync). The impact is slow I/O, but it's safe. It seems like we'd be able to implement such a transparent "feature" into the subsystem where filesystems mounted from USB devices would use synchronous I/O (mount -o sync). I don't know how this would be coded, since there would have to be some way to figure out a physical device type (USB mass storage devices show up as /dev/daXXX). Providing an override option for those who know what they're doing, (umount /mnt then physically remove device) would be nice too. This would alleviate concerns over data loss, would it not? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |