Operating System - HP-UX
1830655 Members
12344 Online
110015 Solutions
New Discussion

Re: Slow access to an HP-UX directory?!?

 
Rui Vilao
Regular Advisor

Slow access to an HP-UX directory?!?

Greetings,

I had directory with 14000 abandonned DCE credential files.

Using the command "find /opt/dcelocal/var/security/creds -type f -exec unlink {}
\;"
I was able to delete these files...

However the access to this directory is still slow.

# timex ls -la /opt/dcelocal/var/security/creds
total 3470
drwxrwxrwt 2 root bin 1742848 Jan 29 12:06 .
drwxr-xr-x 6 root bin 1024 Jan 29 06:57 ..

real 15.52
user 0.01
sys 0.18

What does it mean the size of the current directory is 1742848? (btw what is the
meaning of total 3470?).
Does anybody understand what the problem is?

Thanks in advance for your help,

Kind Regards,

Rui.
"We should never stop learning"_________ rui.vilao@rocketmail.com
3 REPLIES 3
Bruce Regittko_1
Esteemed Contributor

Re: Slow access to an HP-UX directory?!?

Hi,

I'm not sure I would have used unlink in the find command. According to unlink's man page, unlink does not do any error checking. The rm command, while slower, does. Link counts in the inodes and file entries in the directory files may not have been updated properly, especially if files had multiple links.

As for the total lines in the ls -l outputs, they are the total number of blocks (including indirect blocks). With such a high number, I would suspect corruption if you cannot see files with ls.

As for a remedy, I would make a new backup and then umount the filesystem and run fsck on it. If it is a vxfs filesystem, use fsck -F vxfs -o full,nolog. If you find yourself answering "yes" to a great number of questions (or you are feeling brave), you can add a -y option to fsck, which will answer "yes" to everything for you.

--Bruce
www.stratech.com/training
Bill Hassell
Honored Contributor

Re: Slow access to an HP-UX directory?!?

Wow. unlink is the very LAST thing you woul ever want to do because it creates corrupted entries in the filesystem. They must be fixed with fsck. Next time, use rm.

As far as the directory's size, that is normal. When you creat millions of files in a directory, the directory must be expanded to hold all the new names, so it grows...but does not shrink when files are removed.

So for your situation, you'll have to somehow remove the current directory, perhaps by moving what you want to save into another directory, removing the oversize directory, recreate it again and then moving the files back again.


Bill Hassell, sysadmin
Rui Vilao
Regular Advisor

Re: Slow access to an HP-UX directory?!?

Bruce, Bill

First of all thanks a lot for your contribution!

I used unlink because it was suggested in a previous thread (cf. Cannot remove directory containing large number of files).

I have run fsck but the slow access remains...

So I moved this directory.
"We should never stop learning"_________ rui.vilao@rocketmail.com