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

NAME

6       exportfs - maintain table of exported NFS 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       An NFS server maintains a table of local physical file systems that are
17       accessible to NFS clients.  Each file system in this table is  referred
18       to as an exported file system, or export, for short.
19
20       The exportfs command maintains the current table of exports for the NFS
21       server.   The  master  export  table  is   kept   in   a   file   named
22       /var/lib/nfs/etab.  This file is read by rpc.mountd when a client sends
23       an NFS MOUNT request.
24
25       Normally the master export table is initialized with  the  contents  of
26       /etc/exports  by invoking exportfs -a.  However, a system administrator
27       can choose to add or delete exports without modifying  /etc/exports  by
28       using the exportfs command.
29
30       exportfs and its partner program rpc.mountd work in one of two modes: a
31       legacy mode which applies to 2.4 and earlier versions of the Linux ker‐
32       nel,  and a new mode which applies to 2.6 and later versions, providing
33       the nfsd virtual  filesystem  has  been  mounted  at  /proc/fs/nfsd  or
34       /proc/fs/nfs.   On  2.6 kernels, if this filesystem is not mounted, the
35       legacy mode is used.
36
37       In the new mode, exportfs does not give any information to the  kernel,
38       but  provides it only to rpc.mountd through the /var/lib/nfs/etab file.
39       rpc.mountd then manages kernel requests for information about  exports,
40       as needed.
41
42       In the legacy mode, exports which identify a specific host, rather than
43       a subnet or netgroup, are entered directly into the kernel's export ta‐
44       ble,  as  well as being written to /var/lib/nfs/etab.  Further, exports
45       listed in /var/lib/nfs/rmtab which match  a  non  host-specific  export
46       request  will  cause  an appropriate export entry for the host given in
47       rmtab to be added to the kernel's export table.
48

OPTIONS

50       -a     Export or unexport all directories.
51
52       -o options,...
53              Specify a list of export  options  in  the  same  manner  as  in
54              exports(5).
55
56       -i     Ignore  the /etc/exports file.  Only default options and options
57              given on the command line are used.
58
59       -r     Reexport all directories, synchronizing  /var/lib/nfs/etab  with
60              /etc/exports.   This option removes entries in /var/lib/nfs/etab
61              which have been  deleted  from  /etc/exports,  and  removes  any
62              entries from the kernel export table which are no longer valid.
63
64       -u     Unexport one or more directories.
65
66       -f     If  /proc/fs/nfsd  or  /proc/fs/nfs is mounted, flush everything
67              out of the kernel's export  table.   Fresh  entries  for  active
68              clients  are  added  to  the kernel's export table by rpc.mountd
69              when they make their next NFS mount request.
70
71       -v     Be verbose. When exporting or unexporting, show what's going on.
72              When  displaying  the current export list, also display the list
73              of export options.
74

DISCUSSION

76   Exporting Directories
77       The first synopsis shows how to invoke exportfs when adding new entries
78       to  the  export  table.   When using exportfs -a, all exports listed in
79       /etc/exports are added to /var/lib/nfs/etab.  The kernel's export table
80       is also updated as needed.
81
82       The  host:/path  argument  specifies a local directory to export, along
83       with the client or  clients  who  are  permitted  to  access  it.   See
84       exports(5)  for a description of supported options and access list for‐
85       mats.  To export a directory to the world, simply specify :/path.
86
87       The export options for a particular  host/directory  pair  derive  from
88       several     sources.      The     default     export     options    are
89       sync,ro,root_squash,wdelay.  These can  be  overridden  by  entries  in
90       /etc/exports.
91
92       A  system  administrator  may override options from these sources using
93       the -o command-line option on exportfs.  This option takes a comma-sep‐
94       arated list of options in the same fashion as one would specify them in
95       /etc/exports.  In this way exportfs can be used to  modify  the  export
96       options of an already exported directory.
97
98   Unexporting Directories
99       The  third synopsis shows how to unexported a currently exported direc‐
100       tory.  When using exportfs -ua, all entries listed in /var/lib/nfs/etab
101       are  removed  from  the  kernel export tables, and the file is cleared.
102       This effectively shuts down all NFS activity.
103
104       To remove an export, specify a host:/path pair. This deletes the speci‐
105       fied  entry from /var/lib/nfs/etab and removes the corresponding kernel
106       entry (if any).
107
108   Dumping the Export Table
109       Invoking exportfs without options shows the current  list  of  exported
110       file  systems.   Adding  the  -v  option causes exportfs to display the
111       export options for each export.
112

EXAMPLES

114       The  following  adds  all  directories  listed   in   /etc/exports   to
115       /var/lib/nfs/etab and pushes the resulting export entries into the ker‐
116       nel:
117
118       # exportfs -a
119
120       To export the /usr/tmp directory to host django, allowing insecure file
121       locking requests from clients:
122
123       # exportfs -o insecure_locks django:/usr/tmp
124
125       To unexport the /usr/tmp directory:
126
127       # exportfs -u django:/usr/tmp
128
129       To unexport all exports listed in /etc/exports:
130
131       # exportfs -au
132

USAGE NOTES

134       Exporting to IP networks or DNS and NIS domains does not enable clients
135       from these groups to access NFS immediately.  Rather,  these  sorts  of
136       exports  are  hints  to  rpc.mountd(8) to grant any mount requests from
137       these clients.  This is usually not a  problem,  because  any  existing
138       mounts are preserved in rmtab across reboots.
139
140       When unexporting a network or domain entry, any current exports to mem‐
141       bers of this group will be checked against the remaining valid  exports
142       and if they themselves are no longer valid they will be removed.
143

FILES

145       /etc/exports             input  file  listing  exports, export options,
146                                and access control lists
147
148       /var/lib/nfs/etab        master table of exports
149
150       /var/lib/nfs/rmtab       table of clients accessing server's exports
151

SEE ALSO

153       exports(5), rpc.mountd(8), netgroup(5)
154

AUTHORS

156       Olaf Kirch <okir@monad.swb.de>
157       Neil Brown <neilb@cse.unsw.edu.au>
158
159
160
161                               31 December 2009                    exportfs(8)
Impressum