Open main menu

CDOT Wiki β

Changes

OPS335 NFS Lab

254 bytes added, 16:48, 4 March 2016
no edit summary
'''Perform the following tasks:'''
#make certain that your '''VM3''' machine can connect to the network and that your '''VM1''' machine is running as the DNS server (Tip: you can use the "host cbc.ca" command to see if DNS queries are being answered. #Since the nfs package was installed when you cloned the machine, Make certain that you are not required to install the logged into your '''nfsVM3''' or machine.#Install the '''nfs-utils''' packageon your '''VM3''' machine.
#Add the following line to the bottom of the '''/etc/fstab''' file on your VM3 machine:<br>'''192.168.x.3:/home /home nfs4 defaults 0 0'''
{{Admon/important|Warning: Do not change any other lines in this file. |Do not change any lines in '''/etc/fstab''' file contained for your VM3 machine. Doing so can cause your VM3 machine not to boot properly.}}
<ol><li value="5">Run the following command to confirm that SELinux will not block the network share:<br>'''setsebool -P use_nfs_home_dirs 1'''</li><li>Issue the following command to mount any network shares without having to logout and login to your VM3:<br>'''mount -a'''<li>Create an empty file within the regular user's home directory on your VM3 machine.<li>Issue the ls-l command for VM2 regular user's <u>'''home'''</u> directory. Do you see a file that you created there?</li><li> Switch to your '''VM2''' machine and view the contents on your regular user's <u>'''home'''</u> directory. What you do you notice? What does this mean in terms of using NFS? Record your observations in your lab logbook.</li><li>'''Restart your VM3 machine''' and login with your regular user id.</li><li>Make certain that you iptables rules are the same to allow NFS to work</li><li>Check that the VM3 regular user's <u>'''home'''</u> directory is mounted by issuing the following command:<br>'''mount | grep /home'''</li><li>If it is not, try running '''mount /home''' as root and observe any errors.</li><li>Create another file in the regular user's home directory on your '''VM3''' machine.</li><li>Switch to your '''VM2''' machine to see if you can view that file.</li><li>Finally, issue the '''ls-l ''' command in your VM3 regular user's home directory to note the contents.</li></ol>
'''Record steps, commands, and your observations in INVESTIGATION 1 in your OPS335 lab log-book'''
#Unmount the /home directory from VM2 by running '''umount /home'''
#Comment or remove the line that you added in the '''/etc/fstab''' file in the previous investigation.
#Restart your '''VM3''' machine.
#Install the '''autofs''' package by issuing the following command:<br>'''yum install autofs'''
#Rename the existing file '''/etc/auto.master ''' file by issuing the following command:<br>'''mv /etc/auto.master /etc/auto.master.orig'''<br>Keep this file as a back-up in case you need to restore the file in the future.#Use the vi text editor to create the file a new (empty) '''/etc/auto.master''' file and add the following line:<br>'''/home /etc/auto.home --timeout=60'''
#Save your editing changes.
#Use the vi text editor to create a file called '''/etc/auto.home''' and add add the following line:<br>'''* &nbsp; -fstype=nfs4,rw,nosuid,soft &nbsp; 192.168.x.3:/home/&'''
#Save your editing changes.
#Use the '''systemctl''' command to start the '''autofs ''' service, and another systemctl command in order to ensure that the autofs service will automatically start at boot.#Log out of and back into '''vm3''' using your learn <u>regular</u> user account(i.e. not root. You should be in your regular user account for both VM2 and VM3 machines).
#Open a terminal and enter the following command:<br>'''mount | grep home'''
#How does it differ from the previous mount? Record your findings in your lab logbook.
#On your '''VM3 ''' machine, create another empty file with the name:<br>'''touch yet_another_empty_file_from_vm3'''#Run and record the output of the following command (in terms of the new file-shareon both your VM2 and VM3 machines):<br>'''df -hT'''#Switch to the nfs server ('''vm2'''), run and record the output of '''ls -l''' in your home directory (You should see the files you created on vm3).#Now that you have VM3 automatically mounting home directories from your VM2machine, repeat the steps in this investigation in order to configure your '''VM1 ''' machine to do the same.
13,420
edits