rm: file exists. filesystem problem?

Chuck Karish karish at forel.stanford.edu
Tue Jan 9 07:34:00 AEST 1990


In article <82 at blender.UUCP> herb at blender.UUCP (Herb Peyerl) wrote:
>I've been having a fair number of problems with my release of BNews
>on my PC-RT 6150-25 running AIX 2.2.1... 

># rm -r comp/sys
>rmdir: file exists
># cd comp/sys
># ls -al
>total 8
>drwxrwxrwx   3 news      news          592 Jan  7 12:52 .
>drwxrwxr--   3 news      news          800 Jan  7 12:54 ..
># cd ..
># rm -ri *
>directory sys: y
>sys: y
>rmdir: file exists

>Anyone have any ideas? 

The link count for sys should be 2, not 3.  Bnews must have used
the "link" command with superuser privileges to make an extra link
to comp/sys.  Use "unlink" on the directory, and you'll be able
to remove its parent.  It might be interesting to use "ls -i"
to find out where the other link is.

Use "unlink" carefully, and run "fsck" afterwards.  It's easy
to corrupt your filesystem with this command.

It's possible on some systems to link a directory to its parent.
This can put fsck into an infinite loop, a most undesirable
state of affairs.

>Should this be the way a unix machine should work?  

It's not the way a well-behaved application should work.  If Bnews
created the extra link without using "link", no, this is not the
way a UNIX machine should work.

	Chuck Karish		karish at mindcraft.com
	(415) 323-9000		karish at forel.stanford.edu



More information about the Comp.unix.aix mailing list