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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSA Links

Status
Not open for further replies.

Germo

Technical User
Mar 29, 2004
123
GB
Me Again,

I have a system that for about three years has LV linked to data (informix LV's RAW) with the command used

ln rinfck001 data_ids1

Over the last 6 month I have changed this to run

ln -s rinfck001 data_ids1

instead so that I can see what is link to what, the problem I am having that all links done before I changed it don't show me what is linked to what (no "-->" next to the file), is there a way I can get this info?

Thanks
 
Correction...

It is not actually SSA Links more like file links.
 

# ln test hl_test
# ls -al *test
-rw-r--r-- 2 root system 0 Nov 22 11:52 hl_test
-rw-r--r-- 2 root system 0 Nov 22 11:52 test
# istat hl_test
Inode 11 on device 10/8 File
Protection: rw-r--r--
Owner: 0(root) Group: 0(system)
Link count: 2 Length 0 bytes

Last updated: Tue Nov 22 11:52:29 CUT 2005
Last modified: Tue Nov 22 11:52:04 CUT 2005
Last accessed: Tue Nov 22 11:52:04 CUT 2005

# find /home -i 11
/home/test
/home/hl_test

where 11 is the inode number.

But I am sure there mast be an easier way...
 
of course inode number you can get using ls command:

# ls -i *test
11 hl_test 11 test
 
In a ls -l listing of /dev you can look for the same major and minor device number.

Try sth. like this:
Code:
INFDISK=data_ids1
maj=$(ls -l /dev/${INF_DISK}|awk '{print $5}')
min=$(ls -l /dev/${INF_DISK}|awk '{print $6}')

ls -ld /dev/c*|grep "${maj}  *${min}"

HTH,

p5wizard
 
Given a filesystem "/fs",

Code:
find /fs -xdev -exec ls -i {} \; | sort -n

will give you a listing of the filesystem, sorted by inode number. Any two (or more) files having the same inode number are hard linked, and will be adjacent in the list. The -xdev switch restricts the find to the given filesystem, since inodes are only unique within a single filesystem.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top