1exportfs(8)                 System Manager's Manual                exportfs(8)
2
3
4

NAME

6       exportfs - maintain list of NFS exported file systems
7

SYNOPSIS

9       /usr/sbin/exportfs [-avi] [-o options,..] [client:/path ..]
10       /usr/sbin/exportfs -r [-v]
11       /usr/sbin/exportfs [-av] -u [client:/path ..]
12       /usr/sbin/exportfs [-v]
13       /usr/sbin/exportfs -f
14

DESCRIPTION

16       The  exportfs command is used to maintain the current table of exported
17       file systems for NFS. This list  is  kept  in  a  separate  file  named
18       /var/lib/nfs/etab  which  is read by mountd when a remote host requests
19       access to mount a file tree, and parts of the list which are active are
20       kept in the kernel's export table.
21
22       Normally  this  etab file is initialized with the list of all file sys‐
23       tems named in /etc/exports by invoking exportfs -a.
24
25       However, administrators can choose to add and  delete  individual  file
26       systems without modifying /etc/exports using exportfs.
27
28       exportfs  and  it's  partner program mountd work in one of two modes, a
29       legacy mode which applies to 2.4 and earlier versions of the Linux ker‐
30       nel,  and  a new mode which applies to 2.6 and later versions providing
31       the nfsd virtual  filesystem  has  been  mounted  at  /proc/fs/nfsd  or
32       /proc/fs/nfs.   If  this  filesystem  is not mounted in 2.6, the legacy
33       mode is used.
34
35       In the new mode, exportfs does not give any information to  the  kernel
36       but  only  provides  it  to  mountd through the /var/lib/nfs/etab file.
37       mountd will listen to requests from the kernel and will provide  infor‐
38       mation as needed.
39
40       In  the legacy mode, any export requests which identify a specific host
41       (rather than a subnet or netgroup etc) are entered  directly  into  the
42       kernel's  export  table  as well as being written to /var/lib/nfs/etab.
43       Further, any mount points listed in /var/lib/nfs/rmtab  which  match  a
44       non host-specific export request will cause an appropriate export entry
45       for the host given in rmtab to be entered into the kernel's export  ta‐
46       ble.
47

OPTIONS

49       -a     Export or unexport all directories.
50
51       -o options,...
52              Specify  a  list  of  export  options  in  the same manner as in
53              exports(5).
54
55       -i     Ignore the /etc/exports file, so that only default  options  and
56              options given on the command line are used.
57
58       -r     Reexport all directories. It synchronizes /var/lib/nfs/etab with
59              /etc/exports. It removes entries in /var/lib/nfs/etab which  are
60              deleted  from /etc/exports, and remove any entries from the ker‐
61              nel export table which are no longer valid.
62
63       -u     Unexport one or more directories.
64
65       -f     In 'new' mode, flush everything out of the kernels export table.
66              Any clients that are active will get new entries added by mountd
67              when they make their next request.
68
69       -v     Be verbose. When exporting or unexporting, show what's going on.
70              When  displaying  the current export list, also display the list
71              of export options.
72

DISCUSSION

74   Exporting Directories
75       The first synopsis shows how to invoke  the  command  when  adding  new
76       entries  to  the export table.  When using exportfs -a, all directories
77       in exports(5) are added to etab and the resulting list is  pushed  into
78       the kernel.
79
80       The  host:/path  argument  specifies the directory to export along with
81       the host or hosts to export it to. All formats described in  exports(5)
82       are  supported;  to  export  a  directory  to the world, simply specify
83       :/path.
84
85       The export options for a particular  host/directory  pair  derive  from
86       several  sources.  There is a set of default options which can be over‐
87       ridden by entries in /etc/exports (unless the -i option is given).   In
88       addition, the administrator may override any options from these sources
89       using the -o argument which takes a comma-separated list of options  in
90       the  same  fashion  as  one  would  specify  them in exports(5).  Thus,
91       exportfs can also be used to modify the export options  of  an  already
92       exported directory.
93
94       Modifications  of  the  kernel  export table used by nfsd(8) take place
95       immediately after parsing the command line and updating the etab file.
96
97       The default export options are sync,ro,root_squash,wdelay.
98
99   Unexporting Directories
100       The third synopsis shows how to unexported a currently exported  direc‐
101       tory.   When using exportfs -ua, all entries listed in etab are removed
102       from the kernel export tables, and the file  is  cleared.  This  effec‐
103       tively shuts down all NFS activity.
104
105       To remove individual export entries, one can specify a host:/path pair.
106       This deletes the specified entry from etab and removes the  correspond‐
107       ing kernel entry (if any).
108
109   Dumping the Export Table
110       Invoking  exportfs  without  further  options shows the current list of
111       exported file systems.  When giving the -v option, the  list  of  flags
112       pertaining to each export are shown in addition.
113

EXAMPLES

115       The   following   adds   all  directories  listed  in  /etc/exports  to
116       /var/lib/nfs/etab and pushes the resulting export entries into the ker‐
117       nel:
118
119       # exportfs -a
120
121       To  export the /usr/tmp directory to host djando, allowing asynchronous
122       writes, one would do this:
123
124       # exportfs -o async django:/usr/tmp
125

DEPENDENCIES

127       Exporting to IP networks, DNS and NIS domains does not  enable  clients
128       from  these  groups  to  access NFS immediately; rather, these sorts of
129       exports are hints to mountd(8) to grant any mount requests  from  these
130       clients.   This  is  usually  not  a  big problem, because any existing
131       mounts are preserved in rmtab across reboots.
132
133       When unexporting a network or domain entry, any current exports to mem‐
134       bers  of this group will be checked against the remaining valid exports
135       and if they themselves are no longer valid they will be removed.
136

SEE ALSO

138       exports(5), mountd(8)
139

AUTHORS

141       Olaf Kirch, <okir@monad.swb.de>
142       Neil Brown, <neilb@cse.unsw.edu.au>
143
144
145
146
147                                 18 July 2003                      exportfs(8)
Impressum