Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nfs hangs?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
thelee
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2007
Posts: 132

PostPosted: Thu May 01, 2008 1:26 am    Post subject: nfs hangs? Reply with quote

So I just finished setting up my own NAS with a really minimal gentoo setup along with nfs. I exported two directories (/nfs-share/videos and /nfs-share/music) and mounted them successfully on my desktop and have been transferring my vast array of tv shows and music via simple cp commands.

Problem is, after a while, something weird happens. my cp process might hang with no feedback whatsoever, and a CTRL-C won't terminate it. Even if it didn't hang, sometimes after it completes trying to do anythign remotely related to where I mounted the nfs folders (even just ls'ing in a folder above, like, if i mounted an nfs folder at ~/videos and did an ls while in ~/) results in an indefinite hang that I can't get out of. I can't kill the processes and trying to close the xterm window doesn't work. I can logout and that'll terminate the axterm, but I still won't be able to remotely interact with the mounted nfs volumes. In fact, if I try to reboot, I'll get to the "* unmounting filesystems..." step and my computer will start hanging indefinitely until I manually press the reset or power button.

Is there a log file somewhere (either on the client or the server machine) to see what's going on? Is this a problem that's happened to other people?
Back to top
View user's profile Send private message
carl.anderson
Apprentice
Apprentice


Joined: 05 Sep 2005
Posts: 162
Location: Mountain View

PostPosted: Thu May 01, 2008 4:34 am    Post subject: you want it soft / interruptable Reply with quote

I've had this issue before. I think I fixed it by changing the NFS mount from hard to soft. I believe hard mount is on by default.

I found this relevant link.
Back to top
View user's profile Send private message
thelee
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jul 2007
Posts: 132

PostPosted: Thu May 01, 2008 4:43 am    Post subject: Reply with quote

thanks. hopefully this'll fix it...
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5910

PostPosted: Thu May 01, 2008 9:39 am    Post subject: Reply with quote

i'm afflicted by this as well... does anyone know what causes it specifically? regardless of soft or hard mount, the filesystem should be able to make multiple requests simultaneously to the same directory... :?
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
carl.anderson
Apprentice
Apprentice


Joined: 05 Sep 2005
Posts: 162
Location: Mountain View

PostPosted: Thu May 01, 2008 12:50 pm    Post subject: Reply with quote

For me the problem was that the server was unreachable, not that there were multiple simultaneous requests. Also, I think it hung for 10 minutes rather than forever. Do you have NFS 3 or 4 support (or both) in the kernel? Also, you might want to have your clocks synced. Try making the mount interruptible too.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7405

PostPosted: Fri May 02, 2008 9:16 pm    Post subject: Reply with quote

you might give people something to play with, emerge --info is a minimal, but considering nfs, anything related might help, fstab, export, rpcinfo...
no clues, no help, not a rule, just a fact :D
you still might not getting help, but you'll raise your chances
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10308
Location: Córdoba (Spain)

PostPosted: Fri May 02, 2008 9:25 pm    Post subject: Reply with quote

bunder wrote:
i'm afflicted by this as well... does anyone know what causes it specifically? regardless of soft or hard mount, the filesystem should be able to make multiple requests simultaneously to the same directory... :?


NFS is one of the most annoying (yet still necessary) things that there are around. The policy by default is to mount hard, which means that any program doing I/O on an NFS volume will wait forever, until the I/O is finished. This is annoying for a number of reasons.

A very annoying one is how your local box will hang forever if you decide to turn it off and the server is not reachable for any reason. In my opinion, it's a design flaw. Security is ok, but such behavior is not secure either, because it forces a hard reboot, which is, by definition, a danger for any filesystem.

The solution is to mount soft everything NFS related.

I guess that one of the reasons why concurrent access might be problematic is when one client process takes all the bandwidth (specially if the process opens many threads) and another process accessing concurrently to the same share is starved for a given amount of time. If this second process can't handle that well and fails for some reason, then it might hang forever. It's just a guess :P
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7405

PostPosted: Fri May 02, 2008 9:40 pm    Post subject: Reply with quote

i92guboj wrote:

The solution is to mount soft everything NFS related.

man nfs wrote:
intr / nointr Selects whether to allow signals to interrupt file oper-
ations on this mount point. If neither option is speci-
fied (or if nointr is specified), signals do not inter-
rupt NFS file operations. If intr is specified, system
calls return EINTR if an in-progress NFS operation is
interrupted by a signal.

Using the intr option is preferred to using the soft
option because it is significantly less likely to result
in data corruption.


:D
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10308
Location: Córdoba (Spain)

PostPosted: Fri May 02, 2008 9:52 pm    Post subject: Reply with quote

Ouch, nice one. I wasn't aware of that option. Many thanks, krinn ;)
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7405

PostPosted: Fri May 02, 2008 10:14 pm    Post subject: Reply with quote

i still consider that as brutal, and not a solution, but at least smarter *should* be better ;)
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10308
Location: Córdoba (Spain)

PostPosted: Fri May 02, 2008 10:40 pm    Post subject: Reply with quote

Yes. As I said, it's just one of the annoying things about NFS. I am always looking for alternatives, though. But I haven't found anything stable that is easy to setup and doesn't add an overhead (I find sshfs to be an overkill just for a home network, and it doesn't work the way I want either).
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7405

PostPosted: Fri May 02, 2008 11:03 pm    Post subject: Reply with quote

Staying brutal but will solve at least the reboot problem
Code:
umount.nfs /nfsmountpointonclient -f -v

usual disclaimers for data lost... comes here :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum