Operating System - HP-UX
1833762 Members
2188 Online
110063 Solutions
New Discussion

Help! how to find out who is holding this link file?

 
zhaogui
Super Advisor

Help! how to find out who is holding this link file?

#ll /interface
lrwxrwxrwx 1 root root 20 Feb 24 03:55 /interface
#fuser /interface
/interface: stat: I/O error
fuser: could not find or access file /interface.
#rm /interface
rm: /interface not removed. Device busy

May I know how can I find out which process is holding this link file?
Thanks,

11 REPLIES 11
Kenny Chau
Trusted Contributor

Re: Help! how to find out who is holding this link file?

First, you have to find out the exact mount point of the linking of /interface. Use ll /interface to capture the linking after the -> at the end of the line.
Then use

# fuser -u ....... <- the exact mount point

to get the information. Then use

# fuser -k

to kill the process id. Then try to umount the mount point.

Hope this helps.
Kenny.
Kenny
zhaogui
Super Advisor

Re: Help! how to find out who is holding this link file?

I believe the link file is corrupted, That's why I can't see the link symbol "->" after the link file name.
Any solution besides reboot?

#fuser -u /interface
/interface: stat: I/O error
fuser: could not find or access file /interface.
#rm /interface
rm: /interface not removed. Device busy

Andreas Voss
Honored Contributor

Re: Help! how to find out who is holding this link file?

Hi,

this could be a nfs mount (Version 2) which cannot be satisfied.
Check with bdf or mount if this is the case.
You could also look in /etc/auto_master if this is a automounted entry.

Regards
Roger Baptiste
Honored Contributor

Re: Help! how to find out who is holding this link file?

hi,

do bdf /interface to see where it is mounted. If it is NFS , then it could be a issue with mount.

try lsof /interface too. Lsof is a free tool .

HTH
raj
Take it easy.
H.Merijn Brand (procura
Honored Contributor

Re: Help! how to find out who is holding this link file?

Most simple:

# fuser -c -u /usr

-c to see which processes are using this mounted device wherever in the tree

# lsof -f /usr
Enjoy, Have FUN! H.Merijn
Jason VanDerMark
Trusted Contributor

Re: Help! how to find out who is holding this link file?

Many may disagree with what I am about to write, but if it is an unsatisfied nfs process, it is useless to the system. In this case I would vi your /etc/mnttab and find the entry for this mount point and remove it, then save the file. This space will no longer show as mounted to the system and you will be able to attempt to remount it as needed. I have had no problems with this method. I hope that this helps, and please assign points to all the great people who have offered advice.

Regards,
Jason V.
Tie two birds together, eventhough they have four wings, they cannot fly.
Jason VanDerMark
Trusted Contributor

Re: Help! how to find out who is holding this link file?

Ooops, I just noticed that this is a link file. In this case simply try:

fuser -f /interface

or simply use:

fuser -fk /interface

and then delete it.


I hope that this helps.

Regards,
Jason V.
Tie two birds together, eventhough they have four wings, they cannot fly.
Magdi KAMAL
Respected Contributor

Re: Help! how to find out who is holding this link file?

Hi,

#fuser -cu

will give you who are on the file.

Magdi
Magdi KAMAL
Respected Contributor

Re: Help! how to find out who is holding this link file?

Hi again,

Be sure that your working directory of the actual session is not in the /interface directory !

It's the case in most time.

Magdi
Mark van Hassel
Respected Contributor

Re: Help! how to find out who is holding this link file?

Hi,

If fuser does not provide you with the process that is holding /interface and when you are sure it is not a mountpoint (check with bdf /interface) you can try to remove the file with "unlink" , see man 1m unlink.

HtH,

Mark
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
zhaogui
Super Advisor

Re: Help! how to find out who is holding this link file?

The link file should link to a NFS mount point. But the mnttab was not in sync because of root file system full and also caused NFS link suspended. Although the NFS link came back through automount after the space was recovered but the link file was corrupted. That's why fuser /interface got error.

We have already rebooted the server and fixed this problem.

Thank you a lot for your response.