LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-25-2005, 05:34 AM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
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?
 
Old 11-25-2005, 12:01 PM   #2
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
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.
 
Old 11-26-2005, 08:10 AM   #3
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
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...
 
Old 11-26-2005, 12:27 PM   #4
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
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.
 
Old 11-26-2005, 12:53 PM   #5
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Original Poster
Rep: Reputation: 30
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.
 
Old 11-26-2005, 01:32 PM   #6
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
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.
 
Old 11-27-2005, 01:27 PM   #7
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Use fsck to verify the filesystem's integrity.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 12:15 AM
Can`t find C-compiler in Debian ,or at least can`t find one that can make executables hemmelig Linux - Software 4 05-26-2008 03:07 AM
Cd image with hardlinks kvtournh Linux - Software 2 08-27-2006 05:22 AM
Lotsa help please... bf84 Linux - Newbie 2 09-28-2003 07:48 AM
NetBSD vulnerabilities Sep 17, lotsa... unSpawn *BSD 5 10-15-2002 03:59 PM


All times are GMT -5. The time now is 03:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration