Linux File index node (inode)

Source: Internet
Author: User
1. What is an index node? An index node is a structure that contains information such as the length of a file, creation and modification time, permission, ownership, and location on the disk. A file system maintains an array of index nodes. Each file or directory corresponds to the unique element in the index node array. The system assigns a number to each index node, that is, the index number of the node in the array, which is called the index node number. 2. Relationship between index nodes and files Linux assigns an inode number for each file called an index node. inode can be simply understood as a pointer, which always points to the specific storage location of the file. The system locates each file by indexing nodes rather than file names. All information required by the file system to process files is stored in a data structure called an index node. The file name can be changed at any time, but the index node is unique to the file and exists with the file. The number of inode nodes allowed by a file system is limited. If there are too many files, even if each file is a 0-byte empty file, the system will eventually be unable to create files because the Node space is exhausted. Therefore, when a file cannot be created, you must first check whether there is space in the hard disk data zone (you can run the du command), and then check the Node space. Linux supports multiple file systems because it provides a Virtual File System (VFS) and VFS, as the upper-layer software of the actual file system, masks the specific structure differences at the underlying layer of the actual file system, provides a unified interface for the system to access files located in different file systems. In fact, many file systems do not have the inode structure, and their directory structure is also different from the above discussion. However, through VFS, the system provides a virtual consistent inode and directory item structure. Therefore, the inode actually displayed by the 'LS-il 'command should be VFS inode, that is, inode is the data structure in the memory, not necessarily the actual hard disk structure. However, the ext2 file system customized for Linux has the actual inode and connection directory item structure. if you have an inode, you can have a file. If you have an inode in FS, you can have a file. inode is divided into single-byte and multi-byte (determined by the type of the file system and the size of a single file ). how much does inode open when FS is being created? This is determined by the nbpi (average size of files managed per node) and FS size. after FS is created, inode can only be added, and nbpi cannot be changed. on the contrary, inode is also added whenever the FS is expanded. therefore, because the number of inode managed by JFS is 16 m (24 power of 2), the maximum value of FS is also set when nbpi is determined.
Related Article

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.