Exporting or unexporting resources using the exportfs command
Purposes of the exportfs command
You use the exportfs command for these purposes:
- Export entries specified in the /etc/exports file.
- Export entries in different ways from those specified in the /etc/exports file. For example, you can export resources that are not specified in the /etc/exports file or resources that are specified in the /etc/exports file but with different access restrictions.
- Unexport entries that are currently exported. After a resource is unexported, it becomes unavailable for clients to mount.
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 access=host1:host2,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.
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.
options specify the access restrictions. They can be access, ro, rw, and anon.
path_name is the path name to the resource you want to export.
Examples
The following exportfs command exports the /vol/vol1 volume to a netgroup named trusted_hosts, giving host1 root access and host2 read-write nonroot access:
exportfs -i -o access=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 access=untrusted_hosts,ro /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
|
|
3 |
Enter the following command:
exportfs -u path_name
path_name is the path name to the resource that you want to unexport.
|
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00323
File: nfs10.htm
Last updated: 01/15/03 15:45:12