blob: 8c6ea7b41048a92d5b29c449cacfb9fe20277bdb [file] [log] [blame]
David Howells0795e7c02007-04-26 15:57:43 -07001 ====================
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 kAFS: AFS FILESYSTEM
3 ====================
4
David Howells0795e7c02007-04-26 15:57:43 -07005Contents:
6
7 - Overview.
8 - Usage.
9 - Mountpoints.
David Howells4d673da2018-02-06 06:26:30 +000010 - Dynamic root.
David Howells0795e7c02007-04-26 15:57:43 -070011 - Proc filesystem.
12 - The cell database.
13 - Security.
David Howells6f8880d2018-04-09 21:12:31 +010014 - The @sys substitution.
David Howells0795e7c02007-04-26 15:57:43 -070015
16
17========
18OVERVIEW
19========
20
21This filesystem provides a fairly simple secure AFS filesystem driver. It is
22under development and does not yet provide the full feature set. The features
23it does support include:
24
25 (*) Security (currently only AFS kaserver and KerberosIV tickets).
26
Anton Blanchard0dc9aa82009-08-19 16:10:16 +010027 (*) File reading and writing.
David Howells0795e7c02007-04-26 15:57:43 -070028
29 (*) Automounting.
30
Anton Blanchard0dc9aa82009-08-19 16:10:16 +010031 (*) Local caching (via fscache).
32
David Howells0795e7c02007-04-26 15:57:43 -070033It does not yet support the following AFS features:
34
David Howells0795e7c02007-04-26 15:57:43 -070035 (*) pioctl() system call.
36
37
38===========
39COMPILATION
40===========
41
42The filesystem should be enabled by turning on the kernel configuration
43options:
44
45 CONFIG_AF_RXRPC - The RxRPC protocol transport
46 CONFIG_RXKAD - The RxRPC Kerberos security handler
47 CONFIG_AFS - The AFS filesystem
48
49Additionally, the following can be turned on to aid debugging:
50
51 CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled
52 CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled
53
54They permit the debugging messages to be turned on dynamically by manipulating
55the masks in the following files:
56
57 /sys/module/af_rxrpc/parameters/debug
Anton Blanchard0dc9aa82009-08-19 16:10:16 +010058 /sys/module/kafs/parameters/debug
David Howells0795e7c02007-04-26 15:57:43 -070059
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061=====
Linus Torvalds1da177e2005-04-16 15:20:36 -070062USAGE
63=====
64
65When inserting the driver modules the root cell must be specified along with a
66list of volume location server IP addresses:
67
David Howells88c48452017-02-17 18:16:21 +000068 modprobe rxrpc
Anton Blanchard0dc9aa82009-08-19 16:10:16 +010069 modprobe kafs rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
David Howells0795e7c02007-04-26 15:57:43 -070071The first module is the AF_RXRPC network protocol driver. This provides the
72RxRPC remote operation protocol and may also be accessed from userspace. See:
73
74 Documentation/networking/rxrpc.txt
75
76The second module is the kerberos RxRPC security driver, and the third module
77is the actual filesystem driver for the AFS filesystem.
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
79Once the module has been loaded, more modules can be added by the following
80procedure:
81
Anton Blanchard0dc9aa82009-08-19 16:10:16 +010082 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
84Where the parameters to the "add" command are the name of a cell and a list of
David Howells0795e7c02007-04-26 15:57:43 -070085volume location servers within that cell, with the latter separated by colons.
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
87Filesystems can be mounted anywhere by commands similar to the following:
88
89 mount -t afs "%cambridge.redhat.com:root.afs." /afs
90 mount -t afs "#cambridge.redhat.com:root.cell." /afs/cambridge
91 mount -t afs "#root.afs." /afs
92 mount -t afs "#root.cell." /afs/cambridge
93
Linus Torvalds1da177e2005-04-16 15:20:36 -070094Where the initial character is either a hash or a percent symbol depending on
David Howellsbecfcc72017-11-02 15:27:51 +000095whether you definitely want a R/W volume (percent) or whether you'd prefer a
96R/O volume, but are willing to use a R/W volume instead (hash).
Linus Torvalds1da177e2005-04-16 15:20:36 -070097
98The name of the volume can be suffixes with ".backup" or ".readonly" to
99specify connection to only volumes of those types.
100
101The name of the cell is optional, and if not given during a mount, then the
Anton Blanchard0dc9aa82009-08-19 16:10:16 +0100102named volume will be looked up in the cell specified during modprobe.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103
104Additional cells can be added through /proc (see later section).
105
106
David Howells0795e7c02007-04-26 15:57:43 -0700107===========
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108MOUNTPOINTS
109===========
110
David Howells0795e7c02007-04-26 15:57:43 -0700111AFS has a concept of mountpoints. In AFS terms, these are specially formatted
112symbolic links (of the same form as the "device name" passed to mount). kAFS
113presents these to the user as directories that have a follow-link capability
114(ie: symbolic link semantics). If anyone attempts to access them, they will
115automatically cause the target volume to be mounted (if possible) on that site.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
David Howells0795e7c02007-04-26 15:57:43 -0700117Automatically mounted filesystems will be automatically unmounted approximately
118twenty minutes after they were last used. Alternatively they can be unmounted
119directly with the umount() system call.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
David Howells0795e7c02007-04-26 15:57:43 -0700121Manually unmounting an AFS volume will cause any idle submounts upon it to be
122culled first. If all are culled, then the requested volume will also be
123unmounted, otherwise error EBUSY will be returned.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124
David Howells0795e7c02007-04-26 15:57:43 -0700125This can be used by the administrator to attempt to unmount the whole AFS tree
126mounted on /afs in one go by doing:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
David Howells0795e7c02007-04-26 15:57:43 -0700128 umount /afs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
130
David Howells4d673da2018-02-06 06:26:30 +0000131============
132DYNAMIC ROOT
133============
134
135A mount option is available to create a serverless mount that is only usable
136for dynamic lookup. Creating such a mount can be done by, for example:
137
138 mount -t afs none /afs -o dyn
139
140This creates a mount that just has an empty directory at the root. Attempting
141to look up a name in this directory will cause a mountpoint to be created that
142looks up a cell of the same name, for example:
143
144 ls /afs/grand.central.org/
145
146
David Howells0795e7c02007-04-26 15:57:43 -0700147===============
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148PROC FILESYSTEM
149===============
150
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151The AFS modules creates a "/proc/fs/afs/" directory and populates it:
152
David Howells0795e7c02007-04-26 15:57:43 -0700153 (*) A "cells" file that lists cells currently known to the afs module and
154 their usage counts:
155
156 [root@andromeda ~]# cat /proc/fs/afs/cells
157 USE NAME
158 3 cambridge.redhat.com
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
160 (*) A directory per cell that contains files that list volume location
161 servers, volumes, and active servers known within that cell.
162
David Howells0795e7c02007-04-26 15:57:43 -0700163 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
164 USE ADDR STATE
165 4 172.16.18.91 0
166 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers
167 ADDRESS
168 172.16.18.91
169 [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes
170 USE STT VLID[0] VLID[1] VLID[2] NAME
171 1 Val 20000000 20000001 20000002 root.afs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
David Howells0795e7c02007-04-26 15:57:43 -0700173
174=================
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175THE CELL DATABASE
176=================
177
David Howells0795e7c02007-04-26 15:57:43 -0700178The filesystem maintains an internal database of all the cells it knows and the
179IP addresses of the volume location servers for those cells. The cell to which
Anton Blanchard0dc9aa82009-08-19 16:10:16 +0100180the system belongs is added to the database when modprobe is performed by the
David Howells0795e7c02007-04-26 15:57:43 -0700181"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
182the kernel command line.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183
184Further cells can be added by commands similar to the following:
185
186 echo add CELLNAME VLADDR[:VLADDR][:VLADDR]... >/proc/fs/afs/cells
Anton Blanchard0dc9aa82009-08-19 16:10:16 +0100187 echo add grand.central.org 18.9.48.14:128.2.203.61:130.237.48.87 >/proc/fs/afs/cells
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
189No other cell database operations are available at this time.
190
191
David Howells0795e7c02007-04-26 15:57:43 -0700192========
193SECURITY
194========
195
196Secure operations are initiated by acquiring a key using the klog program. A
197very primitive klog program is available at:
198
199 http://people.redhat.com/~dhowells/rxrpc/klog.c
200
201This should be compiled by:
202
203 make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"
204
205And then run as:
206
207 ./klog
208
209Assuming it's successful, this adds a key of type RxRPC, named for the service
210and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or
211by cat'ing /proc/keys:
212
213 [root@andromeda ~]# keyctl show
214 Session Keyring
215 -3 --alswrv 0 0 keyring: _ses.3268
216 2 --alswrv 0 0 \_ keyring: _uid.0
217 111416553 --als--v 0 0 \_ rxrpc: afs@CAMBRIDGE.REDHAT.COM
218
219Currently the username, realm, password and proposed ticket lifetime are
220compiled in to the program.
221
222It is not required to acquire a key before using AFS facilities, but if one is
223not acquired then all operations will be governed by the anonymous user parts
224of the ACLs.
225
226If a key is acquired, then all AFS operations, including mounts and automounts,
227made by a possessor of that key will be secured with that key.
228
229If a file is opened with a particular key and then the file descriptor is
230passed to a process that doesn't have that key (perhaps over an AF_UNIX
231socket), then the operations on the file will be made with key that was used to
232open the file.
David Howells6f8880d2018-04-09 21:12:31 +0100233
234
235=====================
236THE @SYS SUBSTITUTION
237=====================
238
239The list of up to 16 @sys substitutions for the current network namespace can
240be configured by writing a list to /proc/fs/afs/sysname:
241
242 [root@andromeda ~]# echo foo amd64_linux_26 >/proc/fs/afs/sysname
243
244or cleared entirely by writing an empty list:
245
246 [root@andromeda ~]# echo >/proc/fs/afs/sysname
247
248The current list for current network namespace can be retrieved by:
249
250 [root@andromeda ~]# cat /proc/fs/afs/sysname
251 foo
252 amd64_linux_26
253
254When @sys is being substituted for, each element of the list is tried in the
255order given.
256
257By default, the list will contain one item that conforms to the pattern
258"<arch>_linux_26", amd64 being the name for x86_64.