du


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers du
# 1  
Old 08-29-2001
Question du

I have a question about the use of du. I understand that du reports the number of 512-byte blocks of disk usage used in the directory and below.

However, with only 3 small files (file a is 64 bytes; b is 68 bytes; c is 6 bytes), du seems to tell me that the OS is using 8 blocks x 512-byte to store them. Is there anything wrong with my calculations or I misunderstand anything?

When I do a 'du' with no option, it gives me:
8 .
When I do a 'du -k', it gives me:
4 .
When I do a 'du -a' , it gives me:
2 ./a
2 ./b
2 ./c
8 .



# 2  
Old 08-30-2001
You have 4 small files: a, b, c, and .

The directory itself is a file and requires space to store the list "a, b, c". Each file is 1k in length, so 1k is probably the smallest chunk of disk that can be assigned to a file on your filesystem.
# 3  
Old 08-30-2001
I guess my question is: from where I can find out the smallest chunk of disks that needs to be assigned to a file?

Also, let's say it's 1k, then, is there anyway I could change it (probably during installation or hardware changes), cus my files are mostly small and it is not efficient with it being set to 1k.

Thx.
# 4  
Old 08-30-2001
I think that depends on how your file system works and what it supports. For e.g. vxfs (Veritas Journal) supports a block size specifier with mkfs (newfs) and also uses an extent based allocation.
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question