Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Configure a NFS share in your LAN with Ubuntu 20.04

Digital Innovation Partner

Configure a NFS share in your LAN with Ubuntu 20.04

Configuring NFS Server:

Installing NFS services on your ubuntu system

sudo nano /etc/fstab
sudo apt install nfs-kernel-server

sudo apt-get install nfs-kernel-server portmap nfs-common
sudo showmount -a

configure mount folders and define sub nets can access to

sudo nano /etc/exports

/etc/export sample:

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/home/<mymountfolder> 192.168.XXX.XXX/24(rw,sync,no_subtree_check,crossmnt,fsid=0,no_root_squash)
/home/<mymountfolder> 192.168.MMM.MMM/24(rw,sync,no_subtree_check,crossmnt,fsid=0,no_root_squash)

Verify export options

sudo exportfs -arv
sudo systemctl restart nfs-kernel-server
sudo service nfs restart

Configure your MS-Windows 10 client:

You can find info to configure MSWin as NFS client at this link: https://synaptica.info/2020/03/23/nfs-network-file-system/

Configure your MacOSX client:

mkdir /Users/<yourusername>/<yourmountpoint>

sudo mount -o resvport,rw,noowners -t nfs 192.168.JJJ.JJJ:/home/<mymountfolder> /Users/<yourusername>/<yourmountpoint>


sudo nano /etc/fstab

poi scrivi dentro

192.168.JJJ.JJJ:/home/<mymountfolder> /Users/<yourusername>/<yourmountpoint> nfs rw,nolockd,resvport,hard,bg,initr,tcp,nfc,rsize=65536,wsize=65536


sudo automount -vc

 

 

Configure your Ubuntu client:

 

Install requirements and create your mount point

  sudo apt install nfs-common
  mkdir /home// 
  sudo chmod 770  /home// 

Manually mount your NFS drive

sudo mount -t nfs -o vers=4 192.168.JJJ.JJJ:/home/<mymountfolder> /Users/<yourusername>/<yourmountpoint>

Automatically mount your NFS drive

sudo nano /etc/fstab


add this line at the end of /etc/fstab:

192.168.JJJ.JJJ:/home/<mymountfolder>   /Users/<yourusername>/<yourmountpoint>        0   0

test automunting:

 sudo mount -fav

IF THERE IS NO ERRORS:

 sudo mount -av