Ensuring NFS client will reconnect on NFS server restart
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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".
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.