How to Configure A NFS File Server On Ubuntu 18.04 Bionic Beaver - LinuxConfig.org


#1

You'll be doing the majority of the configuration on the server. That's the system that's going to be doing the sharing. Even still, there really isn't that much. You essentially just need to tell NFS what to share.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-configure-a-nfs-file-server-on-ubuntu-18-04-bionic-beaver TRANSFERRED FROM LINUXCONFIG DISQUS COMMENTS:

#2

Reuben Settergren
fixed it actually, I had a typo in my /etc/exports, same line was duplicated because I copy/pasted and forgot to edit the 'nother folder to be exported

Reuben Settergren
when I try to “sudo systemctl restart nfs-kernel-server”, it says “Job for nfs-server.service canceled”

When I try to check it

$ systemctl status nfs-server.service
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-05-26 22:32:28 PDT; 2min 7s ago
Process: 4505 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
Process: 4504 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
Process: 4503 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)

Whatup with that?


#3

andy
Getting this error

mount: /mnt/nfs: /home/######/share is not a block device.

###### = my username

#4

When I get to the section “Configure Your Exports” I copy the line as it is displayed here, open a LibreOffice document, paste it there, change the username to mine, change the IP address to the external IP address I want to allow, guess at it also being /24 although there is no explanation here about where this number comes from then I copy it from Libre back to the terminal.

When I do this I notice the spacing is very different. In Libre the spacing is wide like it is in this HTML page. It is a space and then a tab character. But in the terminal window there is no space.

When I do all this I get the error: “bash: syntax error near unexpected token rw,sync,no_subtree_check'" I tried deleting the tab character and leaving the space but I get this error: "bash: syntax error near unexpected tokenrw,sync,no_subtree_check’”

I am a complete Noob. I installed Linux for the first time last week and am finding it a bit of a haphazard nightmare to get good instructions even to do things I consider basic under Windows. No disrespect intended but I think what is going on here is that these instructions are written with an assumption on the level of knowledge of the reader and my level of knowledge isn’t there yet. Just a theory of course. I say that because it talks about writing to a file which to my experience looks like a folder path and not a file and my idea of writing to a file involves double clicking on an actual file, opening it and typing or copying text into it. That doesn’t seem to be what these instructions suggest.

Can someone please explain what is actually going on here and why my method isn’t working?


#5

Hi Cameron,

About the error message below you describe:

This suggests you pasted the modified line of text from the LibreOffice document directly into the terminal, where bash tried to interpret it as command, but it is intended to be the content of the /etc/exports file.

I’d advise to check out our linux commands guide to get to know your command line environment, as well as the conventions on navigating the file system. In this guide you’ll also find the nano editor that is perfectly suited to edit configuration files, and can take pastes from clipboard as well. With practice you’ll see that you can work much faster when staying on the command line.

That said, for simple text operations I advise gedit if you want to use a graphical text editor, as it will strip any problematic content pasted from the clipboard, and convert it to plain text.

Also note that /etc/exports is not a path of a directory, but the absolute path (hence it starts with a slash) of the file “exports” (the filename does not have extension) located in “etc” directory, which is in turn located in the root directory (marked with the starting slash). Don’t worry, this will be much clearer after the guide I mentioned.

Hope this helps,
Sandmann


#6

I have followed this guide for setting a my cluster running Ubuntu 18.04 Server and mpi4py…

the cluster contains 1 master node with 12 slave nodes all using NFS server to share the home directory of the mpiuser account.

it seams i have issues after adding the 8th node for some reason … i can run my code across any 7 nodes just fine …

the nodes them self don’t seam to matter for i can use node6 threw node 12 or after a reboot i can use node1 threw node7…

as i manually ssh into each node to check the mount of each of them i notice that only 7 of them will actually connect to the network share … all nodes have the same settings users and user id’s and the fstab entry are alike as well

as far as i can see there must be some sort of connection limits for the nfs server or something … i have exhausted all ideas and resources trying to figure this out. after googling for a few days now i cant seam to find any settings or limitations of the nfs server itself so how can i add the other 5 nodes to my cluster …

any suggestions or help would be greatly appreciated Thank you for your time…