Operating System - HP-UX
1820695 Members
3176 Online
109627 Solutions
New Discussion юеВ

Unmounting NFS when it says it is busy

 
Marty Metras
Super Advisor

Unmounting NFS when it says it is busy

I mount a NFS Directory to another host and not the host is not there and I can not unmount it.
Here is the story.
I was syncing up files on servers both HP-UX 11.0
I made a directory and mounted on both
mkdir /dir_1
mount /dir_1 host_2:/dir_1
I did the export in SAM
I did the same on the other server.
All worked fine. I could move data back in forth between the 2 servers.

Here is the problem.
Now I removed one Server from the network.
Oops, I forgot to remove the NFS/export connection.
When I try to umonunt /dir_1 i get a message
# umount /dir_1
nfs umount: nfs_unmount: /dir_1: is busy
fuser /dir_1 never returns an any things.
How do I break this connection with out the other server?
Marty
The only thing that always remain the same are the changes.
7 REPLIES 7
MANOJ SRIVASTAVA
Honored Contributor

Re: Unmounting NFS when it says it is busy

NFS umounts w/o proper umount syntax are problemtaic , my ebst would be if you can stop and restart the nfsd daemons , I dont think that will work either , what u need to do is to comment the mount form /etc/fstab and then reboot the system



Manoj Srivastava
S.K. Chan
Honored Contributor

Re: Unmounting NFS when it says it is busy

First of all run ..
# mount -v
and you should still see the "stale" NFS mount. Don't use bdf as it would either hang or show "stale NFS mount" (you must know this already). Let say the entry looks like ..
..
server:/opt/apps on /opt/mymount type nfs ...
..
Now run fuser against it like this ..
# fuser server:/opt/apps
NOT this "fuser /opt/mymount".
That should return any active processes, kill 'em and you should be able to umount the stale NFS mount.
Marty Metras
Super Advisor

Re: Unmounting NFS when it says it is busy

mount -v shows me:
hostname:/dir_2 on /dir_1 type nfs defaults,NFSv3 on Mon Oct 14 11:46:52 2002
#
fuser hostane:/dir_2 returns nothing.
also tried fuser -fuk hostname:/dir_2
it returns
hostname:/dir_2: fuser: could not obtain file system ID for file hostname:/dir_2
Looks like I will have to remark out the fstab and reboot.
So for the next time when the other server is reinstalled. It is in rout out of state.
What should I have done.
Mount and unmount in the script so it is not always connected?
or is there another way of mounting a NFS that I may have overlooked?
Marty
The only thing that always remain the same are the changes.
harry d brown jr
Honored Contributor

Re: Unmounting NFS when it says it is busy


Marty,

get "lsof" and use it in palce of fuser.

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.64/

As to NFS mounts, you are right to comment out the nfs mount and reboot. It's the fastest way to correct the problem.

live free or die
harry
Live Free or Die
Ken Hubnik_2
Honored Contributor

Re: Unmounting NFS when it says it is busy

If you don't have any other NFS mounts you can stop and start the NFS services. /sbin/init.d/nfsserver stop.
Keith Clark
Valued Contributor

Re: Unmounting NFS when it says it is busy

You could always start up a virtual ip that matches the initial hostname in the NFS package, export the filesystem, and then perform the unmount on /dir_1.

For example, if you still have ServiceGuard on a host:

cmmodnet -a -i

exportfs -i /dir2

Then on the host with the stuck mount, run umount /dir1

then undo what you did on host:

exportfs -u /dir2

cmmodnet -r

We have done this successfully in the past when we have forgotten about NFS mounts.

Keith
Marty Metras
Super Advisor

Re: Unmounting NFS when it says it is busy

After trying all my options it looks like I will remark out the line in fstab and reboot the server Sunday.
Thanks for all your help. Your great!
Marty
The only thing that always remain the same are the changes.