NFS :
NFS, which is an acronym for (Network File system) is a distributed file system protocol. NFS is server-client based, where the NFS server will be configured and clients can access files on the server over a network just as if they were on the server.
Step by step am going to show you how to use the nfs share. Assuming we want to share the directory /database from server 1 to server2 SERVER 1 : IP ; 192.168.222.131
systemctl enable --now nfs-server.service
systemctl status nfs-server.service
vim /etc/export >>/database 192.168.222.129(rw,sync,no_root_squash) save and quit
firewall-cmd --add-service={rpc-bind,nfs,mountd} --permanent
firewall-cmd --reload
exportfs -arv
Moving to SERVER 2 : IP; 192.168.222.129
systemctl enable --now nfs-server.service
systemctl status nfs-server.service
firewall-cmd --add-service={rpc-bind,nfs,mountd} --permanent
firewall-cmd --reload
showmount -e 192.168.222.131
mkdir /database-mp
echo "192.168.222.131:/database /database-mp nfs _netdev 0 0" >> /etc/fstab.
mount -a
CILFS :
Autofs :
Lazy load volumes when they are needed, not simply at boot-time with fstab
.
Install the
autofs
package/etc/auto.master
defines the directory and mount options file ex:/data /etc/auto.data
/etc/auto.data
defines the sub-directory (within/data
) and how to mount the thing ex:files -rw nfs.evilcorp.com:/data/files
Start
autofs
serviceAutomount when started will auto create
/misc
and/net
, which it usesThere are great examples in
/etc/auto.misc
Automount will auto unmount idle volumes
Last updated