From owner-freebsd-questions@freebsd.org Thu Jun 8 18:47:52 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D70EC777F2 for ; Thu, 8 Jun 2017 18:47:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay13.qsc.de (mailrelay13.qsc.de [212.99.187.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95DD26A394 for ; Thu, 8 Jun 2017 18:47:50 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay13.qsc.de; Thu, 08 Jun 2017 20:47:41 +0200 Received: from r56.edvax.de (port-92-195-58-9.dynamic.qsc.de [92.195.58.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id DDD1B3CC42; Thu, 8 Jun 2017 20:47:40 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v58IleGB004120; Thu, 8 Jun 2017 20:47:40 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 8 Jun 2017 20:47:40 +0200 From: Polytropon To: Andrea Venturoli Cc: freebsd-questions@freebsd.org Subject: Re: Panic on external HD disconnection Message-Id: <20170608204740.9ad9b1c3.freebsd@edvax.de> In-Reply-To: <929de353-94c4-cbf2-9b33-67f60b007a71@netfence.it> References: <929de353-94c4-cbf2-9b33-67f60b007a71@netfence.it> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay13.qsc.de with 3EC56683496 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1261 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 18:47:52 -0000 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, ...