Linux file system 1 basic file types and Inode

Source: Internet
Author: User

Basic file Types

normal files : The file contains information that is generated by the user, system, or application input, without any internal modification in the file system, as a purely byte stream.

directory : Contains a list of file names and pointers to the index nodes associated with them. Directory file with special write-protected permissions for ordinary files, only the file system can write.

Special files: contains no data content and provides a mechanism for mapping physical devices to filenames.

Pipeline : A pipeline is the underlying device for process communication.

link file : An optional file name that links files that already exist.

Symbolic Link File : The data file that contains the file name of the linked file.


Index node

Linux supports multi-file systems, mapping all file systems to a unified lower-level system, where all Linux and UNIX are managed through index nodes by supporting file systems and allocating disk space to files. Each index node holds meta-information data for a file system object in the file system, but does not include data content or file names. .

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/97/4F/wKioL1ktIn7DL_keAABwnWPxE8I848.jpg-wh_500x0-wm_ 3-wmp_4-s_2827609233.jpg "title=" 4 file management. jpg "alt=" wkiol1ktin7dl_keaabwnwpxe8i848.jpg-wh_50 "/>

4k file system with block size

Level Number of blocks The size of the file area that can be indexed
Direct 12
48k
Level 1 512
2m
Level 2 512*512=256k 1G

Level 3 512*256k=128m
512G
View disk Inode and block information
[Email protected] yemo]# dumpe2fs/dev/sda1 |grep "block Count" Dumpe2fs 1.41.12 (17-may-2010) block count:51              2000[[email protected] yemo]# dumpe2fs/dev/sda1 |grep "inode count" Dumpe2fs 1.41.12 (17-may-2010) inode count: 128016

Catalog items

A directory is simply a combination of the name of the file and its index node number. table, each pair of file names and index nodes in the directory is called a connection. In the directory: A pointer to the parent directory index node, and a pointer to a subdirectory index node. For a file, there is a unique index node number corresponding to it, for an index node number, but can have more than one file name corresponding. Therefore, the same file on the disk can be accessed through a different path.

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/97/50/wKioL1ktLd_BSRUwAAAYMuyGevI372.png "title=" Drawing 1.png "alt=" Wkiol1ktld_bsruwaaaymuygevi372.png "/>

Symbolic links and Hard links


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/97/51/wKioL1ktPuSxEF7OAAA1MSMPeF8549.png "title=" Link. png "alt=" Wkiol1ktpusxef7oaaa1msmpef8549.png "/>

The difference between soft and hard links:

1) By default without parameters, the LN command creates a hard link.

2) The hard link file is the same as the Inode node number of the source file, and the Inode node number of the soft link file is different from the source file. 3) The LN command cannot create a hard link to a directory, but it can create soft links that are often used for soft links to directories.

4) Delete the soft link file, the source files and hard-linked files have no effect;
5) Delete Files hard link file, the source files and soft link files have no effect;
6) Delete the original file of the linked file, no impact on the hard-link file, will cause its soft link failure (red on white blinking);
7) Delete the original file and its hard link file, the whole file will be deleted.

8) The snapshot function in many hardware devices is similar to the principle of hard link.

9) Soft connection can cross file system, hard link can not cross file system.

This article is from the "Night Empty Watch Snow" blog, please be sure to keep this source http://12550795.blog.51cto.com/12540795/1930714

Linux file system 1 basic file types and Inode

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.