Hi All,

I am facing a problem where link count is not getting properly updated in
the debugfs. I am using e2fsprogs.

[EMAIL PROTECTED] debugfs]# mkfs -t ext2 /dev/ram0
mke2fs 1.40.10 (21-May-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
4096 inodes, 16384 blocks
819 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=16777216
2 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
        8193

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[EMAIL PROTECTED] debugfs]# ./debugfs -w /dev/ram0
debugfs 1.40.10 (21-May-2008)

debugfs:  ls
 2  (12) .    2  (12) ..    11  (1000) lost+found

debugfs:  write /home/prasad/.vimrc a
Allocated inode: 12
debugfs:  stat a
Inode: 12   Type: regular    Mode:  0664   Flags: 0x0   Generation: 0
User:     0   Group:     0   Size: 46
File ACL: 0    Directory ACL: 0
*Links: 1  * Blockcount: 2
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x483f95e8 -- Fri May 30 11:21:36 2008
atime: 0x483f95e8 -- Fri May 30 11:21:36 2008
mtime: 0x483f95e8 -- Fri May 30 11:21:36 2008
BLOCKS:
(0):338
TOTAL: 1

debugfs:  ln a a1

debugfs:  stat a
Inode: 12   Type: regular    Mode:  0664   Flags: 0x0   Generation: 0
User:     0   Group:     0   Size: 46
File ACL: 0    Directory ACL: 0
*Links: 1  * Blockcount: 2
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x483f95e8 -- Fri May 30 11:21:36 2008
atime: 0x483f95e8 -- Fri May 30 11:21:36 2008
mtime: 0x483f95e8 -- Fri May 30 11:21:36 2008
BLOCKS:
(0):338
TOTAL: 1

debugfs:  stat a1
Inode: 12   Type: regular    Mode:  0664   Flags: 0x0   Generation: 0
User:     0   Group:     0   Size: 46
File ACL: 0    Directory ACL: 0
*Links: 1  * Blockcount: 2
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x483f95e8 -- Fri May 30 11:21:36 2008
atime: 0x483f95e8 -- Fri May 30 11:21:36 2008
mtime: 0x483f95e8 -- Fri May 30 11:21:36 2008
BLOCKS:
(0):338
TOTAL: 1

debugfs:  ln a a2

debugfs:  ls -l
      2   40755 (2)      0      0    1024 30-May-2008 11:21 .
      2   40755 (2)      0      0    1024 30-May-2008 11:21 ..
     11   40700 (2)      0      0   12288 30-May-2008 11:21 lost+found
*     12  100664 (1)      0      0      46 30-May-2008 11:21 a
     12  100664 (1)      0      0      46 30-May-2008 11:21 a1
     12  100664 (1)      0      0      46 30-May-2008 11:21 a2
*
debugfs:  stat a
Inode: 12   Type: regular    Mode:  0664   Flags: 0x0   Generation: 0
User:     0   Group:     0   Size: 46
File ACL: 0    Directory ACL: 0
*Links: 1  * Blockcount: 2
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x483f95e8 -- Fri May 30 11:21:36 2008
atime: 0x483f95e8 -- Fri May 30 11:21:36 2008
mtime: 0x483f95e8 -- Fri May 30 11:21:36 2008
BLOCKS:
(0):338
TOTAL: 1

debugfs:

Why the link count is always showing 1 eventhough I have created 2 links to
the file? Am I doing some mistake?

Thanks and Regards,
Prasad.

Reply via email to