Follow this step:
- create network share for NFS
[sourcecode][root@nfs-server ~]# exportfs -v
/data (sync,wdelay,hide,no_subtree_check,sec=sys,rw,no_root_squash,no_all_squash)[/sourcecode]
try those NFS mounting, with mount command:
mount 192.168.168.10:/data /share
and check:
df -h /share
if you're successfully to mount those NFS, then unmount.
umount /share
- Create Systemd Unit to mount NFS
with nano/vim, create a new file /etc/systemd/system/mount-nfs
[sourcecode]
[Unit]
Description=NFS Share from nfs-server.example.com(192.168.43.10)
DefaultDependencies=no
Conflicts=umount.target
After=network-online.target remote-fs.target
Before=umount.target
[Mount]
What=192.168.43.10:/data
Where=/share
Type=nfs
Options=defaults
[Install]
WantedBy=multi-user.target
[/sourcecode]
reload systemd daemon,
systemctl daemon-reload
then start it:
systemctl start mount-nfs
and check the mounting directory.