*BSD News Article 8582


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!wupost!cs.utexas.edu!sun-barr!olivea!charnel!fish
From: fish@ecst.csuchico.edu (Kevin Haddock)
Newsgroups: comp.unix.bsd
Subject: Re: corrupted directory, can't remove
Summary: disk errors
Keywords: help
Message-ID: <1fus1pINNqqe@charnel.ecst.csuchico.edu>
Date: 7 Dec 92 06:47:21 GMT
References: <carlp.723695363@frigg>
Organization: California State University, Chico
Lines: 45
NNTP-Posting-Host: cscihp.ecst.csuchico.edu

In article <carlp.723695363@frigg> carlp@frigg.isc-br.com (Carl Paukstis) writes:
>This is the second time it's happened.  Some directory got corrupted for
>bad reasons (me fooling around with my hardware config; this time I
>added RAM over 16Mb, which I thought might be foolish...).
>
>Now, fsck reports that this directory is corrupt, "salvages" it, and goes
>happily on.  Unfortunately, the directory is STILL corrupt, as reported by
>subsequent invocations of fsck.  Trying "rmdir" and "rm -rf" both report
>the directory is not empty, but "ls -al" only shows . and ..
>
>So, I can't pass fsck, and I can't get rid of the directory.  I CAN
>rename it (it's now /tmp/bad).  I can't open it or unlink it from
>a C program (the program just hangs on the open() or unlink()).
>
>My experience is all with SYSV; someone suggested "clri()", but I don't
>see any such under 386BSD.  The last time this happened, I was about to
>clear and rebuild my disk anyway, but I'd prefer not to do that again.
>
>Any suggestions?
>--

I had the same problem.  Basically I was not able to find any solution
other than rebuilding the file system.  What I WAS able to do was to
prevent it from happening again (at least so far).  What I believe was
responsible was the behavior corrected by patch00038 (errors not seen
when reading raw wd device).

I had problems with the prerequisite patch (patch00021 I believe)
so I had to apply this patch by hand (1 line, no bit deal).  I would
strongly suggest you apply this patch as soon as possible after rebuilding
your file system.  My system had a bad spot about 60% of the way thru
the disk (240mb) and would corrupt every time just as I finished loading
the last distribution.  The only way I think you could recover from this
is to hack the inode table and the bad block tables to get around this
flaky sector.  I may be wrong (and probably am) but that was the best
I could surmise about this problem.  I don't know, since it is having
trouble reporting a read problem you might be able to install the patch
after the fact and then flag it as a bad sector.  I didn't try this
because when it happened to me it was like being stuck to the tar baby.
The more I messed with it the worse it got.

Best-o-luck,
-Kevin.
-------
Hackers do it with fewer instructions!