LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Lotsa hardlinks - how do I find the others? (https://www.linuxquestions.org/questions/linux-general-1/lotsa-hardlinks-how-do-i-find-the-others-386361/)

humbletech99 11-25-2005 05:34 AM

Lotsa hardlinks - how do I find the others?
 
I've inherited a machine with a hard link with massive counts like 78 and I need to know where the other ones are. Anybody know how to find the others?

ioerror 11-25-2005 12:01 PM

Find the inode of one of the links with ls -i. Then use find /path -inum <inode number> to list all files with the same inode.

humbletech99 11-26-2005 08:10 AM

I tried that but nothing else turned up not even when searching the entire root filesystem. Makes me wonder if a script is running rampant somewhere (we have lots of scripts). Maybe one creates hardlinks and they were gotten rid of or something but the hard link count was not effected...

ioerror 11-26-2005 12:27 PM

Quote:

I tried that but nothing else turned up not even when searching the entire root filesystem.
That's weird. How many partitions do you have? inodes are specific to a filesystem. If you have more than one partition, you need to specify a path that is on the affected filesystem.

Quote:

Maybe one creates hardlinks and they were gotten rid of or something but the hard link count was not effected...
Only if there's a bug in the filesystem driver.

humbletech99 11-26-2005 12:53 PM

quite a lot, that's why I originally used -xdev and searched only the same filesystem, but then to make sure I did it again with the whole root filesystem to make sure that I wasn't missing something obvious. Still no luck.

ioerror 11-26-2005 01:32 PM

Hmm, not sure what to suggest then. I suppose you could do something like 'ls -ilR / | sort | less' and eyeball the output to see if anything pops out at you. I'm not sure offhand which field would be first with -ilR (using a winduff box atm so can't check); of course you'd want to sort by inode.

eddiebaby1023 11-27-2005 01:27 PM

Use fsck to verify the filesystem's integrity.


All times are GMT -5. The time now is 04:31 PM.