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.
- 10-17-2012 #1
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!"
- 03-02-2013 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,142
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!
- 03-03-2013 #3
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!"
- 03-03-2013 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,142
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!
- 03-03-2013 #5Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,199
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, drlWelcome - 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 )
- 03-04-2013 #6
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!"


Reply With Quote

