Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find all hardlinks

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
WHich command would I use to find all hardlinked folders on my system ?

Thanks

Long live king Moshiach !
 
Moshiach,
I'm not sure if I understand what you are asking. By "folders" I assume you mean directories and directories cannot be hard linked. You can find files with multiple hard links with a find command like the following:

find / -type f -links +1

Sorry if that's not what you are looking for.

-Usige
 
usige said:
directories cannot be hard linked

Not entirely true... all directories have at least 2 hardlinks: their name in their parent dir and the "." name in the dir itself. Dirs with subdirs get an extra hardlink for each subdir: the ".." name in those subdirs.

You are partly right: it is impossible to manually create a hardlink to another directory, other than the ".." name in a newly created subdir.


HTH,

p5wizard
 
Thanks all.

What actually is happening - My AIX 5.2 machine occasionally gets errpt entries like:

LABEL: JFS_USER_HARDLINK
IDENTIFIER: 5ECE4A58

Date/Time: Mon Nov 7 18:47:20 2005
Sequence Number: 15471
Machine Id: 0042295C4C00
Node Id: brisque06
Class: O
Type: INFO
Resource Name: SYSPFS

Description
INAPPROPRIATE FILE SYSTEM OPERATION

User Causes
DIRECTORY HARD LINK CREATED OR REMOVED

Recommended Actions
REVIEW DETAILED DATA

Detail Data
DETECTING MODULE
jfs_remove
MAJOR/MINOR DEVICE NUMBER
002D 0001
INODE NUMBER
2179106
DIRECTORY
GB_211087_NOIR_brisque06.Store.temp


This a basically a NFS+Appletalk server,with a Java Server on it.


Long live king Moshiach !
 
I'd do a find -inum 2179106 on the filesystem to identify the dir in question.

You can identify the filesystem with major device=45, minor device=1 in an ls -l /dev listing.

Perhaps someone in trying to unlink a ".." or "." entry?


HTH,

p5wizard
 
Thanks,

I did exactly this already,and it's always directories of the kind "GB_211087_NOIR_brisque06.Store.temp" ,which are not found later on.

Long live king Moshiach !
 
My guess it's the client application which is creating temp dirs and then removing 'em by unlink-ing, instead of using "rmdir" or "rm -r"?

See if you can find unreferenced files (temp dir orphans) or other discrepancies by running an fsck on the FS when you get a chance to unmount it.


HTH,

p5wizard
 
Right,

I do find these dirs in lost+found later on...
We did search our whole code,have found no hard link/unlink events.

Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top