How to Mount NFS Share On Linux Client

# Install prerequisite
sudo apt-get install nfs-common

# Set variables
nfsShare=test # assuming that the 'test' share has already been created on the server
sudo mkdir $mountPoint
sudo mount -t nfs $nfsServer:/$nfsShare $mountPoint

# Error:
# mount.nfs: access denied by server while mounting NasServerNameOrIP:/test
# Resolution:
# Reconfigure the NFS share with these options: subtree_check,insecure
# Source:

# Create a test file
kim@kim-linux:/mnt/test$ touch testfile.txt
kim@kim-linux:/mnt/test$ ls

# Unmount forcefully and without further adieu
sudo umount -f -l $mountPoint

# Remount and check for the test file
kim@kim-linux:/mnt/test$ sudo mount -t nfs $nfsServer:/$nfsShare $mountPoint
kim@kim-linux:/mnt/test$ ls /mnt/test

Posted on Categories Linux

Leave a Reply

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