1833876 Members
2116 Online
110063 Solutions
New Discussion

directory size ..problem

 
KCS_1
Respected Contributor

directory size ..problem

hi, all

I am wondering about directory size on HP-UX 11.X

when i was excuting "ll" command in my root file system, all Directory size are dedicated "1024" .

also , excuted "du -sk /dir1 and /dir2" on my root file system but, size are different exactly..

what happened??

please tell me the reason so quickly, my client are complaining to me..oops!!
Easy going at all.
4 REPLIES 4
Yogeeraj_1
Honored Contributor

Re: directory size ..problem

hi,

have a look at Bill Hassel's comment on this post:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xb20b5bd3782dd711abdc0090277a778c,00.html

hope this helps!
Rrgards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Stefan Farrelly
Honored Contributor

Re: directory size ..problem

You are no comparing like for like.

When you are in / and do an ls -l the directory size you see of 1024 (bytes) is just for the directory entries themselves (ie. the table of contents for the directory), only du -sk reports the size of the directory (all files and dirs below it).

ie. Do a bdf command and you will see /var is something like several hundred MB in size, and if you do a du -sk /var it will also report a similar size (hundreds of MB), but in / an ls -l only shows the directory entry for var being 1024 bytes.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ravi_8
Honored Contributor

Re: directory size ..problem

Hi,

On BSD systems, du reports sizes that are half the correct values for files that are NFS-mounted from HP-UX systems. On HP-UX systems, it reports sizes that are twice the correct values for files that are NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also affects the HP-UX du program.

never give up
john korterman
Honored Contributor

Re: directory size ..problem

Hi Patrick,
in addition to what has already been said: directory files themselves contain information about the names of the files residing in the directory and their inode reference in the filesystem. In order for the directory files to keep this information neat and orderly, the directory has a certain "structure"; at least it has more "structure" than other files in the unix file system. Because of this "structure" the size of a directory is fairly fixed, e.g. 96, 512, 1024 bytes or more.
If you put a lot of files in a directory, you can see how the directory file itself suddenly grows - assuming that you put enough files into the directory. If you afterwards delete the same files from the directory, you will se that the size of the directory itself does not shrink, but that is another story.

regards,
John K.
it would be nice if you always got a second chance