For the ext2/3/4 file system, the default data block size is 4096 byte. When you need to create a new file or directory, the smallest allocation unit is data block, which is 4k size, such as the content of a file If it is 4M, 1000 data blocks must be allocated to store the contents of this file, and the attributes, permissions, and data block numbers of the file or directory are stored in the corresponding inode.
When you create a new directory, a block will be allocated by default, which is the 4096 byte you see. The file names and inode information of the files in the directory will be stored in this block. As the files in the directory grow, the metainformation to be stored will also increase. If one block is not enough, another block will be applied for, but the smallest unit is the block, so the size will always be an integer multiple of 4096.
When you create a new small file, it will also be allocated a size of 4096 bytes, but the actual size of the file will be displayed when displayed. So if there are a lot of small files in your system, there is 浪费 storage space.
For the ext2/3/4 file system, the default data block size is 4096 byte. When you need to create a new file or directory, the smallest allocation unit is
data block
, which is 4k size, such as the content of a file If it is 4M, 1000 data blocks must be allocated to store the contents of this file, and the attributes, permissions, and data block numbers of the file or directory are stored in the corresponding inode.When you create a new directory, a block will be allocated by default, which is the 4096 byte you see. The file names and inode information of the files in the directory will be stored in this block. As the files in the directory grow, the metainformation to be stored will also increase. If one block is not enough, another block will be applied for, but the smallest unit is the block, so the size will always be an integer multiple of 4096.
When you create a new small file, it will also be allocated a size of 4096 bytes, but the actual size of the file will be displayed when displayed. So if there are a lot of small files in your system, there is
浪费
storage space.