Posted On January 29, 2021

How to Mount NFS Share On Linux Client

kimconnect 0 comments
blog.KimConnect.com >> Linux >> 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
nfsServer=NasServerNameOrIP
mountPoint=/mnt/test
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
testfile.txt

# 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
testfile.txt
# Example: Synology as NFS Server
nfsShare=k8s
nfsServer=192.168.0.5
sharePath=/volume1/$nfsShare
mountPoint=/mnt/$nfsShare
sudo mkdir $mountPoint
sudo mount -t nfs $nfsServer:$sharePath $mountPoint # Test mounting
sudo mount | grep $nfsShare # validate mount
cd $mountPoint
ls

Leave a Reply

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

Related Post

File Searching in Linux

Step 1 Index your file system with updatedb. This makes a list of files so…

Linux: How to Manually Create a USB Bootable Drive for ESXi

Step 1: Find the USB mount root@kimlinux:/home/kim# ls /dev/s*/dev/sda /dev/sdb1 /dev/sdb3 /dev/sdc1 /dev/sg1 /dev/snapshot /dev/stdin/dev/sdb…

How to Upgrade Kubernetes Ingress Nginx Deployed via Helm

# How to upgrade ingress-nginx: helm upgrade --reuse-values ingress-nginx ingress-nginx/ingress-nginx -n ingress-nginx # Sample output of a failure scenario: brucelee@k8-controller:~$ helm…