Removing Invalid Directory Entries
These files are those with a directory entry that points to an
invalid/nonexistent inode. They can be found by doing (in bash):
1) An ls of the specific file and getting "No such file or directory".
2) An "ls | grep <basename>" and getting a file listing.
Reminder: You need to log onto the pnfs server, use the /pnfs/fs path
and be user root for these commands to work.
Notes: Taking the file /pnfs/fs/usr/mydir/myfile; <basename> refers to
myfile in the following examples and <directory> refers to
/pnfs/fs/usr/mydir.
To remove them (1st method):
setup pnfs
cd <directory>
$pnfs/tools/scandir.sh | grep <basname>
Paste the results from scandir.sh as arguments to Sclient.
Sclient <line from scandir.sh output>
Answer yes to Sclient to execute the listed sclient rmdirentrypos command.
To remove them (2nd method):
setup pnfs
cd <directory>
$pnfs/tools/scandir.sh | grep <basname>
First output from scandir is the directory id, then the file id, then other
output then the position.
$pnfs/tools/sclient rmdirentrypos $shmkey <dirID> <rmID> <position>
To remove them (3rd method):
Sometimes the positional way(s) does not work. Try this next where
<basename> is the name of the 'broken' file.
setup pnfs
cd <directory>
$pnfs/tools/sclient rmdirentry $shmkey <dirID> <basename>
On occasion the filesystem will continue to remember that a file was there
after it has been successfully removed from the database. Waiting a while
for the cache to clear out is the simplest option. For the impatient
you can force an unmount ("umount -f -l ..." on linux) and then remount
the file to clear up the problem.
Last modified: Wed Apr 18 11:14:18 CDT 2007