From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) Subject: Re: Help! My filesystem is *censored*, and fsck -a doesn't help! Date: 1 Feb 1992 16:23:40 GMT
In article <1992Feb01.102951.25667mrs@netcom.COM> mrs@netcom.COM (Morgan Schweers) writes:
>Greetings,
> The messages coming up are: "Zone X: in use, counted=0"
>
> And a comment about a directory which is missing both it's "." and
>its ".." directories. (Moreover, I can't remove said directory.)
Right. fsck (and no, it's /not/ filesystem f*ck :) doesn't try to remove
directories even when they look bad - it wouldn't be too hard to do: do
people think this would be a good idea (possibly handled by a new flag)?
This is one reason why I like multiple smaller partitions: fsck isn't
that reliable a way to clean up things, so I'd rather copy all the files
that are salvageable onto another filesystem, and clean the bad one up
by way of "mkfs". fsck is better at just simple problems, and to find
out that things are wrong.
> Worse yet, there's a constant process (init) which is writing to a
>file named 'annoy.log', as part of my debugging, and I didn't realize
>at first that this might ('might' hell, WOULD!) interfere with fsck.
Yes, /very/ bad idea. I use fsck -vs quite often to just see the general
state of the filesystem, and that is guaranteed not to worsen things: it
doesn't even try to repair things. Using 'fsck -a' is really something
that should be avoided, and it should definitely /not/ be done while
anything is writing to the disk (including piping the output from fsck
itsel to a file, as you found out).
> fsck -a didn't do ANYTHING for the Zone messages. I managed to
>dealwith all of the "Zone X: not in use, counted=1" errors by removing
>files that I guessed were causing problems.
Ok, this one seems like a bug in fsck when repairing: I'll take a look
at it. Fsck repairing is somewhat untested: I never get filesystem
errors (but then I'm careful.. syncing by hand often just in case...),
unless I'm testing out new features.
> In general, my filesystem seems to be okay, but *SOMETHING* is
>fucked somewhere. I can't recover the directory that has been
>trashed, and I'm not sure what files have lost sectors...
The best idea is to backup onto another partition (or using tar to
floppies) .. then mkfs and copy back. I'll look into fsck, but even if
I got these particular things to work all right, the back-up strategy is
still the best one - fsck will never be /that/ clever that it cannot
f*ck up sometimes.
Those of you with minix fsck could try to use that (won't work if you
use symbolic links: minix fsck doesn't understand them), as that one is
a lot more tested. It gives you no end of "mode not cleared" messages,
but other than that it's ok. I've used linux mkfs since I wrote it, and
it has cleared up my minor problems (when I implemented symlinks I had
some /major/ bugs the first time but fsck worked ok), but that doesn't
mean it's totally safe yet.
Linus