Ext2 File System addressing

Source: Internet
Author: User

Ext2 file System Related: Ext2 file system, a file in addition to the data need to store, some of the descriptive information needs to be stored, such as file type (general, directory, symbolic link, etc.), permissions, file size, creation/modification/access time, etc., that is, the ls-l command to see the information, This information exists in the inode rather than in the data block. But where the file name exists, first the file name is not in the inode, then where does the file name exist?

Here we can see the directory size is 4096, when you create a directory, the operating system will allocate a block (4096), the file name is the existence of the directory file, it is worth noting: when the file directory under a large number of files, the size of the directory file will increase. As shown below, the bin directory file size is larger than 69632.

Here's an example of the home directory:

The/home directory file contains a record entry, where the entry includes the file name and corresponding inode number, record length and other information.

Open () A/home directory for the file hello.c file addressing process, first find the home/home file data block, to match the file name of the record entry, if the match can get its inode number, and then the inode to obtain data pointers. Maybe someone will ask/home how to find it? The top level directory of the home directory is the root directory/, the operating system specifies that the root directory/must be placed on the Inode 2 number.

You can see that the inode for the/directory is 2.

When open ("/HOME/HSC/SS.C")

So the addressing process is: The operating system first finds the INODE2 data block, then obtains the home directory Inode number according to the record item match, obtains the corresponding data block according to the inode number, and then finds the HSC file Inode number according to the record item

Finally find the SS.C inode and locate the file.

Ext2 File System addressing

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.