Quote:
Originally Posted by raj k yadav
Why the size of a blank directory is 8K when the data block size is 4K.
[root@ pgsql]# ll /p05_old/pgsql/builderdb/
total 0
[root@pgsql]# du -sk /p05_old/pgsql/builderdb/
8 /p05_old/pgsql/builderdb/
[root@ pgsql]#
|
Assuming an ext2/3/4 file system: I've answered a related question a few days ago:
4096
If you empty a directory these blocks are not reduced. This is a feature (or problem if you want) of the ext2/3/4 file system. The only easy way to reduce the amount of blocks assigned is to delete the directory and re-create it again.
Although I never used it myself the
e2fsck command does have an option to optimize directories in file systems: the -D option. Do have a look at the man page for some extra information.