GIT logo

Mount NFS share under Ubuntu

On the server:

Edit the file /etc/exports  file and add the line:

/share hosts(rw,nohide,insecure,no_subtree_check,async,all_squash,anonuid=idofshare,anonguid=guidofshare]

Example:

/home *(rw,nohide,insecure,no_subtree_check,async,all_squash,anonuid=1008,anongid=1008)

Explanation:

/share  is the location you want to share
hosts  is the specification of hosts you allow access
all_squash  to translate all anonymous id’s (not known on server) to the give anonuid and anongid
no_subtree_check does no checking on the complete subtree of filepermissions (see also here)

After adding or changing an export to the /etc/exports file don’t forget to restart the NFS server:

sudo service nfs-kernel-server restart

On the client:

To view the list of exported shares on the server execute the command:

showmount -e [ip_of_server]

 

Example of output:

Export list for 192.168.2.200:
/home *

To mount the NFS share local create a new subfolder and execute the command:

mount -v [host]:/home ~/home/

This will mount the folder /home on the server local on your /home/ folder.

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *