Exporting or unexporting resources using the exportfs command
Purposes of the exportfs command
You use the exportfs command to
- Export entries specified in the /etc/exports file
- Export entries not specified in the /etc/exports file
- Modify restrictions on resources already specified in the /etc/exports file
- Unexport entries that are currently exported. Unexported, resources become unavailable to clients
- Determine the actual (absolute) storage path to an exported resource
- Flush the access cache
- Check the access permissions of a host for an export entry
Rules for specifying multiple access restriction options
In the exportfs command, the first access restriction option is preceded by -o and a space. Subsequent options are preceded by a comma (,).
Example
exportfs -o ro=host1:host3,root=host1,rw=host2 /vol/vol0
Targets to which you export a resource
You can specify in the exportfs command to export a resource to these targets:
Exporting entries in /etc/exports
To export entries in the /etc/exports file, complete the following steps.
Step
|
Action
|
|
1 |
If...
|
Then...
|
You want to export all entries in the /etc/exports file
|
Go to Step 2.
|
You edited an entry in the /etc/exports file and you want the change to take effect
|
Go to Step 3.
|
|
2 |
Enter the following command:
exportfs -a
|
|
3 |
Enter the following command:
exportfs path_name
path_name is the path name to a resource specified in the /etc/exports file.
|
Note
Network Appliance recommends that you confirm that the exports shown in the output of the exportfs command match the exports specified in /etc/exports. If they do not match, a client might get stale file handles after you reboot the filer.
Pre-caching entries in /etc/exports
To determine the pre-caching of entries in the /etc/exports file, complete the following step.
Step
|
Action
|
|
1 |
Enter the following command:
exportfs -c host path_name [ro|rw|root]
host is the dotted IP address of the client to check in the access cache.
path_name is the path name to a resource specified in the /etc/exports file.
ro | rw | root checks for read-only (ro), read-write (rw), or root permissions. If this parameter is not provided, the exportfs -c command checks to see if the client has mount permissions to export.
|
Exporting entries differently than specified in /etc/exports
To export entries not in the /etc/exports file, or to export entries with access restrictions that are different from those specified in the /etc/exports file, complete the following step.
Step
|
Action
|
|
1 |
Enter the following command:
exportfs [ -i ] [ -o options ] path_name
Omit the -i option if you are exporting a resource not included in the /etc/exports file. Use the -i option if the resource is included in the /etc/exports file but you want to export it differently.
Note When you do not specify the -i option on the command line, all command line options for the export will be ignored for resources that have different options specified in the /etc/exports file. The options from the corresponding entry in the /etc/exports file will be used instead.
options specifies the access restrictions. These can be access, ro, rw, or anon.
path_name is the path name to the resource you want to export.
Examples
The following exportfs command exports the /vol/vol1 volume, giving read-only access to a netgroup named trusted_hosts, giving root access to host1 and giving read-write nonroot access to host2:
exportfs -i -o ro=trusted_hosts,root=host1,rw=host2
/vol/vol1
The following exportfs command exports the /vol/vol2 volume as a read-only volume to a netgroup named untrusted_hosts:
exportfs -i -o ro=untrusted_hosts /vol/vol2
|
Unexporting resources
To unexport resources, complete the following steps.
Step
|
Action
|
|
1 |
If...
|
Then...
|
You want to unexport all resources that are currently exported
|
Go to Step 2.
|
You want to unexport a specific resource that is currently exported
|
Go to Step 3.
|
|
2 |
Enter the following command:
exportfs -au
Result:
All currently exported resources are unexported immediately.
|
|
3 |
Enter the following command:
exportfs -u path_name
path_name is the path name to the resource that you want to unexport.
Result:
The specified resource is unexported immediately.
|
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00473
File: nfs10.htm
Last updated: 11/25/03 18:02:36