A Question on inode - ext3FS

lakshmi pathi lakshmipathi.g at gmail.com
Thu Nov 27 03:17:56 UTC 2008


>It's an application issue.

Thank you all.Here is detailed info. of what i did:

I have created two files file7 and file8 using vi :
[root at localhost ~]# vi file7
[root at localhost ~]# vi file8

and added content "this "
and here is the ls output :

[root at localhost ~]# ls -il file7
6933339 -rw-r--r-- 1 root root 5 2008-11-26 20:56 file7
[root at localhost ~]# ls -il file8
6933340 -rw-r--r-- 1 root root 5 2008-11-26 20:56 file8

Now i changed the permission for file8 :
[root at localhost ~]# chmod 777 file8
[root at localhost ~]# ls -il file8
6933340 -rwxrwxrwx 1 root root 5 2008-11-26 20:56 file8


(After changing chmod inode remains same,since file8 data block are
not modified.)

Now i added / appended new character to both files using vi command

[root at localhost ~]# vi file7
[root at localhost ~]# ls -il file7
6933311 -rw-r--r-- 1 root root 7 2008-11-26 20:58 file7

As expected size and timestamp are updated . And along with inode
numbers.(Earlier it was 6933339 -- now it is 6933311)

[root at localhost ~]# vi file8
[root at localhost ~]# ls -il file8
6933340 -rwxrwxrwx 1 root root 7 2008-11-26 20:58 file8
[root at localhost ~]#

But see here ,the inode remains the same(6933340) - though the content
is modified

Is

Now i changed the file mode to 644 :

[root at localhost ~]# chmod 644 file8
[root at localhost ~]# ls -il file8
6933340 -rw-r--r-- 1 root root 7 2008-11-26 20:58 file8

and appended a new character

[root at localhost ~]# ls -il file8
6933451 -rw-r--r-- 1 root root 8 2008-11-26 21:07 file8
...now the inode is also changed.(from 6933340 to 6933451)


My doubts are :
1)Does files permission play any role in determining inode number of
file when it's getting editted?
2)How application can decide on whether new inode / older inode,so far
i thought it depends on functionality of filesystem/kernel.
(I found edit files using different application like gedit doesn't
change the inode.but vi changes inodes)

(I have written little ext3 undelete tools,understanding these
concepts will help me lot,If my assumption are wrong please correct
me.)

-- 
Cheers,
Lakshmipathi.G




More information about the Ext3-users mailing list