Linux Learning note 10-file, directory, and disk format three

Source: Internet
Author: User
Inode,block the directory tree Relationship directory

When we create a new directory in the file system under Linux, EXT4 allocates an inode with at least one block to the directory. Where the Inode records the permissions and attributes of the directory and logs the block number assigned to it, and block is the inode number data that is used to record the file or directory name in this directory with the file or directory. Ls-i can view inode numbers for each file or directory under the directory. If there are too many files or directories under the directory, a block record will take up more than one block.

File

When we create a new generic file under Linux, the system assigns an inode to the file with the number of blocks relative to the file size. However, because the inode size is limited, when the file is particularly large, the system will create an indirect block, the so-called indirect block is the inode to record a block number, but the block does not record the actual contents of the file, but the number of other blocks recorded, and then by the block records the contents of the file, This indirect block can continue multiple layers, forming a tree structure that allows the inode to correlate the file content exponentially, which is key to the Inode's ability to act as the sole entry point for the file.

Directory tree Reads

Therefore, the file inode itself does not record the file name, the file name is recorded in the directory block, so we add, delete, rename the file requires the directory's W permission. Because the directory tree is read from the root directory, so the system through the information can be mounted to find the inode number of the mount point, you can get the inode content of the root directory, and according to the inode to read the root directory of the file name data within the block, and then read down to the correct file layer.

Linux Learning note 10-file, directory, and disk format three

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.