Ch19 system administration


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Ch19 system administration

  1. 1. Automating File Sharing Chapter 19
  2. 2. Chapter Goals <ul><li>Understand how to automount file systems under Windows. </li></ul><ul><li>Understand how to create a consistent name space. </li></ul><ul><li>Understand NFS automounter setup. </li></ul><ul><li>Understand automounter map files. </li></ul>
  3. 3. Automating File Sharing <ul><li>Windows has nothing really comparable to automount that will automatically mount remote disks on demand. </li></ul><ul><li>However, Windows shares can be configured to automatically mount when a user logs in. </li></ul><ul><li>The configuration begins by right clicking on the “Network Neighborhood” or “Network Places” icon and selecting “Map Network Drive” from the pop-up menu. </li></ul><ul><li>Selecting “Map Network Drive” will bring up a dialog box, where a drive letter is selected and assigned to a share. </li></ul>
  4. 4. Automating File Sharing <ul><li>This dialog includes three items to pay careful attention to. </li></ul><ul><ul><li>The “Browse…” button. This allows a user to browse using an interface similar to the “Network Neighborhood” to locate the server and share. This is often easier than entering the share name directly into the “Folder” field. </li></ul></ul><ul><ul><li>The “Reconnect” checkbox. This is how the automatic mount of the sharing is set. Checking this box results in the drive mapping being saved and automatically performed next time the user logs in. </li></ul></ul><ul><ul><li>The “different user name” link. This link allows the user to enter an username and password different from the username and password used when they logged into the Windows system as shown in Figure 19-?. This is important for sites that use different authentication methods for Windows and UNIX and still wish to offer Samba shares to Windows users. Note that on login, a share that has a different user name and password will cause the automatic remounting process to prompt the user for the differing password at the point the mount is reconnected. </li></ul></ul>
  5. 5. Automating File Sharing <ul><li>While this automatic mounting of shares is handy it does not address the basic problem of file sharing, server unavailability. </li></ul><ul><ul><li>If the server the share is being mounted from fails, the network drive connection will be lost and must be manually remounted. </li></ul></ul><ul><ul><li>If the server is unavailable when the user logs in, the network drive will not be mounted even if the server later becomes available. </li></ul></ul><ul><ul><li>If a server fails, but another server offers the same services, manual intervention will be required to mount the backup server. </li></ul></ul><ul><ul><li>The UNIX automount service offers ways around these problems. </li></ul></ul>
  6. 6. Automating File Sharing <ul><li>As mentioned in Chapter 18, “Network File Sharing,” growing networks present the system manager with many challenges. </li></ul><ul><ul><li>As new machines are added, correctly maintaining the configuration files to export and mount the newly added file systems becomes an increasingly daunting chore. </li></ul></ul><ul><ul><li>In addition, when a file server becomes unavailable, processes on client workstations may stop even if they do not depend on that file server. </li></ul></ul><ul><ul><li>The automount service was developed to minimize these problems on UNIX systems. </li></ul></ul>
  7. 7. Automating File Sharing
  8. 8. Automating File Sharing
  9. 9. Automating File Sharing <ul><li>The default mappings used by the automounter are often difficult for users to handle: </li></ul><ul><ul><li>/tmp_mnt/servername/filesystem_name/user_dir </li></ul></ul><ul><ul><li>/net/servername/filesystem_name/user_dir </li></ul></ul><ul><ul><li>/home/servername/filesystem_name/user_dir </li></ul></ul><ul><li>The system administrator needs to force the automounter to provide a consistent name space for the user’s directories. </li></ul>
  10. 12. Automating File Sharing <ul><li>What you want the system to do is map a file system from the server to an alternate mount point on the client </li></ul>
  11. 14. Automating File Sharing <ul><ul><li>The automounter allows filesystems to be mounted on demand. </li></ul></ul><ul><ul><ul><li>The administrator sets up some control files, and makes some mount point directories. </li></ul></ul></ul><ul><ul><ul><li>If/when a user references an a filesystem that is set up for the automounter, the NFS software looks it up in the files, and mounts the filesystem. </li></ul></ul></ul><ul><ul><li>The control files are called “map files”. </li></ul></ul><ul><ul><ul><li>There are several types of map files. </li></ul></ul></ul><ul><ul><ul><li>The most common map files are: </li></ul></ul></ul>
  12. 15. Automating File Sharing <ul><li>Master Maps - list all direct and indirect map files to be processed. </li></ul><ul><ul><li># Master map for automount daemon </li></ul></ul><ul><ul><li>/- auto_direct -ro </li></ul></ul><ul><ul><li>/remote auto_indirect </li></ul></ul><ul><ul><li>/home auto_home </li></ul></ul>
  13. 16. Automating File Sharing <ul><li>direct maps – </li></ul><ul><li>lists of filesystems that do not share a common mount point. </li></ul><ul><ul><ul><li>/usr/man </li></ul></ul></ul><ul><ul><ul><li>/opt </li></ul></ul></ul><ul><ul><ul><li>/cs/tools </li></ul></ul></ul><ul><li># mount /usr/man from grissom </li></ul><ul><li>/usr/man -ro grissom:/usr/man </li></ul><ul><li># mount framemaker binaries from grissom or chaffee </li></ul><ul><li>/usr/frame -ro grissom:/usr/frame </li></ul><ul><li>chaffee:/usr/frame2.0 </li></ul>
  14. 17. Automating File Sharing <ul><li>indirect maps </li></ul><ul><li>In an indirect map, the NFS file systems referred to by the map are mounted at a different mount point than the one listed in the table and a symbolic link is made from that location to the directory listed in the master map. </li></ul><ul><li>This allows for some more exotic automount tricks. </li></ul><ul><li># Item in RHS is mounted in location of LHS </li></ul><ul><ul><ul><li># mount /src from snow /usr/local/src </li></ul></ul></ul><ul><ul><ul><li>src snowwhite:/usr/local/src </li></ul></ul></ul><ul><ul><ul><li>bin snowwhite:/usr/local/bin </li></ul></ul></ul><ul><ul><ul><li>gnu snowwhite:/usr/local/gnu </li></ul></ul></ul>
  15. 18. Automating File Sharing <ul><li>auto_home </li></ul><ul><li>One of the most common indirect maps is auto_home. </li></ul><ul><li>The auto_home map has keys in the /home directory. </li></ul><ul><li>It is used to collect users’ home directories into a single location, and greatly eases the task of maintaining home directory location information. </li></ul><ul><li>dwight glenn:/export/home/& </li></ul><ul><li>frank chaffee:/user2/& </li></ul><ul><li>tom grissom:/export/users/& </li></ul><ul><li>steve glenn:/export/home/& </li></ul><ul><li>Note how the line starting with the key frank does not contain a full path. </li></ul><ul><li>The key in an indirect map specifies the name of the symbolic link to be made in the directory specified in the entry for the map in the auto_master file. </li></ul><ul><li>In this case, all the keys in the auto_home map will create symbolic links in the /home directory. </li></ul>
  16. 19. Automating File Sharing <ul><li>Automounter Variables </li></ul><ul><ul><li>Variable - Meaning - Example </li></ul></ul><ul><ul><li>ARCH - CPU architecture type - sun4 </li></ul></ul><ul><ul><li>CPU - CPU type - SPARC </li></ul></ul><ul><ul><li>HOST - Host name - glenn </li></ul></ul><ul><ul><li>OSNAME - Operating system name - SunOS </li></ul></ul><ul><ul><li>OSREL - Operating system release number - 5.6 </li></ul></ul><ul><ul><li>OSVERS - Operating system version - FCS1.0 </li></ul></ul>
  17. 21. Automating File Sharing <ul><ul><li>Once all of the maps are set up, and the mount points have been created, you start the Solaris automount daemon with: </li></ul></ul><ul><ul><ul><li>/etc/init.d/nfs.client start </li></ul></ul></ul><ul><ul><ul><li>/etc/init.d/autofs start </li></ul></ul></ul><ul><ul><li>Automount can also be configured to mount the filesystem from the server that responds first! (Fault Tolerance) </li></ul></ul>
  18. 22. Automating File Sharing <ul><li>AMD automounter is a more robust system, but takes more work to set up initially (because it is an add-in product). </li></ul><ul><ul><li>The amd automounter, found on Linux and many BSD style UNIX variants uses a different and incompatible format for its map files. </li></ul></ul><ul><ul><li>The general concepts are the same, keyed entries that specify remote filesystems to be mounted, however the syntax is richer and offers greater control over how the map behaves in differing circumstances. </li></ul></ul><ul><ul><ul><li>The analog to the auto_master file for the amd automounter is the amd.conf file found in /etc. </li></ul></ul></ul><ul><ul><ul><li>Beyond specifying the other maps to be consulted, amd.conf also includes a general stanza that allows the many option settings of amd to be configured.   </li></ul></ul></ul>
  19. 23. <ul><li># </li></ul><ul><li># amd default config file </li></ul><ul><li># </li></ul><ul><li># GLOBAL OPTIONS SECTION </li></ul><ul><li>[ global ] </li></ul><ul><li>normalize_hostnames = no </li></ul><ul><li>print_pid = yes </li></ul><ul><li>pid_file = /var/run/ </li></ul><ul><li>restart_mounts = yes </li></ul><ul><li>auto_dir = /.automount </li></ul><ul><li>#log_file = /var/log/amd </li></ul><ul><li>log_file = syslog </li></ul><ul><li>log_options = all </li></ul><ul><li>#debug_options = all </li></ul><ul><li>plock = no </li></ul><ul><li>selectors_on_default = yes </li></ul><ul><li>print_version = no </li></ul>
  20. 24. <ul><li># set map_type to &quot;nis&quot; for NIS maps, or comment it out to search for all </li></ul><ul><li># types </li></ul><ul><li>map_type = file </li></ul><ul><li>search_path = /etc </li></ul><ul><li>browsable_dirs = yes </li></ul><ul><li>show_statfs_entries = no </li></ul><ul><li>fully_qualified_hosts = no </li></ul><ul><li>cache_duration = 3600 </li></ul><ul><li>local_domain = </li></ul><ul><li># Bio map </li></ul><ul><li>[ /bio ] </li></ul><ul><li>map_name = /etc/bio.amd </li></ul><ul><li># PUCC map </li></ul><ul><li>[ /pucc ] </li></ul><ul><li>map_name = /etc/pucc.amd </li></ul><ul><li># CS map </li></ul><ul><li>[ /cs ] </li></ul><ul><li>map_name = /etc/cs.amd </li></ul>
  21. 25. Automating File Sharing <ul><li>As stated in the comment at the top of the amd.conf file, the many options listed are described in the manual page. </li></ul><ul><li>Note that the option keys and their assocated values are case sensitive. </li></ul><ul><li>Here are a few of the key options that may need to be changed to adapt the default amd behavior for a particular site. </li></ul><ul><ul><li>normalize_hostnames : Setting this option to yes will cause amd to re-write any hostnames into their fully qualified form before using them as parameters in map files. This is not always desirable as it makes for long entries in map files for local hosts. </li></ul></ul><ul><ul><li>log_file : This specifies the location of the log file amd writes messages to. Or, as shown here, the log_file option can be set to “syslog” to have amd log via the syslog service. </li></ul></ul>
  22. 26. Automating File Sharing <ul><ul><li>map_type : This option takes several values allowing for a wide variety of sourcs for map information. Here the “file” option is used. Other choices include hesiod, ldap, ndbm, nis, nisplus, passwd and union. The passwd option allows for the direct creation of an auto_home style user home directory map from the the password file. </li></ul></ul><ul><ul><li>browsable_dirs : By setting this to yes, the keys in a given map are made available for viewing by commands such as “ls”. This prevents amd from mounting all the referenced file systems for simple directory lookups; a big performance savings. Note that commands that stat each directory entry such as “ls –l” will still cause amd to mount the referenced file systems. </li></ul></ul><ul><ul><li>cache_duration : This specifies the time an unused file system will remain mounted. </li></ul></ul>
  23. 27. Automating File Sharing <ul><li>An amd map file uses a syntax that involves a key and series of values format. The key is the entry that will appear in the amd “file system”. </li></ul><ul><li>The series of values describes the file system(s) or other items referenced by the key and their options. </li></ul><ul><li>The series of values can contain conditional statements as well as file system references. </li></ul>
  24. 28. Automating File Sharing <ul><li># global default </li></ul><ul><li>/defaults </li></ul><ul><li>type:=nfs;opts:=rw,intr,hard,nosuid,grpid,quota,vers=2,proto=udp </li></ul><ul><li># replicated local program servers </li></ul><ul><li>MISC rhost:=mutant;rfs:=/usr/mutant3/local </li></ul><ul><li>rhost:=turtle;rfs:=/usr/turtle2/local </li></ul><ul><li># UNIX filesystems </li></ul><ul><li>alaska host!=alaska;rhost:=alaska;rfs:=/home </li></ul><ul><li>host==alaska;type:=link;fs:=/home </li></ul><ul><li>alu host!=alu;rhost:=alu;rfs:=/usr/alu </li></ul><ul><li>host==alu;type:=link;fs:=/usr/alu </li></ul>
  25. 29. Summary <ul><li>Windows allows automatic file system mounting. </li></ul><ul><li>Windows automounters are fairly simple. </li></ul><ul><li>Unix automounters allow for redundancy and failover. </li></ul><ul><li>One good use for the automounter is to provide a consistent name space for the users file systems. </li></ul><ul><li>Map files are used to configure the Unix automounter. </li></ul>