LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2010, 07:34 AM   #1
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Rep: Reputation: 0
NFS : soft mount, but operations still hang


Hi,

I mounted a nfs server with :
-o soft,intr,nolock,proto=udp,timeo=2,retrans=1
(tried both tcp and udp)

and then :
dd if=/dev/zero of=/mnt/mynfs/test.dd

Then I unplug my network cable, and the dd command never terminates.

Why ?

Thanks.

I tried a 2.6.27 and 2.6.32 kernel, for the NFS client. My NFS server is a NAS.
 
Old 01-27-2010, 11:58 PM   #2
phlyer
Member
 
Registered: Jan 2010
Distribution: CentOS, Vector Linux, Scientific Linux, Rocks
Posts: 36

Rep: Reputation: 17
did you try "hard" in combination w/ "proto=tcp" ?

did you try nfs4 yet?

HTH
 
Old 01-28-2010, 01:28 AM   #3
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by phlyer View Post
did you try "hard" in combination w/ "proto=tcp" ?
I just did, and nfs calls never terminate as well. But it doesn't surprise me, because man nfs says :
Code:
if the hard option is specified, NFS requests are retried indefinitely
What surprises me, is that man nfs explicitly says :
Code:
If the soft option is specified, then the NFS  client  fails  an  NFS request 
after retrans retransmissions have been sent, causing the NFS client to return 
an error to the calling application.
Quote:
did you try nfs4 yet?
No, because my NFS server doesn't support it.
 
Old 01-28-2010, 01:38 AM   #4
phlyer
Member
 
Registered: Jan 2010
Distribution: CentOS, Vector Linux, Scientific Linux, Rocks
Posts: 36

Rep: Reputation: 17
ok, that sheds some light
what NFS are you using?

on what distro?

you have two physical machines? I assume

are you using multi-homing on the exporting machine?

what's your /etc/exports entry for that NFS client?
 
Old 01-28-2010, 02:10 AM   #5
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I am using nfs on ubuntu 8.10 for the client.
But my NFS server is a NAS. (QNAP) with
Code:
[~] # cat /etc/exports 
"/share/MD0_DATA/Public" *(rw,async,no_root_squash) 
"/share/MD0_DATA/disk1" *(rw,async,no_root_squash)
 
Old 01-28-2010, 02:55 AM   #6
phlyer
Member
 
Registered: Jan 2010
Distribution: CentOS, Vector Linux, Scientific Linux, Rocks
Posts: 36

Rep: Reputation: 17
nice one on the QNAP
is it some SOHO (single NIC) or some TS-809U-RP model?

maybe you could restrict access, and also drop the tuning?
just for testing

Code:
"/share/MD0_DATA/disk1" 192.168.1.0/255.255.255.0(rw,sync,no_root_squash)
mount your device
Code:
mount -t nfs qnap:/share/MD0_DATA/disk1 /whatever -o rsize=BLKSIZ,wsize=BLKSIZ,intr,soft,proto=tcp

then try again using with
Code:
dd if=/dev/zero of=/mnt/mynfs/test.dd bs=BLKSIZ
where BLKSIZ is whatever is defined in /usr/include/nfsd/const.h
if in doubt, set BLKSIZ=8192
thing is the TCP block size in Linux Kernels >= 2.4 is 32K, NFS version 2
has 8K defined and in NFS version 3 it is up to the server.

You may consider to drop the block size altogether (rzise,wsize &dd).

I've heard about some issues w/ Ubuntu mount.nfs but I am no Ubuntu expert. Sorry.

Last edited by phlyer; 01-28-2010 at 02:56 AM.
 
Old 01-28-2010, 03:27 AM   #7
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I have the TS-439 Pro

I tried to modify the options in /etc/exports, but when I disable/enable nfs my modifications are removed. And if I don't, I don't know if they are taken into account.

But I tried it anyway, with your blocksize suggestions, and it's still blocking.
 
Old 01-29-2010, 01:59 AM   #8
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I found that with sync writes (client side, ie dd -oflags=sync), nfs is not blocking indefinitely anymore.
But there is no mention of this anywhere in nfs documentations.
Also, the error is reported long after I unplug the cable (up to 15 minutes), but if I unplug the cable 10s, then plug it again, the error is reported just there.
And I would prefer to use async writes so I am still open to suggestions.

Last edited by contremaitre; 01-29-2010 at 02:00 AM.
 
Old 02-12-2010, 11:43 AM   #9
fsogumo
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
We had the same problem here but after two days investigating it it seems we found an explanation for this. The default protocol for NFS clients is TCP which seems to set its own timeout value. If you use UDP as protocol NFS clients will consider the "timeo" parameter timeout value. After unplugging the network cable the client program will stop after exhausting the local buffer and the timeout time.
 
Old 02-14-2010, 12:24 PM   #10
contremaitre
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I am using UDP but nfs is still blocking.
It seems it depends if the local buffer is full or not.
If I open my files with the SYNC option, then the local buffer will never grow, and the timeout value will be respected.
Otherwise, it never times out.
 
  


Reply



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
HOW TO: Unmounting a NFS mount on a server when the mounted server has gone down, causing the applications thread to hang up. rahulk LinuxAnswers Discussion 3 06-21-2013 10:25 AM
"mount.nfs: an incorrect mount option was specified" (soft) catkin Linux - Networking 2 09-19-2009 05:30 AM
mount.nfs: mount to NFS server 'jesse' failed: timed out, retrying keupie Linux - Networking 3 06-05-2009 07:03 PM
NFS mount mount.nfs: access denied by server while mounting knockout_artist Linux - Newbie 2 11-26-2008 02:36 PM
Redhat 8 hang on soft boot Bemused Linux - Newbie 0 04-07-2003 12:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:34 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