Hard and soft connections for Linux file systems

Source: Internet
Author: User

Hard and soft connections to the Title:linux file system
date:2018-02-06t20:26:25+08:00
Tags: ["File System"]
Categories: ["Linux"]

To better illustrate what the file links are, let's start by talking about how Linux is managed on disk.

The file system format of Linux is called Extn (n=2,3,4), is a file system based on Inode (index node), is a data structure of all UNIX-like systems is also the core of the file system, each newly created file will be assigned an inode, And each file has a unique inode number. The inode can be simply interpreted as a pointer to the physical location where the file resides, and the attributes of the file are also stored in the inode.

Extn file system Read data process

The inode is just the location where the file is saved, and the actual file is saved in the data block area.
The Inode numbered 3 is a link to the file.
When we use the ls -l command to view the file information, where the number of connections is the number of inode, we can ln establish a hard link for the same file to establish multiple connections, it can make the same file can have a different path, and can be malicious delete, but there are the following points to note:

    • Using a ln hard link is a direct reference to the inode of the target file, and all attributes, including the file's permission information, are also referenced together.
    • It just replicates the inode, does not replicate the data block information, so the extra disk footprint is small, but also makes the hard link only available in the same partition.

To establish a soft connection needs to add -s parameters, the soft connection equivalent to Windows shortcuts, can be built in any location, and the target Inode file attributes are not the same, there is no connection number +1, and can not play the role of backup, delete the original file after the soft connection will be invalidated.

Hard and soft connections for Linux file systems

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.