Linux file access the difference between soft and hard joins

Source: Internet
Author: User

First, the Linux file access process

The root directory in the Linux system is self-referencing, for example, to find/etc/sysconfig/networkscripts/ifcfg-0 files

First locate the storage/disk block in the Inode table based on the root directory/inode number, find the inode number for the directory in the disk block (a table that stores a file name or the inode number corresponding to the directory name in the disk block), and then in the Inode The disk block corresponding to the ETC directory is found in table according to the inode number of the etc. Then found in the disk block directory sysconfig corresponding Inode, and then according to Sysconfig Inode to the Inode table to find the corresponding disk block Sysconfig, after a similar process to find the ifcfg-0 file.

The root directory/and the ETC directory can belong to different partitions. ETC information is stored in the root directory/partition, but the files in the ETC directory are stored in the ETC partition.

Second, the difference between soft links and hard links

Soft Link: The inode number of one file corresponds to the file name of another file. Can be applied to the directory, can cross the file system, does not increase the number of links, its size is the number of path characters pointing to the file.

Hard links: points to different paths to the same inode. You can only hard-link files, you cannot cross the file system, and creating hard links increases the number of links to the file.

Linux file access the difference between soft and hard joins

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.