Operating System - HP-UX
1752399 Members
5706 Online
108788 Solutions
New Discussion юеВ

Directory size huge even when no files are present

 
sivaraj_1
New Member

Directory size huge even when no files are present

I have created a directory in which frequent creation/updation/deletion of files happens. The size of the directory remains huge even if the files been created no longer exist of the folder is empty.

Kindly help.

Regards
Shiv
6 REPLIES 6
Basheer_2
Trusted Contributor

Re: Directory size huge even when no files are present

if this is a on a difft file sys, try defragmenting it

Reports
fsadm -DE /oracle

Defragment
fsadm -de /oracle

sort files by size and findout which ones are bigeaters

ls -ls | sort -k1n,1
sivaraj_1
New Member

Re: Directory size huge even when no files are present

The file system wat we have is vxfs.

Kindly help.
Dennis Handly
Acclaimed Contributor

Re: Directory size huge even when no files are present

>The size of the directory remains huge even if the files been created no longer exist

This is how directories work, they never shrink in size.
If it is empty and you really want it to take the minimal size, you can rmdir and mkdir.
Ganesan R
Honored Contributor

Re: Directory size huge even when no files are present

Hi Sivaraj,

If you have deleted any files which are still used by some process, then that space will not be released until the process gets terminated. Use lsof if you have any open files on it.

Ex:

# lsof +aL1 |grep /var/tmp
Best wishes,

Ganesh.
sivaraj_1
New Member

Re: Directory size huge even when no files are present

Thanks for all your valuable inputs. :)
Matti_Kurkela
Honored Contributor

Re: Directory size huge even when no files are present

If you have OnlineJFS, you can run "fsadm -F vxfs -d " on the vxfs filesystem to reduce the sizes of these directories.

Please see "man fsadm_vxfs" for more information.

MK
MK