LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-19-2015, 09:49 AM   #1
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Rep: Reputation: 17
Client says: nfs server not responding, after wakeup from sleep


Hi,

As said in the subject. After a reboot it's working. But when putting the client (laptop) to sleep and after a while waking the client, journalctl gives:

Code:
May 19 16:43:00 laptop2 kernel: nfs: server richard not responding, timed out
May 19 16:43:45 laptop2 kernel: nfs: server richard not responding, timed out                                                                             
May 19 16:44:00 laptop2 kernel: nfs: server richard not responding, timed out
The server (iptables logging) receives something on port 5904 and transmits something on this port.
But the client does not connects to the server. After a reboot all is fine.

What is a way to solve this issue?
Server = Fedora 21,
Client = Fedora 20.
 
Old 05-19-2015, 11:22 PM   #2
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Some more information:

On the server (hostname = richard), /etc/exports:
Code:
/home/data                      laptop2(rw,async)
netstat | grep laptop2:
Code:
tcp        0      0 Shareserver.fritz.:5904 laptop2:59449           ESTABLISHED
tcp        0      0 Shareserver.fritz.b:nfs laptop2:858             ESTABLISHED
tcp        0      0 Shareserver.fritz.b:846 laptop2:46589           ESTABLISHED


On the client (hostname = laptop2), /etc/fstab:
Code:
richard:/home/data              /home/data      nfs4            rw,user,timeo=100,retry=6,timeo=60,retrans=6    0 0
netstat | grep richard:
Code:
tcp        0   6568 laptop2.fritz.box:858   richard:nfs             ESTABLISHED
tcp        0      0 laptop2.fritz.box:59449 richard:5904            ESTABLISHED
Stil on the client with journalctl:
Code:
May 20 06:14:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:15:08 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:15:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:15:58 laptop2 kernel: nfs: server richard not responding, still trying
May 20 06:16:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:16:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:17:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:17:18 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:18:13 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:18:23 laptop2 kernel: nfs: server richard not responding, timed out
May 20 06:18:34 laptop2 kernel: nfs: server richard OK
May 20 06:18:34 laptop2 kernel: nfs: server richard OK
May 20 06:18:34 laptop2 kernel: nfs: server richard OK
May 20 06:18:34 laptop2 kernel: nfs: server richard OK
Always after 15 minutes, the nfs link works.... ????

Any ideas how to solve this?
 
Old 05-20-2015, 02:08 AM   #3
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
Never used sleeping NFS clients, but I can guess what happens.
Awaked client want continue with old NFS session, when NFS server already cleaned it out.
This is good for server, otherwice you will get "NFS stale handler" every time.

You can resolve this using automount/autofs on client,
what will mount/dismount NFS for you on the fly.
 
Old 05-20-2015, 11:47 AM   #4
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by voleg View Post
Never used sleeping NFS clients, but I can guess what happens.
Awaked client want continue with old NFS session, when NFS server already cleaned it out.
This is good for server, otherwice you will get "NFS stale handler" every time.

You can resolve this using automount/autofs on client,
what will mount/dismount NFS for you on the fly.
Thanks!
That sounds valid. I will try automount.
 
Old 05-20-2015, 11:23 PM   #5
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Yesterday evening I installed autofs, edited /etc/auto.misc en restarted autofs.
/etc/auto.misc:
Code:
data            -rw,soft,intr           richard:/home/data
A ls on /misc gives an empty dir. A ls on /misc/data gives the content of my nfs server. The automount works.

