Linux NFS
Ubuntu NFS version 4
- Single server scenario
In this example we will install server NFS running on Ubuntu 14.04 LTS and mount its exported file system to another Ubuntu host. This is the most common scenario where you will deploy a single server that allows one or more individual clients or networks to have access to one or more folders that can be mounted locally.
NFS server
One of requirments is that NFS server MUST have at least one static IP address that we can bind NFS service to. Next, be sure that the hostname (short and fully qualified) exist as an entry in your local hosts file.
vi /etc/hosts 10.0.0.100 nfs-server nfs-server.example.com hostname -f #verify FQDN
Install packages
- nfs-common - common NFS client library
- nfs-kernel-server - NFS server demon/service
- rpcbind - tells other networked machines at what location to find a service
sudo apt-get install nfs-common nfs-kernel-server rpcbind
Create default RPCBIND config file, to explicitly call out that we are not passing any options to the daemon
vi /etc/default/rpcbind OPTIONS=""
Allow other hosts on the network contact our server. Here all hosts on 10.0.0.0/24 network cat use portmap service and in turn NFS shares.
vi /etc/hosts.allow portmap: 10.0.0.
Enable idmapd, this is required for NFSv4
vi /etc/default/nfs-common NEED_IDMAPD=YES