Momchil Ivanov
2007-Jul-18 09:42 UTC
removing external usb hdd without unmounting causes reboot?
Hi, I am running FreeBSD 6.2-STABLE #11: Sat Jul 14 16:27:12 CEST 2007 and accidently unplugged the USB hub to which my external hdd together with a mouse were connected and this caused my machine to freeze for some seconds and then reboot. At that moment the hdd was mounted and I was playing music out of it. After that I tried to reproduce it :) so just plugged only the hdd directly, mounted it and started playing music files from it. When I unplugged the USB cable the same thing happened: short freeze, and then reboot. Is this expected behaviour? And is there some way to avoid the freeze and reboot? Thanks. -- PGP KeyID: 0x3118168B Keyserver: pgp.mit.edu Key fingerprint BB50 2983 0714 36DC D02E ?158A E03D 56DA 3118 168B
Mark Linimon
2007-Jul-18 13:39 UTC
removing external usb hdd without unmounting causes reboot?
On Wed, Jul 18, 2007 at 11:42:26AM +0200, Momchil Ivanov wrote:> accidently unplugged the USB hub to which my external hdd together with a > mouse were connected and this caused my machine to freeze for some seconds > and then reboot.Yes, this is a known problem, for which there is no workaround at the moment. mcl
Josh Paetzel
2007-Jul-18 13:39 UTC
removing external usb hdd without unmounting causes reboot?
On Wednesday 18 July 2007, Momchil Ivanov wrote:> Hi, > > I am running FreeBSD 6.2-STABLE #11: Sat Jul 14 16:27:12 CEST 2007 > and accidently unplugged the USB hub to which my external hdd > together with a mouse were connected and this caused my machine to > freeze for some seconds and then reboot. At that moment the hdd was > mounted and I was playing music out of it. > After that I tried to reproduce it :) so just plugged only the hdd > directly, mounted it and started playing music files from it. When > I unplugged the USB cable the same thing happened: short freeze, > and then reboot. Is this expected behaviour? And is there some way > to avoid the freeze and reboot? > > Thanks.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) -- Thanks, Josh Paetzel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20070718/76c757c6/attachment.pgp
Andriy Gapon
2007-Jul-19 09:36 UTC
removing external usb hdd without unmounting causes reboot?
on 18/07/2007 20:34 Mark Linimon said the following:> On Wed, Jul 18, 2007 at 10:05:59AM -0700, Jeremy Chadwick wrote: >> Bottom line here is that the kernel panics when removing a USB device >> that has filesystems mounted. > > s/USB // > >> I also have a hard time believing that the reason it hasn't been fixed >> is because "there isn't an easy fix". I'm under the impression it >> hasn't been fixed because either no one cares enough to fix it (using >> the workaround as a scapegoat excuse), or because the majority of people >> do not use USB-based storage devices. > > The reason is not the USB stack; the reason (IIRC) is that the FreeBSD > VM was written with the default assumption that Devices Never Go Away. > A large rewrite, I'm told, will be needed to fix this, and the code is > convoluted and tricky. > > No one finds the situation acceptable; introducing the "scapegoat" word > isn't going to win you any support. The problem is not a weekend's worth > of work to fix, nor does it have anything to do with avoidance by one > particular maintainer, which you apparently had encountered before.Well, here's my two kopiykas. Apparently there is somebody who tried to fix this problem, but for some reason (most probably language barrier) his attempt is largely unnoticed so far. Here is a link to a posting to freebsd-fs: http://lists.freebsd.org/pipermail/freebsd-fs/2007-June/003370.html Here's a discussion about this patch (in Russian): http://www.opennet.ru/openforum/vsluhforumID9/6467.html I have not tried this patch myself. I am not qualified enough to comment on its quality and the author admitted that this is more of a workaround or hack rather than perfect solution. Also, the patch seems to be msdosfs-centered. But there are some success reports on the forum mentioned above. So I thought that this is a good opportunity to draw more attention to the patch in hope that more people will try it and look at it and something good will result from it. -- Andriy Gapon
Zoran Kolic
2007-Jul-21 17:49 UTC
removing external usb hdd without unmounting causes reboot?
> From: Norberto Meijome <freebsd@meijome.net> > i can eject the disk just fine (which in itself is weird, i think).... the device is still there... > umount /dev/cd0 > works fine and off it goes. other than that, no, i havent tried to access the device in questionI never saw that behaviour. It really should not eject. As you, I use scsi emulation, with no acd device at all. This topic is extremely interesting. For me, unmounting usb device is not so hard to do. I remember -r flag to mount with just read option. So, if hand follows the brain impuls, put another impuls to unmount it first. Zoran
Nikolay Pavlov
2007-Jul-22 11:44 UTC
removing external usb hdd without unmounting causes reboot?
On Saturday 21 July 2007 20:50:21 Zoran Kolic wrote:> This topic is extremely interesting. For me, unmounting usb > device is not so hard to do. I remember -r flag to mount > with just read option. So, if hand follows the brain impuls, > put another impuls to unmount it first.Yup. But this is only valid for advenced users. -- ===============================================================- Best regards, Nikolay Pavlov. <<<----------------------------- =============================================================== -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20070722/39d983fa/attachment.pgp