Library Table of Contents Index Previous Next Comments

Exporting or unexporting resources using the exportfs command

Purposes of the exportfs command  Top

You use the exportfs command for these purposes:

Rules for specifying multiple access restriction options  Top

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  Top

You can specify in the exportfs command to export a resource to these targets:

Exporting entries in /etc/exports  Top

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  Top

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  Top

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.

Library Table of Contents Index Previous Next Comments