Linux file system and mapping to disk

Source: Internet
Author: User

A) Linux file system

In order to standardize what kind of data should be placed in each particular directory, there is the so-called FileSystem Hierachy Standard (FHS). FHS has been continuously revised, can go to HTTP://WWW.PATHNAME.COM/FHS reference official documents. To try, FHS only defines what data should be placed under the three-level directory for the directory tree, respectively:

/: root root directory, related to boot system

/usr:unix software resource abbreviation, related to software installation/execution

/var:variable, which is related to the system running process.


ii) Mapping of file systems to disks

File system, we are a directory and files, then what is the way to disk and disk partition mapping? is actually "mounted". We call a data file system that can be mounted, such as a disk partition or a USB stick. One of the things we do when we install the system is to partition the disk and then format the partition, which is actually transforming the disk partition into a filesystem. Then, choose to install the system on a partition, for Linux actually means to "mount" the partition to the root directory/.

Unlike Windows, if Windows is installed on a partition, all of the system's files are copied to that partition, while Linux can mount different partitions under different directories when installed (there are certain restrictions that some data must be placed in the same partition). This allows the system files to be placed on different partitions.


III) Linux file system data read

Data storage for Linux systems is accessed in an "indexed" manner. For each file or directory, there is a corresponding inode number and the block area where the data is actually stored. The Inode number stores only the permissions, attributes, and block numbers of the contents of the directory or file, and the block is where the data is actually stored.

As we know from the previous section, our Linux root is mapped to a partition, and usually the topmost inode number of a filesystem starts with 2. Since the directory tree is read from the root directory, it is actually going to the root directory where the partition read Inode number 2, according to the Inode provided by the block number, to read the directory of the file name or directory name, and the corresponding inode number, This step-by-step authentication and reading (if the inode number of a directory in the block is read to 2, indicating that it belongs to another partition, locate the partition according to the disk partition table, and then read the partition's Inode number 2 points to the block area).

Linux file system and mapping to disk

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.