Why no file-name in Inode information?

Clash 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.
inode
add a comment |Â
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.
inode
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
add a comment |Â
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.
inode
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.
inode
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
add a comment |Â
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
add a comment |Â
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.
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 forextfamily of file systems
â Munir
Oct 18 '17 at 16:03
add a comment |Â
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.
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 forextfamily of file systems
â Munir
Oct 18 '17 at 16:03
add a comment |Â
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.
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 forextfamily of file systems
â Munir
Oct 18 '17 at 16:03
add a comment |Â
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.
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.
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 forextfamily of file systems
â Munir
Oct 18 '17 at 16:03
add a comment |Â
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 forextfamily 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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