Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Feb 2016 12:11:03 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Ian Smith <smithi@nimnet.asn.au>
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:  <mailman.107.1455019202.84699.freebsd-questions@freebsd.org> <20160210160149.V51785@sola.nimnet.asn.au> <C974C8D0-37C0-4708-9F1A-6CDC4716A8D4@gmail.com> <20160210195431.V51785@sola.nimnet.asn.au> <20160210102236.19f9c68c.freebsd@edvax.de> <20160210204635.K51785@sola.nimnet.asn.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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, ...



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