Unmounting NFS idle clients from server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unmounting NFS idle clients from server
# 1  
Old 07-24-2014
Unmounting NFS idle clients from server

Hello World,

We have a software repository server in our environment which we use as an NFS server.
Now this has been going on well before I was hired. Now, I observed many users not unmounting the NFS resources after their use. I ran showmount and it showed 513 current sessions.
Smilie Is there a way I could know the idle clients (i.e., which haven't been using the mounted NFS resources)?

I thought of a solution - I would automate a script in which I be unmounting all the NFS directories using ssh. So, if the client is still using, the unmount would automatically be declined.

The problem here is I need to enter the password (and even type 'yes' to save RSA key fingerprint) for each of the 513 attempts. Is there a way to automate this? I had tried 'sshpass' but it completely fails.

Could someone help me complete my script? Or this there a better way to automate remote unmounting (no nfs restart/reload please)?

Last edited by satish51392111; 07-24-2014 at 06:37 PM..
# 2  
Old 07-24-2014
What problem are you trying to solve. You could do
Code:
netstat  -an | grep 2049

This shows clients connected to port 2049, NFS port on my system.
# 3  
Old 07-24-2014
Quote:
Originally Posted by blackrageous
What problem are you trying to solve. You could do
Code:
netstat  -an | grep 2049

This shows clients connected to port 2049, NFS port on my system.
I thought I explained my situation clearly. Is there a way I could disconnect all idle clients from my NFS server?
# 4  
Old 07-24-2014
Some systems allow some mounts to be done automatically when needed and to automatically unmount them if they haven't been used for a specified time limit. Check the -t duration option on the Solaris automount(1M) man page.
# 5  
Old 07-24-2014
This is a Linux machine, to be clear. But I guess autmount still has the same function, at least for the --timeout part.
So, If I updated automount's timeout value with a timeout value of 10 mins and reload autofs service, would it automatically unmount the idle clients after 10 minutes?
# 6  
Old 07-24-2014
According to the Linux man page, the default duration is 2 minutes and maximum duration is 10 minutes.

Are you sure that any of the 513 mounts you're concerned about aren't being used? (Note that if someone changed directory into a directory under the mount point, that mount point will be "in use" until that process and all of its children exit or change directory to some directory that is not under that mount point.)
# 7  
Old 07-25-2014
@Don Cragun,

Yes, I am very much sure most of the client mounts are unused. The performance of the NFS server is stable though, i.e. no immediate load because of the number of clients.
But I wanted to know if there is a way I could unmount the idle clients.
I had written a shell script using output of 'showmount -a' where I can : get all the current NFS clients, the mount points. I can run 'umount <mount_point>' using a for loop but it seemed so extravagant.

I would be happy to share all the script details and the errors it throws to you could help me out.

Thank you Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

AIX NFS Server and NFS Client

Hi 2 ALL, try to run NFS Server in AIX 7.1 : 1. Step by step on NFS Server node mkdir /tmp/test chgrp staff /tmp/test chmod 775 /tmp/test-- create export directory (fs) mknfsexp -d /tmp/test -t ro exportfs -va show mount -e :/# exportfs -av exports: 1831-187 re-exported /tmp/test... (4 Replies)
Discussion started by: penchev
4 Replies

2. Solaris

NFS with a NAS: permanently inconsistent directory state across clients

Hi, I am having some NFS directory consistency problems with the below setup on a local (192.) network: 1. Different permissions (chmod) for the same NFS dir are reflected on different clients. 2. (more serious) an NFS dir created on client1 cannot be accessed on client2; this applies to some... (10 Replies)
Discussion started by: cosmojetz
10 Replies

3. Programming

Clients - Server ( UDP )

Hello, I have a question: I want to create a n client to one server connection. This is the client-server algorithm. Enybody help to make the changes? (0 Replies)
Discussion started by: MaHmur
0 Replies

4. IP Networking

Some clients cannot ping UNIX server

All of sudden in this morning, some computers could not connect to our UNIX server while other still could. Some computers could ping the server while some could not. Same on the server side. It could ping some clients but not some. All Windows clients could ping each other. And more, the... (1 Reply)
Discussion started by: jonapa
1 Replies

5. UNIX for Advanced & Expert Users

Quest on NFS with 1 Server & 2 Clients

Hello; I work now with a team which has based her "applications" on the following schema: 1 NFS client C1 (linux redhat 5) writes a file fic.dat on a NFS SERVER S (RH 5) Another NFS client C2 is waiting for the same file fic.dat (on NFS server S1), and, when "fic.dat" appears, then makes... (8 Replies)
Discussion started by: SolarMax
8 Replies

6. AIX

Unmounting a failed NFS mount

I have an NFS file system mounted on one of my AIX servers with "mount -v cifs".. The server from which the file system was mounted has crashed and now my "df -g" output is hanging. Is there any was to unmount this NFS file system? I have tried "umount -f". Doesn't work. Or is there any way in... (6 Replies)
Discussion started by: wibhore
6 Replies

7. Solaris

Solaris 9 as a nfs client -- centos as a nfs server.

Hello, I have a centos as nfs server, its name is centos_A. After I finish the setup of the nfs server, the other linux can access this nfs server immediately via /net/centos_A/* But, My solaris 9 can not access /net/centos_A/* immediately. I have to leave /net/centos_A, and wait for about... (1 Reply)
Discussion started by: bruceharbin
1 Replies

8. AIX

IPsec from one AIX server to many windows clients

I work for a fairly large organization who recently tasked me with securing our telnet services with IPsec. We have a large mixed environment where most of our servers are running unsecured telnet. ssh was my first suggestion but because of the cost of purchasing an enterprise license for a fips... (2 Replies)
Discussion started by: dgaixsysadm
2 Replies

9. Solaris

Solaris 8 server and Jumpstarting 2.6 clients

Ladies and Gentlemen: I have successfully configured a Solaris 8 server with Jumpstart! I can Jumpstart Solaris 8 client systems with no problem. My configuration is as follows: Jumpstart Server: Solaris 8 patched with Recommended Patches from June 05. I have installed Solaris 8 in... (4 Replies)
Discussion started by: rambo15
4 Replies
Login or Register to Ask a Question