Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 2015 21:17:42 +0200
From:      Bernd Walter <ticso@cicely7.cicely.de>
To:        Dmitry Sivachenko <demon@freebsd.org>
Cc:        Edward Tomasz Napiera??a <trasz@freebsd.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, Ryan Stone <rysto32@gmail.com>
Subject:   Re: What's required to make removal of a mounted USB stick safe?
Message-ID:  <20150507191742.GE44366@cicely7.cicely.de>
In-Reply-To: <D4835143-A763-4C04-BAEC-65580E847C11@FreeBSD.org>
References:  <CAFMmRNwTi2GOEHN1tDQ7o1-VAtykT%2Bz3g%2B70qaDMenThSrSRgQ@mail.gmail.com> <1306708F-0872-4D02-9C88-70F683018C39@FreeBSD.org> <D4835143-A763-4C04-BAEC-65580E847C11@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 07, 2015 at 01:12:28PM +0300, Dmitry Sivachenko wrote:
> 
> > On 7 ?????? 2015 ??., at 9:23, Edward Tomasz Napiera??a <trasz@FreeBSD.org> wrote:
> > 
> > 
> > Dnia 6 maj 2015 o godz. 22:49 Ryan Stone <rysto32@gmail.com> napisa??(a):
> > 
> >> Currently FreeBSD stands a fair chance at panicking if a mounted USB drive
> >> is removed while I/O is in flight.  Does anybody know what work is involved
> >> to have the kernel safely recover from this case?  Losing data from the
> >> drive is expected of course but there's no reason that the entire kernel
> >> has to crash.
> > 
> > I've spent some time on this few years ago, and got it to work, except for one case: UFS with softupdates.  It's possible that some regressions have been introduced since then.  What's the filesystem?  Do you have a backtrace?
> 
> 
> Recently I forgot to unmount a partition on failed disk (UFS+SU), and after disk was removed it was a kernel panic (something related to SU but I did not save the trace).

Another related problem point with removeable media is the filesystem state.
It can happen that the filesystem on a mounted media is broken and panic
the kernel.
The only way to work around is fsck'ing the filesystem before mounting,
which can introduce an unacceptable delay.

-- 
B.Walter <bernd@bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



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