Network File Systems: Goals of This Lab
Network File Systems: Goals of This Lab
Network File Systems: Goals of This Lab
Table of Contents
PREPARATION ...................................................................................................................................... 1 Exercise 1: Review and preparation.............................................................................................. 1 Exercise 2: Configuration ............................................................................................................. 1 MAIN LAB ............................................................................................................................................. 3 Part 1: Network File System ............................................................................................................... 3 Exercise 3: Configure a file server ................................................................................................ 3 Part 2: The automounter .................................................................................................................... 4 Exercise 4: Preparations ............................................................................................................... 4 Exercise 5: Configure the automounter ........................................................................................ 5
IDA/ADIT
IDA/ADIT
PREPARATION
Complete these exercises before proceeding with the main lab. You should be able to do them using only on-line documentation and man pages. Exercise 1: Review and preparation Most of this documentation will not be available on marsix or on your systems (until you install the appropriate packages), but they are available on the Internet. The man pages for autofs are not very good, and autofs is notoriously finicky. Read the documentation carefully. If you miss a single word in the wrong place you can end up wasting huge amounts of time. 1-1 1-2 1-3 Report: Review the documentation for the Linux kernel NFS server. Review the documentation for the Linux automounter (autofs). Explain to a friend or your lab assistant how the automounter works. Nothing to report.
Exercise 2: Configuration 2-1 2-2 2-3 2-4 2-5 Report: What is an automount map? Explain to a friend the difference between a direct and indirect map. What is the name of the main configuration file for autofs? How can you refer to an automount map in NIS from the main configuration file? How do you configure the system so it looks for the main configuration file in NIS instead of looking for a regular file? Answers to the questions above.
IDA/ADIT
MAIN LAB
One of the most important reasons for having a server is to store files on it. By using a central file server, all users in a network can access all files, and services like backup and recovery are far easier to implement on a server than on a diverse set of workstations. Although it is not required, you should have installed and configured a directory service, such as NIS, before starting this exercise. Otherwise you will have to re-do parts of it. Time taken 2005: 1-9 hours, average 5 hours (no reliable information for 2006) Past problems: NFS itself seems to cause very few problems. The automounter causes more problems. The documentation for the automounter has a lot to do with that, but most of the difficult problems have been caused by not understanding how the automounter works and what its purpose is.
3-3 Report:
Due to a quirk in some versions of Linux, you may need to set the fsid option when exporting directories from the server, or the client will ignore all but the first set of mount options (e.g. readonly, read-write) used to mount those directories. For example, imagine that the server has a file system named /nfs and exports /nfs/local and /nfs/home, and the client mounts /nfs/local readIDA/ADIT NFS: Network File Systems 3
only as /usr/local and /nfs/home read-write as /home. Because of this problem in some Linux versions, /home will actually be read-only, and no warnings issued, because the two directories by default have the same file system ID. By explicitly setting distinct file system IDs on the server (using the fsid option), this can be avoided.
4-2
4-3
IDA/ADIT
Report:
Test protocols that show that /home1 and /home2 are being exported with appropriate permissions.
The use of /home1 and /home2 is fairly typical in larger systems, where the home directories of all users wont fit on a single disk. This is also the type of situation in which the automounter is really useful. Furthermore, it is easier to test the automounter in this configuration than it is when the server has all home directories in /home. In the version of Debian we are using, nis may start after autofs, which is a problem if you keep your automount maps in nis (which you are supposed to do). In order to fix this, you need to reorder the boot sequence. The boot sequence for the default run level (2) is determined by the lexicographic order of the links in /etc/rc2.d. The link names are formatted as S priority service. For example, cron starts at priority 89, so its link is named S89cron. The default for portmap is 18, and the default for autofs and nis is 19. You need to change the priority for portmap to 17 and the priority for nis to 18. That way, portmap will start before nis, which starts before autofs. The update-rc.d command can be used to accomplish this: update-rc.d f service remove update-rc.d service defaults priority Exercise 5: Configure the automounter 5-1 Install an automounter on the clients and on the server. The autofs package is recommended, but you may try amd or some other automounter if you prefer. Note the warning above. Configure the automounter so it mounts /home/USERNAME from the users real home directory (on the NFS server). Make /home an indirect mount point that is, the automounter will automatically mount subdirectories of /home, but not /home itself. You will probably need one line per user in the configuration file. Verify that all users can log on to the client and that the correct home directories are mounted. Test protocols that show that the automounter is working properly, as well as a listing of any configuration changes made on the client or server.
5-2
5-3 Report:
Note that the only automounter configuration that may reside in local files on the client are configuration files that are guaranteed to never change when new automounts are added or old ones removed. In other words, the master map and any map it references must be stored in the directory service. If you have a single local configuration file, you probably have too many. If you have more than one, you definitely have too many. As a troubleshooting help, you may want to try running sh x /etc/init.d/autofs restart to restart the automounter after reconfiguring it. The /etc/init.d/autofs script is responsible for reading the automount maps (configuration), and by using sh x to invoke it, all commands that are used to read the configuration will be printed. You will be able to see exactly which files and NIS maps are consulted, and what automount commands are run.
IDA/ADIT
FEEDBACK FORM
NFS
Complete this feedback form individually at the end of the lab and hand it to the lab assistant when you finish. Your feedback is essential for improving the labs. Each student should hand in a feedback form. Do not cooperate on completing the form. You do not need to put your name on the feedback form. Your feedback will be evaluated the same way regardless of whether your name is on it or not. Your name is valuable to us in case you have made and comments in the last section that need clarifications or otherwise warrant a followup. For each section, please rate the following (range 1 to 5 in all cases). Difficulty: Rate the degree of difficulty (1=too easy, 5=too difficult) Learning: Rate your learning experience (1=learned nothing, 5=learned a lot). Interest: Rate your interest level after completing the part (1=no interest, 5=high interest). Time: How long did the part take to complete (in minutes)? Difficulty Preparation Part 1: Network File System Part 2:The automounter Overall Learning Interest Time (minutes)
Please answer the following questions: What did you like about this lab?
IDA/ADIT
FEEDBACK FORM
NFS
Complete this feedback form individually at the end of the lab and hand it to the lab assistant when you finish. Your feedback is essential for improving the labs. Each student should hand in a feedback form. Do not cooperate on completing the form. You do not need to put your name on the feedback form. Your feedback will be evaluated the same way regardless of whether your name is on it or not. Your name is valuable to us in case you have made and comments in the last section that need clarifications or otherwise warrant a followup. For each section, please rate the following (range 1 to 5 in all cases). Difficulty: Rate the degree of difficulty (1=too easy, 5=too difficult) Learning: Rate your learning experience (1=learned nothing, 5=learned a lot). Interest: Rate your interest level after completing the part (1=no interest, 5=high interest). Time: How long did the part take to complete (in minutes)? Difficulty Preparation Part 1: Network File System Part 2:The automounter Overall Learning Interest Time (minutes)
Please answer the following questions: What did you like about this lab?
IDA/ADIT