TITLE
    Mac OS X Server: Managing NFS Exports
Article ID:
Created:
Modified:
60559
10/6/99
7/11/00

TOPIC

    The icon for adding an NFS export directory is dimmed in the NetworkManager's File Sharing application. How can I manage NFS exports?


DISCUSSION

    Here are two ways to manually manage NFS exports without running NetworkManager. Both involve directly storing values into the /exports directory of your local NetInfo database.

    Managing NFS Exports With NetInfoManager.app

      1. Start the NetInfoManager.app application. It will open up the local NetInfo database; you can verify this by looking at the title of the window--it should start with "local@ yourhostname..."
      2. In the directory browser area, click on the exports directory. This should display the current exports, if any, in the rightmost column.
      3. To add a new export, select the "New Subdirectory" command under the Directory menu. It will create a directory named " new_directory ". You may be prompted for root password here.
      4. Rename the " new_directory " to the path of the UFS directory you want to export. To do this, double-click on the "Value(s)" field corresponding to the "name" property, and type in the new path.
      5. Add a "clients" property. To do this, select an existing property and select the "New Property" command under the Directory menu. Give it a name of "clients", and give it a name of "clients", and give it a list of values of client machine you want to export the directory to by selecting the "New value" from the Directory menu.
      6. Add an "opts" property. For details on the values, see the man page for exports(5).
      7. Do a save from NetinfoManager.app.
      8. Restart the server. (Alternatively, if you feel lucky, use Terminal.app to start 'mountd' if it's not running, or send it a SIGHUP if it is by typing the following command: kill -HUP `cat /var/run/mountd.pid


    Managing NFS Exports using nidump/niload

    To manually add a new exported directory, you can use the 'nidump' and 'niload' command line utilities as follows:

    1. Start the Terminal application; all this will be done as root.

    2. Dump the existing exports, if any, to a file. Start the Terminal application. Type the following commands at the prompt:
      su root
      nidump -r /exports . > ~/exportfile

    Note that the '.' indicates the current domain.

    This places a list of all the existing exports in a file, using a property-list notation.

    3. Edit the file to add new exports or modify existing exports.
      cp ~/exportfile ~/exportfile.bkup
      open ~/exportfile

    At this point, TextEdit should launch, and you can add or modify exports, and save. A typical file with two exports might look like this:
      {
      "name" = ( "exports" );
      CHILDREN = (
      {
      "clients" = ( "17.221.1.2", "hosta", "hostb" );
      "name" = ( "/exportdir1" );
      "opts" = ( "maproot=root" );
      },
      {
      "clients" = ( "17.221.1.2", "hosta", "hostb" );
      "name" = ( "/exportdir2" );
      "opts" = ( "ro", "maproot=root" );
      }
      )
      }
    4. Load the modified exports back into Netinfo.
      niload -r /exports . < ~/exportfile

    5. If something goes drastically wrong, restore the original exports:
      niload -r /exports . < ~/exportfile.bkup

    6. Restart the server. (Alternatively, if you feel lucky, use Terminal.app to start 'mountd' if it's not running, or send it a SIGHUP if it is by typing the following command:
      kill -HUP `cat /var/run/mountd.pid


Document Information
Product Area: Mac OS System Software
Category: Mac OS X Server
Sub Category: Apple File Services

Copyright © 2000 Apple Computer, Inc. All rights reserved.