Help wih NFS
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Please help setting NFS.
I have two machines connected via ethernet to same router, need to share files between them.
Read Debian handbook and wiki but still in the dark.
Installed NFS server in both machines via smxi, ssytems is Debian 10 stable + backports
Thank you.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4128
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
This isn't really a question.

Machine 1, the server, must have a static ip, and be running nfs-kernel-server, and nfs-kernel-server must be configured to share a specific directory, with specific permissions depending on what you want to allow, I assume in your case you want to allow full use. nfs-kernel-server, after being configured to share the directory or directories you want, has to be enabled and started. Once it's enabled and started, it is sharing files over your local network.

Machine 2, the client, is simply establishing an nfs connection to machine 1, which works the same as any other remote network file system connection, like smb/cifs, sshfs, etc. Note that there are some small differences between nfs3 and nfs4, in all cases, you want to use the current nfs, which is I believe nfs4, to avoid inconsistencies. Note the gotcha, you MUST unmount the nfs server mount on the client if the server is going to be off when the client restarts, unless you are just shutting down, not suspending/hibernating, at which point it won't matter since it's only an issue if the client has nfs mounted, and the server goes away, then the kernel gets really confused and it's a pain to fix it. I think umount -l /home/you/nfs-mount will do it if Iremember right in that case, the -l forces i t.

If you want to assign the server a name, you have to add it in /etc/hosts, which is another thing so I won't get that, rather we'll just use the server static ip, say 192.168.1.110

It can be useful to add into /etc/fstab the mount so you don't have to type in the whole thing, like:

192.168.1.110:/home/server/shares /home/you/data2 nfs timeo=14,intr,users,noauto

Note all the things you should by now be very comfortable with:

1. assign machine static ip on network
2. bonus points for learning how to configure /etc/hosts on clients so you don't have to remember the IP, but can use the machine network name
3. installing a service
4. enabling and starting a service
5. configuring a service
6. connecting to a remote service, nfs in this case
7. mounting a remote file system

At some point you have to start learning the basics, you've been at this a long time, so people can't keep trying to teach you the basics over and over again, you have to learn, if you don't want to learn, then maybe linux isn't for you, I can't say.

Basically you should not be posting questions like this anymore, to me this indicates you should be using something with a simplified gui system, like windows or mac, not linux, even though linux is pretty easy to do, you do need to learn to read how-tos etc, and more important, build up your own knowledge base. Hint, I use text files to take notes for tech stuff that I know I won't remember, or, even better, I write scripts that do the stuff so I don't have to remember it. smxi was not really ever intended to be used for a lifetime, it was a temporary aid to resolve weaknesses in Debian, most of those weaknesses have been resolved some years ago, so smxi is barely even maintained anymore. You certainly don't need to use it to install a simple package for nfs-kernel-server. The only thing I use smxi for nowadays is to build up a barebones new install, after setting apt to not install recommends, just dependencies. But even that is way out of date and barely tested.

Note however further that some of these things are constant, a server in general needs a static ip so other machines can find it on the network, or on the internet, or at least something that knows where to find it. In general it's easier to set up the basics of windows file sharing on windows to windows than it is to set it up on linux server to other clients, plus windows needs to be secured, I recommend nod32 as the only antivirus product to ever use. OSX locks you into their expensive walled apple garden, I don't tend to recommend that to anyone unless their needs are quite basic, but it has its own internal problems. The bright side of osx or windows is that I don't support them so I can ignore requests for help when they fail or break or get corrupted.
Back to top
Help with NFS
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Thanks for lengthy answer, I wasn't expecting it, I have not been logging into this forum for long because I had trouble remembering password, my bad, I should write all passwords in a protected file.
I will never go to Windows or Mac, I prefer to learn Linux in-depth, although my time is limited by urgent matters, and I am an old phart.
I will follow your recommendations, I can log in from just one of my computers that remembers the password, hope it still does after I upgrade to bullseye.
Thanks again
Back to top
Display posts from previous:   

All times are GMT - 8 Hours