I closed the lid of my laptop (laptop is going to sleep). This morning I started it again and did "ls /misc/data", but no responese :-(
journalctl gives
Code:
May 21 06:14:29 laptop2 kernel: nfs: server richard not responding, timed out
.
After 15 minutes, the mount works.... ???

Any ideas?
 
Old 05-21-2015, 04:58 AM   #6
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
I suppose you had checked usual staff: IP, DNS, /etc/resolv.conf, /etc/hosts, ping.
If "mount" command show you nfs4, try nfsv3.
(it is in /etc/sysconfig/autofs MOUNT_NFS_DEFAULT_PROTOCOL=3)
 
Old 05-21-2015, 01:57 PM   #7
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
IP of the server is fixed.
IP of the client is fixed.
The IP of the server is listed in /etc/hosts of client
The IP of the client is listed in /etc/hosts of server
Both server and client have in /etc/resolv.conf: nameserver 192.168.1.1
Ping is working from/to client/server when the NFS is timing out.

This evening the mount did work (with autofs). I will test it again tomorrow.
Protocol is on 4. If the test tomorrow fails, I will try v3.
 
Old 05-21-2015, 11:39 PM   #8
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
This morning no luck, After the laptop wakes up, nfs to my server times out.
I changes the protocol version from 4 to 3 in /etc/sysconfig/autofs MOUNT_NFS_DEFAULT_PROTOCOL=3
 
Old 05-30-2015, 02:08 AM   #9
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Still no luck with MOUNT_NFS_DEFAULT_PROTOCOL=3.
I also tried other settings (mostly timeout settings) But the 15 minutes stays.

BUT:
I always have krusader (filemanager) running.
If I shutdown krusader before setting the laptop to sleep, after wakeup the nfs mount works!

It looks like autofs cannot unmount the nfs link if krusader has a tab open of this mount.
Also Dolphin (another filemanager) gives the same problem as krusader.

So when going to sleep, the umount of autofs must be set to force (or something like that).

Any ideas?
 
Old 05-30-2015, 03:50 AM   #10
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
Interesting. Can you check if restarting autofs (after wakeup) helps to save 15 min ?
If yes, it can be possible to add this to wake up procedure.

Again, I have no sleeping Linux to say where this script located.
 
Old 05-30-2015, 06:41 AM   #11
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by voleg View Post
Interesting. Can you check if restarting autofs (after wakeup) helps to save 15 min ?
Thanks for responding.

I tried it before, but I will try it again.
 
Old 05-31-2015, 06:12 AM   #12
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Nope, a "systemctl restart autofs" or a "stop" and than a "start" does not help.
 
Old 05-31-2015, 11:28 AM   #13
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
I have progress!

If the server IPtables service is shutdown (systemctl stop iptables), the delay of 15 minutes is gone and autofs connects directly.
Although there are two rules for laptop2:

Code:
$IPT -A INPUT -s $LAPTOP2 -j ACCEPT
$IPT -A OUTPUT -d $LAPTOP2 -j ACCEPT
$LAPTOP2 has the value IP address of my laptop.

I am going to search in this (iptables) direction.
 
Old 06-11-2015, 01:18 PM   #14
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
[SOLVED] Client says: nfs server not responding, after wakeup from sleep

I was unable to find a solution with the iptables.

If I unmount the nfs mount before going to sleep, there is no problem when waking up.

Therefor I made a script in /usr/lib/systemd/system-sleep. This script is called just before going to sleep and after waking up.

It passes an argument indicating going to sleep (argument = pre) or waking up (argument = post).

The script, i called it nfsrestart.sh:
Code:
#!/bin/bash
if [ $1 = 'pre' ]
then
  fuser -km /misc
  sleep 2
  umount -l /misc/data
fi
if [ $1 = 'post' ]
then
  systemctl start autofs
fi

exit 0
Now I can put the laptop in sleep and wake it up with direct access to my nfs mounts.
 
Old 06-12-2015, 02:22 AM   #15
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
Workarounds rules!
 
  


Reply

Tags
nfs



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
screen doest wakeup after sleep mode Dr_Death_UAE Linux - Laptop and Netbook 3 09-04-2009 07:21 PM
FC5-64 goes to sleep won't wakeup mickeyboa Fedora 0 04-21-2006 08:37 PM
keyboard shortcut for poweroff, sleep, wakeup ashwin_cse Linux - Hardware 1 10-28-2005 05:09 AM
laptop doesn't wakeup from sleep kc8nsb Debian 1 09-05-2004 10:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration