Hi,
ich war bisher immer der Meinung, dass Hard Links, auch wenn sie auf die gleichen Datenblöcker zeigen, unterschiedliche Inode Numbers haben. Das ist offensichtlich nicht so:
Und scheinbar sind auch die timestamps der Inodes zwingend gleich?
Also sehe ich das richtig, dass Hard Links keine eigenen Inodes sind sondern Inodes nur "pro File / Directory" existieren und ein Hard Links quasi eher als der Eintrag des Files im Directory zu sehen ist?
Falls ich es jetzt endlich verstanden haben sollte, bitte kurz bestätigen
cu
serow
ich war bisher immer der Meinung, dass Hard Links, auch wenn sie auf die gleichen Datenblöcker zeigen, unterschiedliche Inode Numbers haben. Das ist offensichtlich nicht so:
Code:
mathias@wizard:/tmp/test$ echo "my file" > file1
mathias@wizard:/tmp/test$ ln file1 file2
mathias@wizard:/tmp/test$ ls -l
total 8
-rw-r--r-- 2 mathias mathias 8 2009-04-18 16:38 file1
-rw-r--r-- 2 mathias mathias 8 2009-04-18 16:38 file2
mathias@wizard:/tmp/test$ cat file2
my file
mathias@wizard:/tmp/test$ cat file1
my file
mathias@wizard:/tmp/test$ stat file1
File: `file1'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:38:34.000000000 +0200
Modify: 2009-04-18 16:38:23.000000000 +0200
Change: 2009-04-18 16:38:27.000000000 +0200
mathias@wizard:/tmp/test$ stat file2
File: `file2'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:38:34.000000000 +0200
Modify: 2009-04-18 16:38:23.000000000 +0200
Change: 2009-04-18 16:38:27.000000000 +0200
mathias@wizard:/tmp/test$
Und scheinbar sind auch die timestamps der Inodes zwingend gleich?
Code:
mathias@wizard:/tmp/test$ stat file1
File: `file1'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:41:16.000000000 +0200
Modify: 2009-04-18 16:41:16.000000000 +0200
Change: 2009-04-18 16:41:16.000000000 +0200
mathias@wizard:/tmp/test$ stat file2
File: `file2'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:41:16.000000000 +0200
Modify: 2009-04-18 16:41:16.000000000 +0200
Change: 2009-04-18 16:41:16.000000000 +0200
mathias@wizard:/tmp/test$ date
Sat Apr 18 16:42:02 CEST 2009
mathias@wizard:/tmp/test$ touch file2
mathias@wizard:/tmp/test$ stat file1
File: `file1'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:42:05.000000000 +0200
Modify: 2009-04-18 16:42:05.000000000 +0200
Change: 2009-04-18 16:42:05.000000000 +0200
mathias@wizard:/tmp/test$ stat file2
File: `file2'
Size: 8 Blocks: 8 IO Block: 4096 regular file
Device: 807h/2055d Inode: 23000 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 1000/ mathias) Gid: ( 1000/ mathias)
Access: 2009-04-18 16:42:05.000000000 +0200
Modify: 2009-04-18 16:42:05.000000000 +0200
Change: 2009-04-18 16:42:05.000000000 +0200
Also sehe ich das richtig, dass Hard Links keine eigenen Inodes sind sondern Inodes nur "pro File / Directory" existieren und ein Hard Links quasi eher als der Eintrag des Files im Directory zu sehen ist?
Code:
mathias@wizard:/tmp/test$ ls -i
23000 file1 23000 file2
mathias@wizard:/tmp/test$
Falls ich es jetzt endlich verstanden haben sollte, bitte kurz bestätigen
cu
serow