Hardlinked files does not share inode


ikosa

Recommended Posts

root@Tower:/mnt/user/No_move# mkdir test
root@Tower:/mnt/user/No_move# cd test
root@Tower:/mnt/user/No_move/test# touch a
root@Tower:/mnt/user/No_move/test# ln a b
root@Tower:/mnt/user/No_move/test# ls -i
7288342 a  7288343 b

Why in unraid hardlinked files does not share the same inode? I'm not a linux expert but i guess this means they are not hardlinks am i right? But when you check second column in ls -l seems like they are linked :S 

root@Tower:/mnt/user/No_move/test# ls -l
total 0
-rw-rw-rw- 2 root root 0 Sep  5 14:34 a
-rw-rw-rw- 2 root root 0 Sep  5 14:34 b

When i make the same test in a docker container they share the same inode:

root@66f7cacf879c:/root/test# touch a
root@66f7cacf879c:/root/test# ln a b
root@66f7cacf879c:/root/test# ls -i
8846 a  8846 b

 

My real purpose is to  find a files hardlinked copy or check its existance, but i cant do that because of the changed inode.

Link to comment
2 hours ago, testdasi said:

Hard links can's span physical volume. Potentially you have a in 1 disk and b in another disk.

Thanks for your help. At first it make sense but arter i remember that the test i send at the above post was in the cache disk and cache only share. 

 

So i check again but now I am confused :s more than before with the result below:

Quote

root@Tower:/mnt/cache/No_move/test# ls -i /mnt/user/No_move/test
7288342 a  7288343 b
root@Tower:/mnt/cache/No_move/test# ls -i /mnt/cache/No_move/test
2690930 a  2690930 b

Link to comment
37 minutes ago, ikosa said:

Thanks for your help. At first it make sense but arter i remember that the test i send at the above post was in the cache disk and cache only share. 

 

So i check again but now I am confused :s more than before with the result below:

 

I suspect this is due to the fact that the first command is a reference to the physical drive while the second is going through the Fuse file system that is used to implement User Shares.

 

I suspect that is also the underlying cause to the "User Share Bug" bug where the system does not recognise that both paths refer to the same file.

Edited by itimpi
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.