HI Mario

Thanks for your reply, I understand was an inode is and have had a lot of experience with UNIX filesystems. My question in more to do with the implications of having duplicate inodes in systems out in the field and what possible problems might arise. The systems we run control very heavy and expensive equipment and I would not want anything going wrong and someone possible getting hurt. If you can give me anymore info on what possible side effects might occour I would be very grateful.

Regards

Graham Watson | Software Engineer
Waukesha Magnetic Bearings
Downlands Business Park, Lyons Way, Worthing
West Sussex BN14 9LA United Kingdom
Mobile: +44 (0)7762 541863 | Office: +44 (0)1903 275543
gwatson@waukbearing.com
www.waukbearing.com
  Please consider the environment before you print.  

-----Original Message-----
From: Mario Beaulieu [mailto:community-noreply@qnx.com]
Sent: 15 January 2013 14:22
To: general-filesystems
Subject: Re: Effect of Duplicate inode numbers in resource managed files

The inode is a filesystem data structure that represents a file (its location on disk, owner, permissions, etc).
If 2 "files" on the same partition have the same inode, they are actually 2 names for the same file.

You can create many names for the same file with the command "ln".
When you do "ls -l", the first value after the permissions is the number of files pointing to that inode, or should I say, the number of filenames corresponding to that file.
Below, I have created file "myfile" and the link number is 1.
After creating a second name for that same file with command "ln", we see that the number of links is 2 for each of those:

# echo "Hello" > myfile
# ls -l
total 1
-rw-rw-r-- 1 root nto 6 Jan 15 09:07 myfile
# ln myfile AnotherLinkToMyFyle
# ls -l
total 2
-rw-rw-r-- 2 root nto 6 Jan 15 09:07 AnotherLinkToMyFyle
-rw-rw-r-- 2 root nto 6 Jan 15 09:07 myfile
# echo "Hello again" > otherFile
# ls -l
total 3
-rw-rw-r-- 2 root nto 6 Jan 15 09:07 AnotherLinkToMyFyle
-rw-rw-r-- 2 root nto 6 Jan 15 09:07 myfile
-rw-rw-r-- 1 root nto 12 Jan 15 09:12 otherFile
#

See the inode number like the page number in a book. In addition to the inode, you have to check the partition. Inodes on different partitions are completely unrelated, like page numbers on 2 different books.




_______________________________________________

General
http://community.qnx.com/sf/go/post98567
To cancel your subscription to this discussion, please e-mail general-filesystems-unsubscribe@community.qnx.com
Waukesha Bearings Limited is a limited company registered in England and Wales.
Registered number: 4203526. Registered office: 53-55 The Broadway, Joel Street, Northwood, Middlesex, HA6 1NZ
PLEASE NOTE! This message (and any associated files) is intended only for the use of the individual or entity to which it is addressed and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored.