Home linux Is inode spend when creating a hard link (Hard Link)?

Is inode spend when creating a hard link (Hard Link)?

Author

Date

Category

Is inode spend when creating a hard link (Hard Link)?
If so, why do you spend?


Answer 1, Authority 100%

Create a file link named HardLink1, which will indicate the already existing File1 file:

$ ln file1 hardlink1

What would make sure that in essence both files are the same file system object – compare their inode number, in this case – this is number 475949:

$ ls -lih | Grep 475949.
475949 -RW-R - R-- 2 Root Setevoy 0B Aug 13 11:51 File1
475949 -RW-R - R-- 2 Root Setevoy 0B Aug 13 11:51 HardLink1

As you can see – both files with different names, but have a common inode.

At the time of creating a rigid link using the LN utility, an additional entry is added to the directory file. The new file name is put in accordance with the existing structure inode.
The inode structure contains a counter used to count the number of hard links to it. At a time when the meter value decreases to zero, the contents of the inode structure is cleared.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions