In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to deeply analyze the inode node of the Linux system. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Inode is the area where file information is stored in Linux systems, also known as "index nodes".
1 introduction to inode
To understand inode, start with file storage.
Files are stored on the hard disk, and the smallest storage unit of the hard disk is called the "Sector". Each sector stores 512 bytes (equivalent to 0.5KB).
When the operating system reads the hard disk, it will not read it sector by sector, which is too inefficient, but read multiple sectors in succession at one time, that is, read a "block" at one time. This "block", which consists of multiple sectors, is the smallest unit of file access. The most common size of a "block" is 4KB, that is, eight consecutive sector form a block.
File data is stored in "blocks", so obviously we must also find a place to store the meta-information of the file, such as the creator of the file, the date the file was created, the size of the file, and so on. The area where the meta-information of the file is stored is called inode, which is translated into Chinese as "index node".
2 the content of inode inode contains the meta-information of the file, specifically, the following:
* number of bytes in the file
* User ID of the file owner
* Group ID of the file
* permissions to read, write and execute files
* there are three timestamps for a file: ctime refers to the time when the inode was last changed, mtime refers to the last time the file content changed, and atime refers to the last time the file was opened.
* number of links, that is, how many file names point to this inode
* location of file data block
You can use the stat command to view the inode information of a file: [plain] view plain copy [root@localhost /] # stat example.txt in short, all file information except the file name is stored in the inode. As to why there is no file name, it will be explained in detail below.
3 size of inode
Inode also consumes hard disk space, so when the hard disk is formatted, the operating system automatically divides the hard disk into two areas. One is the data area, which stores file data, and the other is the inode area (inode table), which stores the information contained in inode.
The size of each inode node is typically 128byte or 256byte. The total number of inode nodes, which is given when formatted, usually sets one inode per 1KB or per 2KB. Suppose that in a 1GB hard disk, the size of each inode node is 128bytes, and one inode is set for each 1KB, then the size of the inode table will reach 128MB, accounting for 12.8% of the whole hard disk.
To see the total number of inode per hard disk partition and how many have been used, you can use the df command.
On how to in-depth analysis of the Linux system inode node to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.