Find the answer to your Linux question:
Results 1 to 6 of 6
Yesterday I was a good girl and finally did my full system backups using fsarchiver. This program provides some interesting statistics about the partition on completion: number of files, number ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,220

    A question about hard links


    Yesterday I was a good girl and finally did my full system backups using fsarchiver. This program provides some interesting statistics about the partition on completion: number of files, number of directories, number of links, etc.

    I noticed that for my Arch partition, there were 9959 directories but only 1492 hard links. For Slackbody the numbers were 9429 and 3309. Now I can understand that the first hard link for each file is probably not counted as that is just the filename, but every directory has at least a second link (to the dot file) and many have additional links. So why is the reported number of links so low?
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,599
    Well Hazel, I'm not sure about your specific situation, but hard links have to be to a file/directory (directories are more restricted) in the same file system. IE, you can't have hard links to nodes on other devices or partitions. I don't know if this is the source of your "problem", but it may be.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,220
    Quote Originally Posted by Rubberman View Post
    Well Hazel, I'm not sure about your specific situation, but hard links have to be to a file/directory (directories are more restricted) in the same file system. IE, you can't have hard links to nodes on other devices or partitions. I don't know if this is the source of your "problem", but it may be.
    No, that isn't it. I have only one partition for each of my two Linux systems plus a common data partition, which is not included in these statistics. And, as far as I know, all the links in Arch were made during installation. I don't usually make additional hard links, though I do make soft ones sometimes.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,599
    Quote Originally Posted by hazel View Post
    No, that isn't it. I have only one partition for each of my two Linux systems plus a common data partition, which is not included in these statistics. And, as far as I know, all the links in Arch were made during installation. I don't usually make additional hard links, though I do make soft ones sometimes.
    Yeah, knowing that you aren't exactly a noob with this stuff I was afraid of something like that. Sorry, but paint me clueless here, unless I can get some more data about your file systems. I just made the best suggestion I could under the circumstances.

    Hard links are good when you want the file to stay around if one of the instances is removed from the system, since a hard link increments the inode link count, whereas soft links don't.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,288
    Hi.

    I'm guessing that only plain file hard links are being counted. One could run the find utility, filter for plain files, and look at the counts for unique inodes.

    That would make sense to me because non-root users cannot hard-link directories, so less of a reason to count them.

    In other words, ignore all directory counts. I'll try that if I get some time ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  6. #6
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,220
    Annoyingly I don't have Arch any more so I can't do that test, but I've just done it on AntiX and I got more or less what I expected:
    Directories 3910
    Extra hard links 3928

    In other words most hard links are due to directories. There were only 18 from regular files. So I think drl is probably right and the small number of links reported for Arch was for regular files only.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •