From owner-freebsd-questions@freebsd.org Thu Feb 11 11:11:14 2016 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 B4881AA5A7E for ; Thu, 11 Feb 2016 11:11:14 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA09368 for ; Thu, 11 Feb 2016 11:11:13 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-44-23.dynamic.qsc.de [92.195.44.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id B6FE93D54D; Thu, 11 Feb 2016 12:11:03 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id u1BBB3Ua002420; Thu, 11 Feb 2016 12:11:03 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Thu, 11 Feb 2016 12:11:03 +0100 From: Polytropon To: Ian Smith Cc: freebsd-questions@freebsd.org Subject: Re: fsck is failing to clean a filesystem Message-Id: <20160211121103.40cb3a9b.freebsd@edvax.de> In-Reply-To: <20160210204635.K51785@sola.nimnet.asn.au> References: <20160210160149.V51785@sola.nimnet.asn.au> <20160210195431.V51785@sola.nimnet.asn.au> <20160210102236.19f9c68c.freebsd@edvax.de> <20160210204635.K51785@sola.nimnet.asn.au> 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-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 11:11:14 -0000 On Wed, 10 Feb 2016 21:56:48 +1100 (EST), Ian Smith wrote: > On Wed, 10 Feb 2016 10:22:36 +0100, Polytropon wrote: > > On Wed, 10 Feb 2016 20:11:03 +1100 (EST), Ian Smith wrote: > > > On Tue, 9 Feb 2016 22:10:14 -0800, Paul Beard wrote: > > > > > > Well at least /usr/src is easily replaced. Might be worth just deleting > > > all that, though of course you need a read-write mount first .. perhaps > > > after booting from a memstick or live CD? > > > > Which is still risky, assuming that the file system has not > > been marked clean. > > Absolutely. I'm assuming that at this stage the choice is to newfs /usr > and restore backups, unless some magic spell turns up. Once apparently > losing or damaging '..' from anywhere, you're pretty much in trouble. Yes, running newfs on that particular file system should be the easiest way to deal with a file system damage like that. > Paul, another question: with /usr unmounted, is there anything in /usr ? Hmmm... fsck /usr operates on the /usr partition (or to be correct, on the device associated with it), but when the mountpoint itself (the directory /usr, residing on /) is "contamined", it might cause trouble later on, when the partition has been mounted. So any mountpoint should be checked for being an empty directory. > > > Just stabbing in the dark .. scrambled filesystems are the pits! > > > > And a good occassion to read more about UFS (McKusick et al.) - to > > develop a better understanding of what's happening. :-) > > Good suggestion :) I envy people who've got the time these days .. I had the chance and opportunity to do so, when a massive file system damage caused a significant data loss. This drove me to this mailing list, and finally, I got _all_ my data back. The actual loss was a few hundred directory names and a few thousand file names, which is not a big problem thanks to file magic based sorting tools. However, a good understanding of file system internals is helpful to avoid excessive spendings on data recovery. Sure, you can "trust the experts" and pay $5000-10,000, and maybe they then say: "Sorry, norhing to recover", or you can buy expensive software for "trial & error". It finally boils down to a "money vs. time" consideration. I decided to invest my time to learn some UFS, and it saved my ass. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...