Why no file-name in Inode information?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I know that symlinks have a separated inode from the original file and that they only point for the inode containing the data. My question is, where is the hardlink name stored if there's no field in the inode structure refering to "name". I know that this could be a a relatively easy question, but as all hardlinks have the same inode number i assume that no inode is created when creating a hard link.







share|improve this question




















  • An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
    – user4556274
    Oct 16 '17 at 14:51














up vote
1
down vote

favorite












I know that symlinks have a separated inode from the original file and that they only point for the inode containing the data. My question is, where is the hardlink name stored if there's no field in the inode structure refering to "name". I know that this could be a a relatively easy question, but as all hardlinks have the same inode number i assume that no inode is created when creating a hard link.







share|improve this question




















  • An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
    – user4556274
    Oct 16 '17 at 14:51












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I know that symlinks have a separated inode from the original file and that they only point for the inode containing the data. My question is, where is the hardlink name stored if there's no field in the inode structure refering to "name". I know that this could be a a relatively easy question, but as all hardlinks have the same inode number i assume that no inode is created when creating a hard link.







share|improve this question












I know that symlinks have a separated inode from the original file and that they only point for the inode containing the data. My question is, where is the hardlink name stored if there's no field in the inode structure refering to "name". I know that this could be a a relatively easy question, but as all hardlinks have the same inode number i assume that no inode is created when creating a hard link.









share|improve this question











share|improve this question




share|improve this question










asked Oct 16 '17 at 14:35









laflame1x0

7018




7018











  • An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
    – user4556274
    Oct 16 '17 at 14:51
















  • An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
    – user4556274
    Oct 16 '17 at 14:51















An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
– user4556274
Oct 16 '17 at 14:51




An inode is allocated when creating the first hard link to that inode. No additional inodes are allocated when linking additional directory entries.
– user4556274
Oct 16 '17 at 14:51










1 Answer
1






active

oldest

votes

















up vote
4
down vote













The names for the file are stored in the directory.



In simple terms, a directory on Linux is just a mapping of names to inodes. When you use mv to rename/move a file, only the mappings in the directories change. This allows you to have hard links to the same inode with different names as long as the hard links are on the same file system partition.



More info here.






share|improve this answer






















  • Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
    – laflame1x0
    Oct 16 '17 at 14:52






  • 1




    There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
    – JdeBP
    Oct 16 '17 at 16:36










  • I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
    – laflame1x0
    Oct 18 '17 at 9:00






  • 1




    @laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
    – Munir
    Oct 18 '17 at 16:03










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398434%2fwhy-no-file-name-in-inode-information%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote













The names for the file are stored in the directory.



In simple terms, a directory on Linux is just a mapping of names to inodes. When you use mv to rename/move a file, only the mappings in the directories change. This allows you to have hard links to the same inode with different names as long as the hard links are on the same file system partition.



More info here.






share|improve this answer






















  • Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
    – laflame1x0
    Oct 16 '17 at 14:52






  • 1




    There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
    – JdeBP
    Oct 16 '17 at 16:36










  • I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
    – laflame1x0
    Oct 18 '17 at 9:00






  • 1




    @laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
    – Munir
    Oct 18 '17 at 16:03














up vote
4
down vote













The names for the file are stored in the directory.



In simple terms, a directory on Linux is just a mapping of names to inodes. When you use mv to rename/move a file, only the mappings in the directories change. This allows you to have hard links to the same inode with different names as long as the hard links are on the same file system partition.



More info here.






share|improve this answer






















  • Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
    – laflame1x0
    Oct 16 '17 at 14:52






  • 1




    There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
    – JdeBP
    Oct 16 '17 at 16:36










  • I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
    – laflame1x0
    Oct 18 '17 at 9:00






  • 1




    @laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
    – Munir
    Oct 18 '17 at 16:03












up vote
4
down vote










up vote
4
down vote









The names for the file are stored in the directory.



In simple terms, a directory on Linux is just a mapping of names to inodes. When you use mv to rename/move a file, only the mappings in the directories change. This allows you to have hard links to the same inode with different names as long as the hard links are on the same file system partition.



More info here.






share|improve this answer














The names for the file are stored in the directory.



In simple terms, a directory on Linux is just a mapping of names to inodes. When you use mv to rename/move a file, only the mappings in the directories change. This allows you to have hard links to the same inode with different names as long as the hard links are on the same file system partition.



More info here.







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 16 '17 at 14:51









Hunter.S.Thompson

4,54431334




4,54431334










answered Oct 16 '17 at 14:48









Munir

2,097419




2,097419











  • Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
    – laflame1x0
    Oct 16 '17 at 14:52






  • 1




    There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
    – JdeBP
    Oct 16 '17 at 16:36










  • I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
    – laflame1x0
    Oct 18 '17 at 9:00






  • 1




    @laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
    – Munir
    Oct 18 '17 at 16:03
















  • Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
    – laflame1x0
    Oct 16 '17 at 14:52






  • 1




    There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
    – JdeBP
    Oct 16 '17 at 16:36










  • I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
    – laflame1x0
    Oct 18 '17 at 9:00






  • 1




    @laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
    – Munir
    Oct 18 '17 at 16:03















Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
– laflame1x0
Oct 16 '17 at 14:52




Oh ok , i thought that there was some sort of index besides the directories to map names -> inodes. Thanks.
– laflame1x0
Oct 16 '17 at 14:52




1




1




There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
– JdeBP
Oct 16 '17 at 16:36




There is on some filesystems. NTFS, for example, contains a list of the file's names in each MFT entry. But on filesystem formats with mostly the traditional Unix design such as EXT, FFS, or UFS this is not the case.
– JdeBP
Oct 16 '17 at 16:36












I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
– laflame1x0
Oct 18 '17 at 9:00




I'm sorry to bother you again but i came up with a new question. "." (current directory) and ".." (parent directory) have to be alias defined in each inode right? Where's it defined?
– laflame1x0
Oct 18 '17 at 9:00




1




1




@laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
– Munir
Oct 18 '17 at 16:03




@laflame1x0 . and .. are just links to the current and parent directory. They are also stored in the directory just like all other links. Here is a more detailed description of the directory structure for ext family of file systems
– Munir
Oct 18 '17 at 16:03

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398434%2fwhy-no-file-name-in-inode-information%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)