Mounting an NFS Home Share on CentOS 7 Clients
-
If the NFS server is down I assume the only way I could login would be with the root account?
-
@anonymous said:
If the NFS server is down I assume the only way I could login would be with the root account?
That's correct, unless you take other measures. You can always have an admin account that is not on the NFS, which would be recommended.
So example:
Normal Account: anon:/home/anon
Special Account: anonadmin:/opt/home/anonadmin/home would be mounted via NFS
/opt/home would be local to the /opt filesystem (we use /opt over /var in this example because /var is often remotely mounted as well and more volatile.)This is a solid workaround so that if anything is wrong with the mounting system on either end, or in the network, that the machine remains reachable and manageable in a simple manner. It is also common to place "utility" accounts in /opt/home for a similar reason. If you have an application that runs and needs a home directory, you likely don't want it mounting it over NFS and pulling data externally like a user would.
-
Keep in mind that this is not a process for "normal" servers, this is a technique used for servers with users. If you had a pure server that there is no reason for users to log into, you would not likely want to do this in most cases. You would probably not have user accounts at all.
-
I've never used autofs, does it do the /etc/fstab stuff for you, or just replace it altogether for the home folder?
-
@johnhooks said:
I've never used autofs, does it do the /etc/fstab stuff for you, or just replace it altogether for the home folder?
AutoFS does not use
fstab
at all, it is specifically to replace that as the connections are not permanent, they are ephemeral. It mounts filesystems at the time of use, not proactively. This is better for security as the mounts are not discoverable and better for performance as they are not mounted when not used. It's also good for reliability as if a mount fails now, it will attempt a remount later. It also unmounts after a time of disuse.AutoFS uses mount commands under the hood, not the fstab during startup. You can use it with any filesystem. Home is common, and the /net filesystem is standard, but you could use it for anything. It's fully customizable.
-
Tested on the second CentOS 7 server and working there, too. So far so good. And the NFS from OpenSuse Leap 42.1 over the Scale cluster is insanely fast, it looks instant when using it.
-
@scottalanmiller said:
@johnhooks said:
I've never used autofs, does it do the /etc/fstab stuff for you, or just replace it altogether for the home folder?
AutoFS does not use
fstab
at all, it is specifically to replace that as the connections are not permanent, they are ephemeral. It mounts filesystems at the time of use, not proactively. This is better for security as the mounts are not discoverable and better for performance as they are not mounted when not used. It's also good for reliability as if a mount fails now, it will attempt a remount later. It also unmounts after a time of disuse.AutoFS uses mount commands under the hood, not the fstab during startup. You can use it with any filesystem. Home is common, and the /net filesystem is standard, but you could use it for anything. It's fully customizable.
I realized how stupid this question was after I walked away and got in the shower. I was hoping to make it back before you read it haha.
-
No such luck
-
What happens if you are connected and then lose connection to the NFS server? Does it store data until reconnection?
-
@johnhooks said:
What happens if you are connected and then lose connection to the NFS server? Does it store data until reconnection?
Store data? Where would it "store data"? What are you picturing? The filesystem would be gone, same as any "mapped drive" situation.
-
@scottalanmiller said:
@johnhooks said:
What happens if you are connected and then lose connection to the NFS server? Does it store data until reconnection?
Store data? Where would it "store data"? What are you picturing? The filesystem would be gone, same as any "mapped drive" situation.
Store as in cache somewhere until it can reconnect.
-
No, there is nothing like that. The filesystem is just not there. It would warn you, though, so you would know not to be trying to save to something that doesn't exist.