configuration of NFS on Ubuntu Server

Asked by Robert Lee

I have installed Ubuntu Server on a computer to be a file server on my home network. I downloaded and installed NFS. I followed the configuration instructions in serverguide.pdf and updated /etc/exports file with the exported directory locations as:
/ubuntu 192.168.1.1/24(rw,sync,no_subtree_check) *I tried naming my computers and it didn't work, ip addresses seem to work*
I have a directory named /local/ubuntu in place. *I changed the permissions on the directory for sharing for all*
I start the nfs-kernel-server and it appears to start okay.
From another computer in terminal, I run: sudo mount ubuntu-server:/ubuntu /local/ubuntu ("ubuntu-server" is my server name). I get an error message that the mount point does not exist. I do not have a line in /etc/fstab file naming the server file system or mount point. *I tried it and it made a mess of things*
I have nfs common files installed.
My question is where does the /local/ubuntu not exist?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nfs-utils Edit question
Assignee:
No assignee Edit question
Solved by:
Sami Kerola
Solved:
Last query:
Last reply:
Revision history for this message
houstonbofh (leesharp) said :
#1

I think your issues here all boil down to name resolution. But it could also be that you do not have the directory correct. Before you mount it, does /local/ubuntu exist as an empty directory? It needs to...

If that is correct, you need to fix the name issues. Are your IPs static? Can you put them in the DNS for your router? If not, you will need to fix /etc/hosts on each system. Add;

192.168.1.1 ubuntu-server.your.domain ubuntu-server

Revision history for this message
Robert Lee (blee880) said :
#2

I think I resolved the name and IP issues. I fixed the name issue with /local/ubuntu or created it where it didn't exist. I logged onto my router and named and set a fixed IP on the network for the server. I also put a line in /etc/hosts for the server.
The last error message I got was mounting the server file system from my laptop:
robert@robert-Lenovo-G560:~$ sudo mount ubuntu-server:/ubuntu /local/ubuntu
[sudo] password for robert:
mount: wrong fs type, bad option, bad superblock on ubuntu-server:/ubuntu,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail or so
In /etc/fstab, I have used the line: ubuntu-server:/ubuntu /local/ubuntu nfs. It doesn't change the above error message not using the /etc/fstab line.

Revision history for this message
Sami Kerola (kerolasa) said :
#3

Run on both machines the following command.

getent hosts ubuntu-server

If you do not get IP & name pair on client side add the name to /etc/hosts

Revision history for this message
Best Sami Kerola (kerolasa) said :
#4

Once you have the names set up correctly take a look that you have /sbin/mount.nfs command. If not install to client side nfs-utils and retry.

Revision history for this message
Robert Lee (blee880) said :
#5

Yes, getting the nfs common files installed on the client side was the start to the solution. I now have a working nfs server and have learned a lot on the way. Thanks