How to Set up NFS Share on LinuxMint 18.3

To Set up NFS Share on LinuxMint 18.3

NFS stands for Network File System, and it allows directories and file systems to be shared across a local network. NFS can also be set up over the Internet but it’ s not secure. In this tutorial, you will learn about how to configure NFS share on Linux Mint 18.3 using Linux Mint as server and Ubuntu 16.04 as client.

Install and Configure NFS Share

First, begin the process by making use of the following command to install NFS packages on NFS server using.

linuxhelp ~ # apt-get install -y nfs-kernel-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libnfsidmap2 libtirpc1 nfs-common rpcbind
Suggested packages:
  open-iscsi watchdog
The following NEW packages will be installed:
  libnfsidmap2 libtirpc1 nfs-common nfs-kernel-server rpcbind
0 upgraded, 5 newly installed, 0 to remove and 214 not upgraded.
Need to get 420 kB of archives.
.
.
Creating config file /etc/default/nfs-kernel-server with new version
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...

Once it is done, you need to create NFS share. So, create a directory that you want to share with client machines. Here a directory named nfsshare in / partition is created and is shared it over NFS.

linuxhelp ~ # mkdir /nfsshare

Allow client machines to read and write to the created directory.

linuxhelp ~ # chmod 777 /nfsshare/

Make an entry of the directory /nfsshare to export as NFS share.

linuxhelp ~ # vim /etc/exports
/nfsshare 192.168.7.233(rw,sync,no_root_squash,no_subtree_check)
~                                                                                                             
~                                                                                                             
~                                                                                                             
~                                                                                                             
~                                                                                                             
" /etc/exports"  12L, 454C                                                                    1,1           All

Use the following command to export the shared directories.

linuxhelp ~ # exportfs &ndash ra

Verify the exported share using following command.

linuxhelp ~ # showmount -e
Export list for linuxhelp:
/nfsshare 192.168.7.233
CONFIGURE NFS CLIENT 

Now, install the NFS common package on the client machine to mount a remote filesystem.

root@linuxhelp:~# apt-get -y install nfs-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  keyutils libnfsidmap2 libtirpc1 rpcbind
Suggested packages:
  open-iscsi watchdog
The following NEW packages will be installed:
  keyutils libnfsidmap2 libtirpc1 nfs-common rpcbind
0 upgraded, 5 newly installed, 0 to remove and 339 not upgraded.
Need to get 379 kB of archives.
.
.
Creating config file /etc/default/nfs-common with new version
Adding system user `statd'  (UID 122) ...
Adding new user `statd'  (UID 122) with group `nogroup'  ...
Not creating home directory `/var/lib/nfs' .
nfs-utils.service is a disabled or a static unit, not starting it.
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...

Before mounting the NFS share, runs the show mount command on the client machine to see whether the NFS share from the server is visible or not.

root@linuxhelp:~# showmount -e 192.168.7.234
Export list for 192.168.7.234:
/nfsshare 192.168.7.233

Create a directory /share on the client machine to mount the shared directory.

root@linuxhelp:~# mkdir /mnt/share

Then edit /etc/fstab file.

root@linuxhelp:~# nano /etc/fstab
192.168.7.234:/nfsshare /mnt/share      nfs rw,soft,intr,noatime,x-gvfs-show
Save and exit

Then create the mount point.

root@linuxhelp:~# mount &ndash a

Now you can access the server’ s home directory in your file manager.


With this, the tutorial on How to Set up NFS Share on Linux Mint 18.3

Tag : NFS Linux Mint
FAQ
Q
How to erify the exported share of NFS share?
A
To Verify the exported share use the following command

#showmount -e
Q
What is the command to install nfs kernel server?
A
The command to install nfs kernel server is

#apt-get install -y nfs-kernel-server
Q
What is NFS Share?
A
NFS stands for Network File System, and it allows directories and file systems to be shared across a local network. NFS can also be set up over the Internet but it&rsquo s not secure.
Q
how to configure NFS for Vmware ESXI?
A
To configure NFS for Vmware ESXI you can refer the following link, https://www.linuxhelp.com/how-to-add-nfs-datastore-in-vmware-vcenter-6-0/
Q
how do I configure NFS Share on OpenSUSE?
A
To configure NFS Share on OpenSUSE follow this link, https://www.linuxhelp.com/how-to-install-and-configure-nfs-on-opensuse-13-1/