Panic on external HD disconnection

Polytropon freebsd at edvax.de
Thu Jun 8 18:47:52 UTC 2017


On Thu, 8 Jun 2017 15:12:49 +0200, Andrea Venturoli wrote:
> Today I was taking a backup to an external UFS HD when I accidentally 
> touched the cable and it sort of unplugged.

So the disk was mounted at that specific point in time?
Partially understandable. The system will somehow react
to a mass media device surprisingly removed when it is
writing to it...



> While I understand this falls either into hardware or "stupid user" 
> category of panics, is a whole crash normal?

That depends on the kind of operation the system has been
performing at that moment. Disconnecting an unmounted
device isn't a problem, and a mounted device which is not
written to (or read from) often results in a normal application
error.



> Or should I expect better resilience, like fail that filesytem, spit a 
> whole bunch of offenses at me, but keep the on working with the rest, 
> and look for something wrong on my setup?

In case of accidental UFS disconnect, reconnect the drive,
do _not_ attempt to mount it right away, but instead perform
a full fsck ("fsck -yf /dev/da0", for example) of the file
system on that disk. In best case, fsck will repair any
damages that did appear, and then return the file system into
a consistent state, ready for mounting.

But as I said: It highly depends on _what exactly_ was happening
to the disk when it was disconnected...



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list