Nguyen Vu Hung a ?crit :
> find . -type f -name *.png -exec ls -l {} \;  | awk '{print $5}' > L2.txt
> and sum up all the size outputed to L2.txt, and I get 165 486 070
> This is the actual size of the current directory in byte, is this right?
>   
No: this is the total size of your data. It will never be the same as
the actual disk space whatever which filesystem you choose. Except if
the indicated data size is rounded up to the block size which would be
plain wrong.

> And du -sk . gives: 333 520 ( in kilobyte ).
> and is x2 times bigger than the first size I've computed.
>   
Twice the size is quite uncommon, except with files having exactly half
the size of a filesystem block, I can hardly see how this can occur...
What filesystem are you files stored on?

> My question: How do I optimize the disk for storing this kind of data ( i.e, 
> the number of file  is large, while the file size is small ). Is there 
> anything to do with filesystem's block size? What file system is the best 
> choice for this kind of data, and has fast I/O?
>   
Yes it's related to the filesystem blocksize but not only. Because there
is some filesystems that optimize underused block space by reusing it
for something else like file fragments or symbolic link path.

With ext3, you should take a look at "man mke2fs", especialy the -T
option, and "man mke2fs.conf". I've got back a few gigabytes more space
on a 300 GB hard disk simply by tuning this correctly (using "-T
largefile" for huge size files, like ISO images).

-- 
Jean Christophe "????" ANDR? ? http://asie-pacifique.auf.org/
Responsable technique r?gional
Agence universitaire de la Francophonie (AuF) ? Bureau Asie-Pacifique (BAP)
Adresse postale : AUF, 21 L? Th?nh T?ng, T.T. Ho?n Ki?m, H? N?i, Vi?t Nam
T?l. : +84 4 9331108   Fax : +84 4 8247383   Mobile : +84 91 3248747
? Note personnelle : merci d'?viter de m'envoyer des fichiers PowerPoint  ?
? ou Word, voir http://www.gnu.org/philosophy/no-word-attachments.fr.html ?

Trả lời cho