RHCSA Rapid Track
Performance Checklist
In this lab, you will set up the automounter with an indirect map, using shares from an NFSv4 server.
Outcomes
You should be able to:
Install required packages needed to set up the automounter.
Configure an automounter indirect map, getting resources from a preconfigured NFSv4 server.
Log in to workstation as student using student as the password.
On workstation, run the lab netstorage-review start command.
This start script determines if the servera and serverb systems are reachable on the network.
The start script configures serverb as an NFSv4 server, sets up permissions, and exports directories.
It also creates users and groups needed on both servera and serverb systems.
[student@workstation ~]$lab netstorage-review start
An IT support company uses a central server, serverb, to host some shared directories on /remote/shares for their groups and users.
Users need to be able to log in and have their shared directories mounted on demand and ready to use, under the /shares directory on servera.
Important information:
serverbis sharing the/sharesdirectory, which in turn contains themanagement,productionandoperationsubdirectories.The
managersgroup consists of themanager1andmanager2users. They have read and write access to the/shares/managementshared directory.The
productiongroup consists of thedbuser1andsysadmin1users. They have read and write access to the/shares/productionshared directory.The
operatorsgroup consists of thecontractor1andconsultant1users. They have read and write access to the/shares/operationshared directory.The main mount point for
serverais the/remotedirectory.The
/shares/managementshared directory should be automounted on/remote/managementonservera.The
/shares/productionshared directory should be automounted on/remote/productiononservera.The
/shares/operationshared directory should be automounted on/remote/operationonservera.All user passwords are set to
redhat.
Log in to
serveraand install the required packages.Log in to
serveraas thestudentuser.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Use the sudo -i command to switch to the
rootuser. The password for thestudentuser isstudent.[student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Install the autofs package.
[root@servera ~]#yum install autofs...output omitted...Is this ok [y/N]:y...output omitted...
Configure an automounter indirect map on
serverausing shares fromserverb. Create an indirect map using files named/etc/auto.master.d/shares.autofsfor the master map and/etc/auto.sharesfor the mapping file. Use the/remotedirectory as the main mount point onservera. Rebootserverato determine if theautofsservice starts automatically.Test the NFS server before proceeding to configure the automounter.
[root@servera ~]#mount -t nfs serverb.lab.example.com:/shares /mnt[root@servera ~]#ls -l /mnttotal 0 drwxrwx---. 2 root managers 25 Apr 4 01:13 management drwxrwx---. 2 root operators 25 Apr 4 01:13 operation drwxrwx---. 2 root production 25 Apr 4 01:13 production[root@servera ~]#umount /mntCreate a master map file named
/etc/auto.master.d/shares.autofs, insert the following content, and save the changes.[root@servera ~]#vim /etc/auto.master.d/shares.autofs/remote /etc/auto.sharesCreate an indirect map file named
/etc/auto.shares, insert the following content, and save the changes.[root@servera ~]#vim /etc/auto.shares* -rw,sync,fstype=nfs4 serverb.lab.example.com:/shares/&Start and enable the
autofsservice onservera.[root@servera ~]#systemctl enable --now autofsCreated symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.Reboot the
serveramachine.[root@servera ~]#systemctl reboot
Test the
autofsconfiguration with the various users. When done, log off fromservera.After the
serveramachine has finished booting, log in toserveraas thestudentuser.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Use the su - manager1 command to switch to the
manager1user and test access.[student@servera ~]$su - manager1Password:redhat[manager1@servera ~]$ls -l /remote/management/total 4 -rw-r--r--. 1 root managers 46 Apr 4 01:13 Welcome.txt[manager1@servera ~]$cat /remote/management/Welcome.txt###Welcome to Management Folder on SERVERB###[manager1@servera ~]$echo TEST1 > /remote/management/Test.txt[manager1@servera ~]$cat /remote/management/Test.txtTEST1[manager1@servera ~]$ls -l /remote/operation/ls: cannot open directory '/remote/operation/': Permission denied[manager1@servera ~]$ls -l /remote/production/ls: cannot open directory '/remote/production/': Permission denied[manager1@servera ~]$exitlogout[student@servera ~]$Switch to the
dbuser1user and test access.[student@servera ~]$su - dbuser1Password:redhat[dbuser1@servera ~]$ls -l /remote/production/total 4 -rw-r--r--. 1 root production 46 Apr 4 01:13 Welcome.txt[dbuser1@servera ~]$cat /remote/production/Welcome.txt###Welcome to Production Folder on SERVERB###[dbuser1@servera ~]$echo TEST2 > /remote/production/Test.txt[dbuser1@servera ~]$cat /remote/production/Test.txtTEST2[dbuser1@servera ~]$ls -l /remote/operation/ls: cannot open directory '/remote/operation/': Permission denied[dbuser1@servera ~]$ls -l /remote/management/ls: cannot open directory '/remote/management/': Permission denied[dbuser1@servera ~]$exitlogout[student@servera ~]$Switch to the
contractor1user and test access.[student@servera ~]$su - contractor1Password:redhat[contractor1@servera ~]$ls -l /remote/operation/total 4 -rw-r--r--. 1 root operators 45 Apr 4 01:13 Welcome.txt[contractor1@servera ~]$cat /remote/operation/Welcome.txt###Welcome to Operation Folder on SERVERB###[contractor1@servera ~]$echo TEST3 > /remote/operation/Test.txt[contractor1@servera ~]$cat /remote/operation/Test.txtTEST3[contractor1@servera ~]$ls -l /remote/management/ls: cannot open directory '/remote/management/': Permission denied[contractor1@servera ~]$ls -l /remote/production/ls: cannot open directory '/remote/production/': Permission denied[contractor1@servera ~]$exitlogout[student@servera ~]$Explore the mount options for the NFS automounted share.
[student@servera ~]$mount | grep nfsrpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)serverb.lab.example.com:/shares/managementon/remote/managementtypenfs4(rw,relatime,vers=4.2,rsize=262144,wsize=262144,namlen=255, sync,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.10, local_lock=none,addr=172.25.250.11)serverb.lab.example.com:/shares/operationon/remote/operationtypenfs4(rw,relatime,vers=4.2,rsize=262144,wsize=262144,namlen=255, sync,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.10, local_lock=none,addr=172.25.250.11)serverb.lab.example.com:/shares/productionon/remote/productiontypenfs4(rw,relatime,vers=4.2,rsize=262144,wsize=262144,namlen=255, sync,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.10, local_lock=none,addr=172.25.250.11)Log off from
servera.[student@servera ~]$exitlogout[student@workstation ~]$