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 03-02-2018, 12:23 PM   #1
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Rep: Reputation: 16
Ensuring NFS client will reconnect on NFS server restart


Hi, all.

I'm pretty proficient with Linux, but I have a situation that I can't seem to find any useful guidance on.

I have a desktop machine that I've loaded up with a few large hard drives and installed Linux as the OS. This machine is essentially being used as a NAS device in my home network and exports a few disks/directories via NFS.

I have an identical machine with the same hard drives that is used as a Plex Media Server, also running Linux. This machine NFS mounts two disks from the NAS to use as part of the storage for the media library and a third disk is mounted for user home directories (single repository for all user data but available across all of my machines).

I have at least four other Linux machines that are virtualized and run as guests across a pair of high-powered desktop class machines that run XenServer. Each of these Linux guests NFS mounts the third disk from the NAS device for user home directories.

The issue I have is that I can not take the NAS box down for any reason (like to update the OS, kernel, etc.) without shutting down every other Linux machine on the network first because the NFS mounts become stale and lock up all of those machines.

Is there a reasonable way that I could set up NFS so that restarting the NFS service on the NAS box or restarting the entire box won't cause my client machines to end up with stale locks and lock up themselves? I am using the "hard" option on the client side because I can not chance losing data - especially with the user home directories. The media disks (movies, TV shows, etc.) are generally only read from. I currently have the media server using an NFS-mounted disk to store TV Shows that I record OTA, but I'm going to change this to be a local disk on the machine because I can't risk losing recordings because of a stale lock.
 
Old 03-03-2018, 04:21 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,790

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
A correct NFS server leaves the clients in a hung state when it goes down.
But when it comes up the clients continue.
You must not see a "Stale NFS handle".
 
Old 03-03-2018, 04:45 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,790

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
Typically a NFS handle consists of the file system's superblock and device path.
It changes only when the filesystem is recreated or if its device path (/dev/something) is changed.
 
Old 03-03-2018, 05:16 AM   #4
trognet
LQ Newbie
 
Registered: Feb 2018
Location: UK
Distribution: Slackware
Posts: 9
Blog Entries: 1

Rep: Reputation: Disabled
https://kerneltalks.com/troubleshoot...-handle-error/
 
Old 07-03-2018, 02:11 PM   #5
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
I'm still dealing with issues on my local LAN that pertain to NFS.

The other day, I had to restart the NAS server and there was a corruption / failure on the boot disk. After replacing and reinstalling the OS, I had to systematically go through my entire environment and reboot all of the various client machines to correct the hung states they were in because the NFS server was unavailable for a period.

The kerneltalks link was pretty useless.

I am looking for guidance / tips on how to configure NFS at the server and the client side, along with any particular settings / options that I should be using with each side of the connection. I need to be able to restart this box without it basically crashing my entire environment as a result.
 
Old 07-04-2018, 07:12 AM   #6
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,790

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
By default NFS behaves like a local disk. When the NFS server boots, the NFS client hangs hard as if the disk would not respond. When the server is up again, the NFS client continues as if the disk would have recovered.
Unless the NFS server changes the file handle. A reboot must not alter the file handle.
A "reinstalling the OS" might cause it to change, e.g. by using a different device path.
Please run an "exportfs" and "df" on the NFS server (or the equivalent NAS server command), reboot it, and compare with another "exportfs" and "df". Both must be not change. NFS clients must continue.
 
Old 07-04-2018, 08:16 AM   #7
ember1205
Member
 
Registered: Oct 2014
Posts: 176

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by MadeInGermany View Post
By default NFS behaves like a local disk. When the NFS server boots, the NFS client hangs hard as if the disk would not respond. When the server is up again, the NFS client continues as if the disk would have recovered.
Unless the NFS server changes the file handle. A reboot must not alter the file handle.
A "reinstalling the OS" might cause it to change, e.g. by using a different device path.
Please run an "exportfs" and "df" on the NFS server (or the equivalent NAS server command), reboot it, and compare with another "exportfs" and "df". Both must be not change. NFS clients must continue.
I can appreciate an OS reinstall creating change. But, a simple restart of my NAS machine will corrupt everything on my LAN. The only way that I can get my XenServer machines to re-attach is to restart them.
 
  


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 practice setting up of NFS server and NFS client on a laptop? Nue-b Linux - Newbie 3 07-18-2011 06:38 PM
[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
Linux NFS client <--> Leopard NFS server ACL support tplessers Linux - Networking 0 02-17-2010 04:28 AM
nfs server on ubuntu doesn't play nice with nfs client on solaris mathiraj Linux - Networking 11 09-15-2009 02:08 PM
NFS client = Linux, NFS server = Mac OS X Tiger --> Hell of a problem make Linux - Networking 9 03-10-2006 05:16 AM

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

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