SUMMARY: file system problem

From: Len Evens (
Date: Sat Sep 26 1992 - 00:56:21 CDT

I posted the following question
| The file system on a Sun3 running OS 4.1.1 got messed up
| and fsck seems unable to fix it. I have two directories which
| now appear to be empty, but neither rmdir no rm -r can remove them.
| rmdir complains that the directory is not empty although it is.
| (It is not a matter of hidden files, I checked that.)
| When I reboot, fsck complains and makes me fix the file system
| manually. After I do that, running fsck over again indicates it
| is okay, but if I reboot again, I seem to be back where I started.
| I managed to rename the bad directories so they don't interfere
| with the operation of the system.
| Does anyone have any ideas about what is happening?

The solution involved some basic Unix, which I had forgotten.
This is one of the rare occasions in which one should not

Here was one solution

> From edguer@alpha.CES.CWRU.Edu Fri Sep 25 12:06:18 1992
> Return-Path: <edguer@alpha.CES.CWRU.Edu>
> rmdir will only let you remove directories that have a link count of 2.
> You can see how many links exist using the "ls -l" command. Directories
> that have more than 2 links mean that you have created a hard link between
> directories. This is a bad thing because it means you can create loops
> in the filesystem. Loops in the filesystem cause many utilities to break.
> fsck should correct the problem. However, after running fsck, you should
> _NOT_ sync the disks. As described on the fsck manual page, fsck only
> corrects the superblocks on the disk, it does not correct the in-core
> copies. This means that if you sync the disk you are writing over the
> correct data with the corrupt data.
> The fact that the second fsck did not report problems after the first
> fsck means that the problem is probably correctable but that you are
> syncing the disks when you should not.
> After finishing fsck, do not use halt unless you also use the "-n" option
> to halt [see the manual page]. Do not use reboot unless you use the "-n"
> option to reboot [see the manual page].
> Aydin Edguer

I came up single user, was told to run fsck manually, did so, did
halt -n, rebooted, and everything was fine.

Leonard Evens 708-491-5537
Dept. of Mathematics, Northwestern Univ., Evanston, IL 60208

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:50 CDT