Ext2 as an indexed file system, a file occupies an inode, records the permissions and attributes of the file, and records the block number of the file where the data resides;
The benefits of disk partitioning: with MySQL as the data directory, if you put the data catalog in a separate partition, you can greatly reduce disk fragmentation and improve read and write efficiency.
The Ext2 file system is formatted into multiple block groups, each with a separate inode/block/superblock
Inode Record Information:
Access mode of the file R W X
The owner and group of the file
Size of File
File creation or state change time CTime
Time of last Read actime
Last Modified time Mtime
Flags that define file attributes
Pointing to the real content of the file
Each inode size is fixed to 128bytes each file occupies an inode file system can be created by the number of files associated with the number of inode; When the system reads the file, it first finds the inode and parses the inode to see if the permissions are in accordance with the user, in order to start actually reading B ' Lock content
The Inode record block number area is defined as 12 direct, one indirect, one double indirect, one three indirect: assuming block is 1kB
12k + 256k+ 256*256k+ 256*256*256 = 16GB
In addition to the first block group containing Superblock, subsequent block group does not necessarily contain superblock, a filesystem should contain a superblock, and the other superblock in one filesystem are primarily backup
Blocks bitmap block table records whether block is used; When deleting a file, locate the block number in bitmap and change the block's flag to unused
Linux file system