Рет қаралды 16,364
Automount (AutoFS) NFS share using autofs in Linux:
===========================================
Autofs is a service in Linux like operating system which automatically mounts the file system and remote shares when it is accessed.
Main advantage of autofs is that you don’t need to mount file system at all time, file system is only mounted when it is in demand.
Server Configuration (192.168.1.109):
------------------------------------------------------------
yum repolist
Configure YUM in RHEL 7:
• Configure Local Yum Re...
yum install -y nfs*
mkdir /public
mkdir /private
chmod 777 /public
touch /public/calpublic.txt
chmod 777 /private
touch /private/calprivate.txt
vim /etc/exports
/public 192.168.1.110(ro,sync)
/private 192.168.1.110(rw,sync)
exportfs -arvf
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --reload
systemctl start nfs-server
systemctl enable nfs-server
systemctl status nfs-server
systemctl start rpcbind
systemctl enable rpcbind
------------------------------------------
Client Configuration (192.168.1.110):
yum repolist
yum install autofs -y
rpm -qi autofs
mkdir /automount
mkdir -p /automount/private
mkdir -p /automount/public
vim /etc/auto.master
/automount /etc/automount.txt --timeout=60
vim /etc/automount.txt
public -ro,sync 192.168.1.109:/public
private -rw,sync 192.168.1.109:/private
systemctl start autofs
systemctl enable autofs
systemctl status autofs
systemctl start rpcbind
systemctl enable rpcbind
----------------------------------
Test AutoFS:
Login on Client Machine and check the mount point details, here you won't see any NFS Share.
df -hT
cd /automount/
cd private
Again Check the mount point details, here you will see the private NFS Share.
df -hT
cd .. ; cd public
Again Check the mount point details, here you will see the public NFS Share.
df -hT
Now go inside both the directories one by one & try to create and remove some files, here you will find that only RW filesystem allows you to do that not the RO Filesystem.
Now come out of NFS Shares and wait for more than one min, again \ Check the mount point details, here you won't see any NFS Share.
Beacuse both NFS shares got unmounted automatically themself due to AutoFS Service.
You are done.
================
Thanks for watching the video. Please like our videos, share with your friends and feel free to ask anything, post your queries in comments section. We will be glad to answer your queries. Don't forget to subscribe the channel & turn on the bell notifications.
===============
Our Some Popular Videos:
NAVIC:
• NAVIC: The Indian GPS ...
Learn Linux Fundamentals:
• Learn Linux Fundamenta...
Concept of All RAID Levels:
• Session-31 | Concept o...
Configure RAID-0 in Linux:
• Live Linux Training (R...
Configure RAID-1 in Linux:
• Live Linux Training (R...
Configure RAID-5 in Linux:
• Live Linux Training (R...
Configure RAID-6 in Linux:
• Live Linux Training (R...
Configure RAID-10 in Linux:
• Live Linux Training (R...
LVM Snapshot:
• Session-30 | Logical V...
====================================================
Contact Us:
To Follow Vikas Nehra's Twitter Handle:👇
bit.ly/VikasNeh...
For Registration:👇
bit.ly/NehraCla...
To Follow Our Twitter Handle:👇
bit.ly/NehraCla...
To Visit Our Facebook Page:👇
nehraclasses
To Follow Nehra Classes on Instagram:👇
/ nehraclasses
To Our Visit Our Webpage:👇
bit.ly/NehraCla...
Join Us on Telegram App: 👇
t.me/NehraClasses
WhatsApp Us: 👇
bit.ly/2Kpqp5z
Email Us:👇
Email: nehraclasses@gmail.com
============
©COPYRIGHT. ALL RIGHTS RESERVED.