Data storage: Hard links and soft links (symbolic links)

Source: Internet
Author: User

Reference from: http://www.ruanyifeng.com/blog/2011/12/inode.html

Suppose a txt text content is "Hello World" with an inode number of 123456:

Hard Link: Multiple file names (file paths) point to the same inode in the disk.

1) You can access the same content with a different file name;

2) changes to the contents of the file will affect all file names;

3) Deleting a filename does not affect access to another file name.

Note : The file Inode records its own number of hard links (Inode hard link number is 2), and if the number of hard links becomes 0, the disk will reclaim the inode and its corresponding blocks (that is, the deletion of the file).

Soft Link (soft link) or symbolic link (symbolic Link): The content of file A is the path of file B, then a is a soft link of B.

1) A is a file, it has its own inode and data block, its data block content is the path of B;

2) The system obtains the path of B according to the content of a, then obtains the inode of B through the path, and accesses its data;

3) If you delete B, you will not be able to access B through a (b is not how to access, this is not taken for granted ^ ^).

Data storage: Hard links and soft links (symbolic links)

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.