13-- study notes. Two companies face questions about the inode and block

First, a 100M disk partition, were written to the file of 1K, 1M and write files, respectively, you can write how many?
A: linux file system, the iNode used to store attribute information of the file, the file used to store the actual content Block, the default size of 1K (boot) or 4K (non-system partition by default 4k).
In the system, a file occupies at least a iNode and a block, and the number is much larger than the general block inode number, so by default partitioning, the inode number is sufficient, while block will consume faster. For example, assume block of 4K, then:
The number of write 1M files 100/1, and there will be no disk wastage (which also explains the general, the inode number and block are sufficient);
When written 1K file, inode and block at the same time is consumed, but generally much larger than the number of block inode number, so the number of writes is inode number, and this wastes disk capacity 3/4.
 
Second, disk error "No space left on device", but the command df -h to view the disk space is not full, I ask why?
A: The number of the disk inode is exhausted, no longer written to the file.
 
 

 

Published 48 original articles · won praise 65 · views 70000 +

Guess you like

Origin blog.csdn.net/xiaolong361/article/details/52373374