First case:
Problem:
If you want to write data to disk, you are prompted with the following error:
Check disk space through df-h, found not full, may I ask what is the reason?
answer :
It may be that the inode number is exhausted.
Df-i See if the inode count is exhausted.
Enterprise work in the mail temporary queue/var/spool/clientmquene It is easy to get a large number of small files that cause no space left on device error.
The Clientmquene directory is available only if the SendMail service is installed. centos5.x default will be installed sendmial,centos6.5 default no sendmail.
Knowledge Points:
The CENTOS5 series system installs the Sendmail service by default, so the path to the temporary storage location of the message/var/spool/clientmqueue/.
CentOS6 does not install the SendMail service by default, but instead installs the Postfix service, so the path to the mail storage location is/var/postfix/maildrop/.
The above two directories are easily filled with garbage files, resulting in insufficient inode count, resulting in the inability to put files.
When the scheduled task execution end does not add >/dev/null 2>&1, the scheduled task will have a large number of small files in the above directory
second case:
A 100M (the total size of the block, the number of blocks and the size of a single block) partition, write 0.5K files or write 1 m files, respectively, how many can write? Why?
Answer:
- The default partition is usually sufficient for large files to be inode. The number of blocks will be consumed faster, block 4K, 1M files will not have disk waste, so the number of files is about 100/1=100.
- 0.5k,inode for small files can be consumed much faster. The number of blocks in the default partition is greater than the number of inode. Each small file will occupy an inode and a block. So the number of final files is that the inode consumes, and the total amount of files is the number of inode.
Knowledge Points:
- The inode is the file attribute information (also contains pointers to file entities), the default size is 128 bytes (C5), 256 bytes (C6).
- Block is the actual content of the file, the default size of 1K (boot) or 4K (non-system partition).
- A file must occupy at least one inode and one block.
- The default partition is usually sufficient for the number of inode. And the number of blocks will be consumed faster.
Case in production environment No space left on device (inode full use case)