5.2.1 NFS
5.2.1 NFS
●
NFS allows to share directories and files between Linux Systems
●
nfs-utils* is a software package name
●
Additional package required is rpcbind*
●
To check the package in the system
●
Service name is nfs-server
NFS Server Configuration
●
Mount the disk /dev/nvme0n1p6 to /sharedir directory
#mkdir /sharedir
#mount /dev/nvme0n1p6 /sharedir
●
Exported File System(s) are defined in configuration file /etc/exports.
# vi /etc/exports
/sharedir 192.168.1.0/24(rw,sync)
●
Start the service
●
Stop firewall
●
To refresh the service
# exportfs –r
●
To check the shared directory
# exportfs –v
NFS client configuration
●
Mount the directory to be shared permanently in /etc/fstab
#mkdir /data
#vi /etc/fstab
●
(OR) Mount the directory to be accessed temporarily
#mount -a
#df -h
●
Note:
— The mount point must exist before /etc/fstab is read or the file
system is manually mounted.
NFS client configuration- Troubleshooting
●
Use showmount command to find and verify which areas are
mounted on the client side
# showmount –e 192.168.1.1
# mount -a
# mount
Troubleshooting
●
When your NFS server is configured as NFSv4-only, clients attempting
to mount shares using NFSv2 or NFSv3 fail with an error like the
following:
●
To configure your NFS server to support only NFS version 4.0 and
later. Disable NFSv2, NFSv3, and UDP by adding the following line to
the /etc/sysconfig/nfs configuration file:
RPCNFSDARGS="-N 2 -N 3 -U"
●
Optionally, disable listening for the RPCBIND, MOUNT, and NSM
protocol calls, which are not necessary in the NFSv4-only case.
●
The effects of disabling these options are:
●
Clients that attempt to mount shares from your server using
NFSv2 or NFSv3 become unresponsive.
●
The NFS server itself is unable to mount NFSv2 and NFSv3 file
systems.