45Drives Knowledge Base
KB450448 - Mounting NFS Share to Linux Client
https://knowledgebase.45drives.com/kb/kb450448-mounting-nfs-share-to-linux-client/

KB450448 - Mounting NFS Share to Linux Client

Posted on September 1, 2021 by Austin Axworthy


Scope/Description

Prerequisites

Steps

Install NFS Package

Ubuntu

apt install nfs-common

CentOS

yum install nfs-utils

Mount NFS Share

mkdir /mnt/(mount_point)

mount -t nfs {ServerIP}:/(pool_name)/(nfs_share_name) /mnt/(mount_point)

Add Mount on Reboot

vim /etc/fstab
{ServerIP}:/(pool_name)/(share_name) /mnt/(mount_point) nfs defaults,_netdev 0 0

Verification

Verify Share Mounted

Verify Mount on Reboot

umount /mnt/nfs_share
mount -a

df

Troubleshooting

KB450448 - Mounting NFS Share to Linux Client - 45Drives Knowledge Base
Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450448 – Mounting NFS Share to Linux Client

You are here:

Scope/Description

  • This article describes the process of mounting an NFS share to a linux client and to mount on reboot.

Prerequisites

  • NFS Share Configured on a Server, see here
  • nfs-common installed on client(detailed below)

Steps

Install NFS Package

Ubuntu

  • Use the following command to install nfs-common, this is required to mount NFS share to the client system.
apt install nfs-common

CentOS

  • The following command will install the required nfs packages to mount an NFS share to a client system.
yum install nfs-utils

Mount NFS Share

  • To mount an NFS share, first create a directory to mount it to.
mkdir /mnt/(mount_point)

  • Now use this command to mount it to the share. Edit the fields for your specific case, i.e. Server IP, Pool Name, and Share Name. See example below.
mount -t nfs {ServerIP}:/(pool_name)/(nfs_share_name) /mnt/(mount_point)

Add Mount on Reboot

  • To allow the share to mount on reboot, you will need to edit the fstab. You can use your preferred text editor, here I use vim.
vim /etc/fstab
  • Add the mount point in the format see below.
{ServerIP}:/(pool_name)/(share_name) /mnt/(mount_point) nfs defaults,_netdev 0 0

Verification

Verify Share Mounted

  • To ensure the share has mounted, you can run the command df.

Verify Mount on Reboot

  • To ensure the share will mount on reboot after editing the /etc/fstab, unmount the share.
umount /mnt/nfs_share
  • Remount the share using the following command, this command will mount all shares in the /etc/fstab file.
mount -a
  • Run df again to ensure the share was mounted.

df

Troubleshooting

  • If the share will not mount, ensure the directory is correctly configured on the server side, and the nfs directory has permissions 770 set.
  • If the server will not mount the share on reboot, the /etc/fstab is very particular, ensure the correct syntax.
Was this article helpful?
Dislike 0
Views: 839
© 2024 - 45Drives Knowledge Base
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access