Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto fix a filesystem corruption 1

Status
Not open for further replies.

clund

Technical User
Sep 9, 2004
23
US
I have run into a little problem and I'm not entirely sure what the correct approach would be to fix it...

Short problem description:
I had a FS corruption last week and used fsck to repair it. After the repair I have two empty directories with the same inode and the system won't let me delete them.

The long problem description:
About a week ago we had a FS corrupted message in the error report. I subsequently unmounted the FS and ran fsck to repair it and it said that everything was fixed. However running a find on the FS gives out a bunch of "find: 0652-019 The status on ./path/filename is not valid." errors. I noticed that the empty directory /image2.nfs/image/util/200412010247359002/fps.icr had a reference count of three instead of the usual two.
So I have now tracked down the error to two directories that have the same inode number and I wish to just delete those directories.
But I can not do that because the system keeps giving me a "rm: 0653-611 Directory /image2.nfs/image/util/200507150329310032 is not empty." error.

The two directories with the same inode number are:
/image2.nfs/image/util/200412010247359002/fps.icr
/image2.nfs/image/util/200507150329310032

The impact on our system is that the backup (SysBack) does not work correctly because all the files in the find after /image2.nfs/image/util/200412010247359002/fps.icr comes up with an error.

Here's the shell output from my trouble-shooting:
[tt]TAX183:/image2.nfs/image/util
# ls -ld 200412010247359002
drwxrwsrwx 2 fp1 staff 512 Dec 03 2004
200412010247359002
TAX183:/image2.nfs/image/util
# ls -ial 200412010247359002
total 792
12294 drwxrwsrwx 2 fp1 staff 512 Dec 03 2004 .
2049 drwxrwsrwx1828 751 staff 396288 Sep 19 09:43 ..
12295 drwxrwsrwx 3 fp1 staff 512 Jul 18 14:49 fps.icr
[highlight]TAX183:/image2.nfs/image/util
# ls -ial 200412010247359002/fps.icr
total 784
12295 drwxrwsrwx 3 fp1 staff 512 Jul 18 14:49 .
2049 drwxrwsrwx1831 751 staff 396288 Sep 19 09:44 .. [/highlight]
TAX183:/image2.nfs/image/util
# rm -rf 200412010247359002
rm: 0653-611 Directory 200412010247359002/fps.icr is not empty.
rm: 0653-611 Directory 200412010247359002 is not empty.
[highlight]TAX183:/
# find /image2.nfs -inum 12295 -print 2>/dev/null
/image2.nfs/image/util/200507150329310032
/image2.nfs/image/util/200412010247359002/fps.icr [/highlight]
TAX183:/
# ls -ldia /image2.nfs/image/util/200507150329310032
12295 drwxrwsrwx 3 fp1 staff 512 Jul 18 14:49
/image2.nfs/image/util/200507150329310032
[highlight]TAX183:/
# ls -lia /image2.nfs/image/util/200507150329310032
total 784
12295 drwxrwsrwx 3 fp1 staff 512 Jul 18 14:49 .
2049 drwxrwsrwx1853 751 staff 396288 Sep 19 09:47 .. [/highlight]
TAX183:/
# rm -r /image2.nfs/image/util/200507150329310032
rm: 0653-611 Directory /image2.nfs/image/util/200507150329310032 is
not empty.[/tt]
 
Have you tried with unlink?

unlink /dir/path/..
unlink /dir/path/.
unlink /dir/path

If that doesn't work, I guess you'd have to fsdb the filesystem and step your way down the paths to clear the inodes, but I can't help you on that. (Tried it once and messed up, so I try to avoid it)


HTH,

p5wizard
 
thank p5wizard!

unlink did the trick [2thumbsup] ... yesterday I was trying to figure out how to fix this using fsdb and when made my post this morning then it was with the hope that somebody would be able to walk me through the steps using fsdb. ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top