From owner-freebsd-stable@FreeBSD.ORG Thu Jul 19 17:15:12 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 CEB6D16A408 for ; Thu, 19 Jul 2007 17:15:12 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id 5317C13C4A7 for ; Thu, 19 Jul 2007 17:15:11 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with SMTP id CAA06994; Fri, 20 Jul 2007 02:47:10 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Fri, 20 Jul 2007 02:47:09 +1000 (EST) From: Ian Smith To: "M. Warner Losh" In-Reply-To: <20070719.090024.-1548242272.imp@bsdimp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: LoN_Kamikaze@gmx.de, freebsd-stable@freebsd.org, idiotbg@gmail.com, josh@tcbug.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: Thu, 19 Jul 2007 17:15:12 -0000 On Thu, 19 Jul 2007, M. Warner Losh wrote: > In message: <469F0B93.9020409@gmx.de> > "[LoN]Kamikaze" writes: > : Oliver Fromme wrote: > : > Momchil Ivanov wrote: > : > > On Wednesday 18 July 2007 15:52:42 [LoN]Kamikaze wrote: > : > > > Josh Paetzel wrote: > : > > > > Yes, it's expected behavior. The workaround is to not unplug mounted > : > > > > devices. (There's nothing special about USB here, if you unplugged an > : > > > > IDE drive you'd get the same behavior) > : > > > > : > > > Wouldn't it make some sense not to panic if mounted devices that are in > : > > > sync get removed? A few applications might get in trouble, but that's > : > > > hardly a reason to bring a whole system down. > : > > > : > > I don`t know how things work, but shutting down the system when some > : > > mounted fs is no longer present seems like the wrong thing to me. > : > > : > As Josh wrote, it's expected. The problem is known > : > to exist for a long time already (probably as long > : > as FreeBSD itself exists), and if there was an easy > : > solution, certainly someone would have fixed it. > : > : I remember on 5.3 I removed a mounted USB stick. The system did not panic, all > : I had to do was to plug the stick back in to be able to unmount it. So the > : behaviour has been more tolerant, in the past. > > I'm pretty sure that 5.3 panics when you do this. At least my 5.3 > machine at work did last time I tried it, which was just last week. 5.4 too. Now at 5.5-STABLE, on APM if it matters, I've had much fun several times having the laptop, when on battery, suspend/resume with a USB stick mounted on da0 (msdosfs or ufs) - without removing the device. With rc.suspend kldunload'ing usb and rc.resume kldload'ing it (as recommended for UHCI and, iirc, needed here) then on resume umass0 detaches & reattaches, but assigns the stick to da1. mount still shows the da0sX mount. It doesn't panic unless / until something accesses da0. So at least I usually get a window to reboot, the only way out. Sure I've learned "don't do that" but it's painful when I forget .. Might this new USB stack offer any relief to this need to unload/reload usb on s/r, and if so keep hold of a mount (assuming the stick remains)? Cheers, Ian