HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Size of Directory....Info

 
SOLVED
Go to solution
HP-UX_Ali
Regular Advisor

Size of Directory....Info

My question when we give ll command in any directory the first line display total (some size) what is that exactly. and for any directory it gives total 64. Is this a block 64? correct actual size will get from du -sk.

pwd
cd /dir1/dir2/RMAN/backup
pebpdb01::root>ll
total 64
drwxr-xr-x 2 user group 8192 Apr 26 20:34 backupsets
drwxr-xr-x 2 user group 8192 Apr 26 18:48 logs
drwxr-xr-x 2 user group 8192 Dec 19 23:32 prev_arch
drwxr-xr-x 2 user group 8192 Dec 19 22:57 scripts
root>cd backup
root>ls -ltr
total 392819040
-rw-r----- 1 user group 93877739520 Apr 26 20:22 x1
-rw-r----- 1 user group 104199872512 Apr 26 20:31 x2
-rw-r----- 1 user group 37650432 Apr 26 20:31 x3
-rw-r----- 1 user group 1461654528 Apr 26 20:34 x4
-rw-r----- 1 user group 1508536320 Apr 26 20:34 x5
-rw-r----- 1 user group 37650432 Apr 26 20:34 x6
but the total size occupied by backup directory.
196409528 backup



Kindly clarify thanks,,,
7 REPLIES
Ivan Krastev
Honored Contributor

Re: Size of Directory....Info

See this from the ls man page:

When an option is specified that results in a listing of directory and/or file sizes in bytes or blocks (such as the -s or -l (ell) option), a total count of blocks, including indirect blocks, is also printed at the beginning of the listing.

More info here - http://docs.hp.com/en/B9106-90007/ls.1.html


regards,
ivan
HP-UX_Ali
Regular Advisor

Re: Size of Directory....Info

Still not clear..
if f_blocks: 52601856 this is the total blocks for file system.
52601856 * 8192 = file system size.
then how 392819040 for backup directory is more..

I need some more clarification..
Thanks..
Michal Kapalka (mikap)
Honored Contributor

Re: Size of Directory....Info

hi,

you oculd try tu use du -ks for example.

mikap

Re: Size of Directory....Info

>for any directory it gives total 64. Is this a block 64?

The contents of the files in that directory is 64 blocks. That's 8 Kb * 4 == 64 blocks.

>total 392819040
>but the total size occupied by backup directory. 196409528 backup

That's right, one stinkin' block is a useless 512 bytes. (gdb) p 392819040/2 => 196409520

>if f_blocks: 52601856 this is the total blocks for file system.
52601856 * 8192 = file system size.

The block size given by ll(1) is rooted in the dark ages, it isn't the filesystem block size.
HP-UX_Ali
Regular Advisor

Re: Size of Directory....Info

Hi Dennis,

>The contents of the files in that directory is 64 blocks. That's 8 Kb * 4 == 64 blocks.

As you mention above 8KB * 4 == 64 blocks how? it should be 32 blocks size occupied.if i am wrong kindly clarify.....

>That's right, one stinkin' block is a useless 512 bytes. (gdb) p 392819040/2 => 196409520

can you elobrate more in this. why one stinkin' block is a useless 512 bytes. I didnt understood this point.


Required your input to understand more in details. If any diagramatical flow would be greate to understand. to know the actual blocks and how indirect blocks occupied.

Thanks to confirm
Solution

Re: Size of Directory....Info

>As you mention above 8KB * 4 == 64 blocks how?

Because 32 Kb/64 blocks == 512 bytes per block. Pretty useless unit.

>why one stinkin' block is a useless 512 bytes. I didn't understood this point.

That's its size. It is "useless" because you have to ask what it means and it isn't a "round" number.

>Required your input to understand more in details.

If you see du(1) it mentions blocks are 512 bytes. tar and cpio use that number too.

>to know the actual blocks and how indirect blocks occupied.

That may not be true for VXFS filesystems, just ignore that number, I always do. (I didn't know what it meant until a months ago.) If you want the size, use "du -kx".
HP-UX_Ali
Regular Advisor

Re: Size of Directory....Info

I have understood the solution & hence closing the thread.

regards