Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   EXT3 Users (http://www.linux-archive.org/ext3-users/)
-   -   inode and filesystem question (http://www.linux-archive.org/ext3-users/114998-inode-filesystem-question.html)

"Mag Gam" 06-28-2008 04:13 AM

inode and filesystem question
 
While reading for fun, I noticed inode does not carry filename. I always though it did. I read that it is carried by the directory structure and the kernel interpolates it. Can someone please explain this to me

TIA




_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Bruno Wolff III 06-28-2008 04:22 AM

inode and filesystem question
 
On Sat, Jun 28, 2008 at 00:13:30 -0400,
Mag Gam <magawake@gmail.com> wrote:
> While reading for fun, I noticed inode does not carry filename. I always
> though it did. I read that it is carried by the directory structure and the
> kernel interpolates it. Can someone please explain this to me

A file can have more than one name. You can read up on "hard link" for
more information.

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

"Mag Gam" 06-28-2008 11:39 AM

inode and filesystem question
 
Well, I guess this is more for a theoretical question. How the filename is determined if its not in the inode.



On Sat, Jun 28, 2008 at 12:22 AM, Bruno Wolff III <bruno@wolff.to> wrote:

On Sat, Jun 28, 2008 at 00:13:30 -0400,

*Mag Gam <magawake@gmail.com> wrote:

> While reading for fun, I noticed inode does not carry filename. I always

> though it did. I read that it is carried by the directory structure and the

> kernel interpolates it. Can someone please explain this to me



A file can have more than one name. You can read up on "hard link" for

more information.



_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Alex Bligh 06-28-2008 11:54 AM

inode and filesystem question
 
--On 28 June 2008 07:39:55 -0400 Mag Gam <magawake@gmail.com> wrote:


Well, I guess this is more for a theoretical question. How the filename
is determined if its not in the inode.


It isn't. There is no easy way to get back from an inode number to a
filename (or filenames, as there can be more than one - think how hard
links work, multiple directory entries (and hence filenames) pointing to
one inode) apart from recurse through the entire directory tree and find
which directory entries contain that inode number. That's because there
is (fsck type operations apart) in general no need to go from an inode
number to the list of directory entries that point to it. Indeed some
inodes can have no directory entry pointing to them (e.g. if you
open a file, then unlink it (with rm) before closing it).

This isn't ext3 specific, this is the way UNIX file systems work. I suggest
doing some background reading on UNIX filesystems in general rather than
asking on an ext3 specific list. For a very simple intro see:
http://en.wikipedia.org/wiki/Inode

Alex

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

"David Schwartz" 06-28-2008 06:02 PM

inode and filesystem question
 
> Well, I guess this is more for a theoretical question.
> How the filename is determined if its not in the inode.

Simple, files don't have names. Directory entries do. A directory entry's name is stored in the directory entry, along with the inode number of the file it references.

This is the UNIX way, love it or hate it.

DS



_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

Bruno Wolff III 06-29-2008 01:37 PM

inode and filesystem question
 
On Sat, Jun 28, 2008 at 07:39:55 -0400,
Mag Gam <magawake@gmail.com> wrote:
> Well, I guess this is more for a theoretical question. How the filename is
> determined if its not in the inode.

Filenames are matched to inodes in the directory blocks. (I am assuming
that's the question you meant to ask. The phrasing of your question is a bit
odd and you may have really been asking a different question.)

_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users

"Mag Gam" 06-29-2008 05:14 PM

inode and filesystem question
 
Thanks Bruno. Thats exactly what I was asking.

Some people got angry at me for asking here since its a "basic" Unix question.* Sorry about that


On Sun, Jun 29, 2008 at 9:37 AM, Bruno Wolff III <bruno@wolff.to> wrote:

On Sat, Jun 28, 2008 at 07:39:55 -0400,

*Mag Gam <magawake@gmail.com> wrote:

> Well, I guess this is more for a theoretical question. How the filename is

> determined if its not in the inode.



Filenames are matched to inodes in the directory blocks. (I am assuming

that's the question you meant to ask. The phrasing of your question is a bit

odd and you may have really been asking a different question.)



_______________________________________________
Ext3-users mailing list
Ext3-users@redhat.com
https://www.redhat.com/mailman/listinfo/ext3-users


All times are GMT. The time now is 08:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.