Chapter 9
NFS Storage
Deploying NFS server:
dnf install nfs-utils -y
mkdir -p /nfsdata /home/ldap/ldapuser{1..9}Editing exports file to state which folders we are sharing as NFS:
vim /etc/exports
/nfsdata *(rw,no_root_squash)
/home/ldap *(rw,no_root_squash)starting nfs server:
systemctl enable --now nfs-server
systemctl enable --now firewalldenabling firewall:
for i in nfs mountd rpc-bind; do firewall-cmd --add-service $i --permanent; done
firewall-cmd --reload
firewall-cmd --list-allverifying mounts:
showmount -eMounting NFS share:
dnf install nfs-utils -y^C
mount nfsserver:/nfsdata /mnt
mount | tail -n 1 # OUTPUT BELOW:
nfsserver:/nfsdata on /mnt type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,
namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.32.131,
local_lock=none,addr=192.168.32.133)Mounting NFS with automount:
dnf install -y autofsCreating auto file:
vim /etc/auto.master
# add this line:
/nfsdata /etc/auto.nfsdataBundan sonra /nfsdata mountu ilə bağlı configlər hamısı /etc/auto.nfsdata üzərindən ediləcək.
# to view examples:
cat /etc/auto.misc
vim /etc/auto.nfsdata
# add these lines:
files -rw nfsserver:/nfsdata
# <directory> <permissions> <nfsserver-hostname>:<mountpoint>enabling autofs service:
systemctl enable --now autofsAutomounting home folders:
vim /etc/auto.master
# add this:
/homes /etc/auto.homesedit homes file:
vim /etc/auto.homes
# add this:
* -rw nfsserver:/home/ldap/&restart the service:
systemctl restart autofsLast updated
Was this helpful?