Mount NFS Share (CentOS 7)

Robert AndresenTutorials Leave a Comment

I have a SMS Gateway installed on a Windows 2008 server at my work, that recieve and sends SMS by .txt files in a folder.

To access the SMS files on my webserver and added a NFS mount to the SMS-folder into my webpage root.

Create the NFS share on Windows server

win_rights_nfs_share

Install NFS tools on CentOS 7

yum install nfs-utils nfs-utils-lib

Enable and start NFS services:

systemctl enable rpcbind
systemctl enable nfs-server
systemctl enable nfs-lock
systemctl enable nfs-idmap

Start the NFS services:

systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap

 

To create a static mount, that mount on every startup – we need to add the mount in the fstab file.

vi /etc/fstab
# # /etc/fstab # Created by anaconda on Tue Aug 19 12:15:24 2014 # # Accessible filesystems, by
...
/dev/mapper/centos-swap swap                    swap    defaults        0 0 192.168.1.101:/var/unixmen_share/ /var/nfs_share/ nfs rw,sync,hard,intr 0 0
<span style="color: #ff0000;">&lt;SERVER IP/HOSTNAME&gt;:/SysManSMS/ /var/www/html/SysManSMS/ nfs</span>

 

Remount without restart

# mount -a

 

Possible error messages

If the linux server IP/Hostname is not added in NFS permissions on the Windows server:

mount.nfs: access denied by server while mounting S1000-2AM-9999:/SysManSMS

If NFS service is not installed or running

mount: mount point /var/www/html/external/SysManSMS/ does not exist