Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
15.  Remote File-System Administration (Tasks) Autofs Administration Task Overview How to Modify the Master Map  Previous   Contents   Next 
   
 

How to Modify Indirect Maps

  • Login as a user who has permissions to change the maps.

  • Using the nistbladm command, make your changes to the indirect map.

    See the System Administration Guide: Naming and Directory Services (FNS and NIS+).

The change becomes effective the next time the map is used, which is the next time a mount is done.

How to Modify Direct Maps

  1. Login as a user who has permissions to change the maps.

  2. Using the nistbladm command, add or delete your changes to the direct map.

    See the System Administration Guide: Naming and Directory Services (FNS and NIS+).

  3. If you added or deleted a mount-point entry in step 1, run the automount command.

  4. Notify your users of the changes.

    Notification is required so that the users can also run the automount command as superuser on their own computers.


    Note - If you only modify or change the contents of an existing direct map entry, you do not need to run the automount command.


    For example, suppose you modify the auto_direct map so that the /usr/src directory is now mounted from a different server. If /usr/src is not mounted at this time, the new entry becomes effective immediately when you try to access /usr/src. If /usr/src is mounted now, you can wait until the auto-unmounting occurs, then access it.


    Note - Because of the additional steps, and because they do not occupy as much space in the mount table as direct maps, use indirect maps whenever possible. Indirect maps are easier to construct and less demanding on the computers' file systems.


Avoiding Mount-Point Conflicts

If you have a local disk partition that is mounted on /src and you plan to use the autofs service to mount other source directories, you might encounter a problem. If you specify the mount point /src, the NFS service hides the local partition whenever you try to reach it.

You need to mount the partition in some other location, for example, on /export/src. You then need an entry in /etc/vfstab such as the following:

/dev/dsk/d0t3d0s5 /dev/rdsk/c0t3d0s5 /export/src ufs 3 yes - 

You also need this entry in auto_src:

terra		terra:/export/src 

terra is the name of the computer.

Accessing Non-NFS File Systems

Autofs can also mount files other than NFS files. Autofs mounts files on removable media, such as diskettes or CD-ROM. Normally, you would mount files on removable media by using the Volume Manager. The following examples show how this mounting could be accomplished through autofs. The Volume Manager and autofs do not work together, so these entries would not be used without first deactivating the Volume Manager.

Instead of mounting a file system from a server, you put the media in the drive and reference it from the map. If you plan to access non-NFS file systems and you are using autofs, see the following procedures.

How to Access CD-ROM Applications With Autofs


Note - Use this procedure if you are not using Volume Manager.


  1. Become superuser or assume an equivalent role.

    For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.

  2. Update the autofs map.

    Add an entry for the CD-ROM file system, which should resemble the following:

    hsfs     -fstype=hsfs,ro     :/dev/sr0

    The CD-ROM device you intend to mount must appear as a name that follows the colon.

How to Access PC-DOS Data Diskettes With Autofs


Note - Use this procedure if you are not using Volume Manager.


  1. Become superuser or assume an equivalent role.

    For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.

  2. Update the autofs map.

    Add an entry for the diskette file system such as the following:

     pcfs     -fstype=pcfs     :/dev/diskette

Accessing NFS File Systems Using CacheFS

The cache file system (CacheFS) is a generic nonvolatile caching mechanism that improves the performance of certain file systems by utilizing a small, fast, local disk.

You can improve the performance of the NFS environment by using CacheFS to cache data from an NFS file system on a local disk.

How to Access NFS File Systems Using CacheFS

  1. Become superuser or assume an equivalent role.

    For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.

  2. Run the cfsadmin command to create a cache directory on the local disk.

    # cfsadmin -c /var/cache
  3. Add the cachefs entry to the appropriate automounter map.

    For example, adding this entry to the master map caches all home directories:

    /home auto_home -fstype=cachefs,cachedir=/var/cache,backfstype=nfs

    Adding this entry to the auto_home map only caches the home directory for the user who is named rich:

    rich -fstype=cachefs,cachedir=/var/cache,backfstype=nfs dragon:/export/home1/rich

    Note - Options that are included in maps that are searched later override options set in maps that are searched earlier. The last options that are found are the ones that are used. In the previous example, a specific entry added to the auto_home map only needs to include the options listed in the master maps if some of the options needed to be changed.


Customizing the Automounter

You can set up the automounter maps in several ways. The following tasks give details on how to customize the automounter maps to provide an easy-to-use directory structure.

Setting Up a Common View of /home

The ideal is for all network users to be able to locate their own or anyone's home directory under /home. This view should be common across all computers, whether client or server.

Every Solaris installation comes with a master map: /etc/auto_master.

# Master map for autofs
#
+auto_master
/net     -hosts     -nosuid,nobrowse
/home    auto_home  -nobrowse
/xfn     -xfn

A map for auto_home is also installed under /etc.

# Home directory map for autofs
#
+auto_home

Except for a reference to an external auto_home map, this map is empty. If the directories under /home are to be common to all computers, do not modify this /etc/auto_home map. All home directory entries should appear in the name service files, either NIS or NIS+.


Note - Users should not be permitted to run setuid executables from their home directories. Without this restriction, any user could have superuser privileges on any computer.


How to Set Up /home With Multiple Home Directory File Systems

  1. Become superuser or assume an equivalent role.

    For information about roles, see "Using Privileged Applications" in System Administration Guide: Security Services.

  2. Install home directory partitions under /export/home.

    If the system has several partitions, install them under separate directories, for example, /export/home1, /export/home2, and so on.

  3. Use the Solstice System Management Tools to create and maintain the auto_home map.

    Whenever you create a new user account, type the location of the user's home directory in the auto_home map. Map entries can be simple, for example:

    rusty        dragon:/export/home1/&
    gwenda       dragon:/export/home1/&
    charles      sundog:/export/home2/&
    rich         dragon:/export/home3/&

    Notice the use of the & (ampersand) to substitute the map key. The ampersand is an abbreviation for the second occurrence of rusty in the following example.

    rusty     	dragon:/export/home1/rusty

    With the auto_home map in place, users can refer to any home directory (including their own) with the path /home/user. user is their login name and the key in the map. This common view of all home directories is valuable when logging in to another user's computer. Autofs mounts your home directory for you. Similarly, if you run a remote windowing system client on another computer, the client program has the same view of the /home directory.

    This common view also extends to the server. Using the previous example, if rusty logs in to the server dragon, autofs there provides direct access to the local disk by loopback-mounting /export/home1/rusty onto /home/rusty.

    Users do not need to be aware of the real location of their home directories. If rusty needs more disk space and needs to have his home directory relocated to another server, you need only change rusty's entry in the auto_home map to reflect the new location. Other users can continue to use the /home/rusty path.

 
 
 
  Previous   Contents   Next