Skip to content

Commit 0795e7c

Browse files
dhowellsdavem330
authored andcommitted
[AFS]: Update the AFS fs documentation.
Update the AFS fs documentation. Signed-off-by: David Howells <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 00d3b7a commit 0795e7c

File tree

1 file changed

+154
-60
lines changed

1 file changed

+154
-60
lines changed

Documentation/filesystems/afs.txt

Lines changed: 154 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,90 @@
1+
====================
12
kAFS: AFS FILESYSTEM
23
====================
34

4-
ABOUT
5-
=====
5+
Contents:
6+
7+
- Overview.
8+
- Usage.
9+
- Mountpoints.
10+
- Proc filesystem.
11+
- The cell database.
12+
- Security.
13+
- Examples.
14+
15+
16+
========
17+
OVERVIEW
18+
========
619

7-
This filesystem provides a fairly simple AFS filesystem driver. It is under
8-
development and only provides very basic facilities. It does not yet support
9-
the following AFS features:
20+
This filesystem provides a fairly simple secure AFS filesystem driver. It is
21+
under development and does not yet provide the full feature set. The features
22+
it does support include:
1023

11-
(*) Write support.
12-
(*) Communications security.
13-
(*) Local caching.
14-
(*) pioctl() system call.
15-
(*) Automatic mounting of embedded mountpoints.
24+
(*) Security (currently only AFS kaserver and KerberosIV tickets).
1625

26+
(*) File reading.
1727

28+
(*) Automounting.
29+
30+
It does not yet support the following AFS features:
31+
32+
(*) Write support.
33+
34+
(*) Local caching.
35+
36+
(*) pioctl() system call.
37+
38+
39+
===========
40+
COMPILATION
41+
===========
42+
43+
The filesystem should be enabled by turning on the kernel configuration
44+
options:
45+
46+
CONFIG_AF_RXRPC - The RxRPC protocol transport
47+
CONFIG_RXKAD - The RxRPC Kerberos security handler
48+
CONFIG_AFS - The AFS filesystem
49+
50+
Additionally, the following can be turned on to aid debugging:
51+
52+
CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled
53+
CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled
54+
55+
They permit the debugging messages to be turned on dynamically by manipulating
56+
the masks in the following files:
57+
58+
/sys/module/af_rxrpc/parameters/debug
59+
/sys/module/afs/parameters/debug
60+
61+
62+
=====
1863
USAGE
1964
=====
2065

2166
When inserting the driver modules the root cell must be specified along with a
2267
list of volume location server IP addresses:
2368

24-
insmod rxrpc.o
69+
insmod af_rxrpc.o
70+
insmod rxkad.o
2571
insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
2672

27-
The first module is a driver for the RxRPC remote operation protocol, and the
28-
second is the actual filesystem driver for the AFS filesystem.
73+
The first module is the AF_RXRPC network protocol driver. This provides the
74+
RxRPC remote operation protocol and may also be accessed from userspace. See:
75+
76+
Documentation/networking/rxrpc.txt
77+
78+
The second module is the kerberos RxRPC security driver, and the third module
79+
is the actual filesystem driver for the AFS filesystem.
2980

3081
Once the module has been loaded, more modules can be added by the following
3182
procedure:
3283

3384
echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells
3485

3586
Where the parameters to the "add" command are the name of a cell and a list of
36-
volume location servers within that cell.
87+
volume location servers within that cell, with the latter separated by colons.
3788

3889
Filesystems can be mounted anywhere by commands similar to the following:
3990

@@ -42,11 +93,6 @@ Filesystems can be mounted anywhere by commands similar to the following:
4293
mount -t afs "#root.afs." /afs
4394
mount -t afs "#root.cell." /afs/cambridge
4495

45-
NB: When using this on Linux 2.4, the mount command has to be different,
46-
since the filesystem doesn't have access to the device name argument:
47-
48-
mount -t afs none /afs -ovol="#root.afs."
49-
5096
Where the initial character is either a hash or a percent symbol depending on
5197
whether you definitely want a R/W volume (hash) or whether you'd prefer a R/O
5298
volume, but are willing to use a R/W volume instead (percent).
@@ -60,55 +106,66 @@ named volume will be looked up in the cell specified during insmod.
60106
Additional cells can be added through /proc (see later section).
61107

62108

109+
===========
63110
MOUNTPOINTS
64111
===========
65112

66-
AFS has a concept of mountpoints. These are specially formatted symbolic links
67-
(of the same form as the "device name" passed to mount). kAFS presents these
68-
to the user as directories that have special properties:
113+
AFS has a concept of mountpoints. In AFS terms, these are specially formatted
114+
symbolic links (of the same form as the "device name" passed to mount). kAFS
115+
presents these to the user as directories that have a follow-link capability
116+
(ie: symbolic link semantics). If anyone attempts to access them, they will
117+
automatically cause the target volume to be mounted (if possible) on that site.
69118

70-
(*) They cannot be listed. Running a program like "ls" on them will incur an
71-
EREMOTE error (Object is remote).
119+
Automatically mounted filesystems will be automatically unmounted approximately
120+
twenty minutes after they were last used. Alternatively they can be unmounted
121+
directly with the umount() system call.
72122

73-
(*) Other objects can't be looked up inside of them. This also incurs an
74-
EREMOTE error.
123+
Manually unmounting an AFS volume will cause any idle submounts upon it to be
124+
culled first. If all are culled, then the requested volume will also be
125+
unmounted, otherwise error EBUSY will be returned.
75126

76-
(*) They can be queried with the readlink() system call, which will return
77-
the name of the mountpoint to which they point. The "readlink" program
78-
will also work.
127+
This can be used by the administrator to attempt to unmount the whole AFS tree
128+
mounted on /afs in one go by doing:
79129

80-
(*) They can be mounted on (which symbolic links can't).
130+
umount /afs
81131

82132

133+
===============
83134
PROC FILESYSTEM
84135
===============
85136

86-
The rxrpc module creates a number of files in various places in the /proc
87-
filesystem:
88-
89-
(*) Firstly, some information files are made available in a directory called
90-
"/proc/net/rxrpc/". These list the extant transport endpoint, peer,
91-
connection and call records.
92-
93-
(*) Secondly, some control files are made available in a directory called
94-
"/proc/sys/rxrpc/". Currently, all these files can be used for is to
95-
turn on various levels of tracing.
96-
97137
The AFS modules creates a "/proc/fs/afs/" directory and populates it:
98138

99-
(*) A "cells" file that lists cells currently known to the afs module.
139+
(*) A "cells" file that lists cells currently known to the afs module and
140+
their usage counts:
141+
142+
[root@andromeda ~]# cat /proc/fs/afs/cells
143+
USE NAME
144+
3 cambridge.redhat.com
100145

101146
(*) A directory per cell that contains files that list volume location
102147
servers, volumes, and active servers known within that cell.
103148

149+
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
150+
USE ADDR STATE
151+
4 172.16.18.91 0
152+
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers
153+
ADDRESS
154+
172.16.18.91
155+
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes
156+
USE STT VLID[0] VLID[1] VLID[2] NAME
157+
1 Val 20000000 20000001 20000002 root.afs
104158

159+
160+
=================
105161
THE CELL DATABASE
106162
=================
107163

108-
The filesystem maintains an internal database of all the cells it knows and
109-
the IP addresses of the volume location servers for those cells. The cell to
110-
which the computer belongs is added to the database when insmod is performed
111-
by the "rootcell=" argument.
164+
The filesystem maintains an internal database of all the cells it knows and the
165+
IP addresses of the volume location servers for those cells. The cell to which
166+
the system belongs is added to the database when insmod is performed by the
167+
"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
168+
the kernel command line.
112169

113170
Further cells can be added by commands similar to the following:
114171

@@ -118,20 +175,65 @@ Further cells can be added by commands similar to the following:
118175
No other cell database operations are available at this time.
119176

120177

178+
========
179+
SECURITY
180+
========
181+
182+
Secure operations are initiated by acquiring a key using the klog program. A
183+
very primitive klog program is available at:
184+
185+
http://people.redhat.com/~dhowells/rxrpc/klog.c
186+
187+
This should be compiled by:
188+
189+
make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"
190+
191+
And then run as:
192+
193+
./klog
194+
195+
Assuming it's successful, this adds a key of type RxRPC, named for the service
196+
and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or
197+
by cat'ing /proc/keys:
198+
199+
[root@andromeda ~]# keyctl show
200+
Session Keyring
201+
-3 --alswrv 0 0 keyring: _ses.3268
202+
2 --alswrv 0 0 \_ keyring: _uid.0
203+
111416553 --als--v 0 0 \_ rxrpc: [email protected]
204+
205+
Currently the username, realm, password and proposed ticket lifetime are
206+
compiled in to the program.
207+
208+
It is not required to acquire a key before using AFS facilities, but if one is
209+
not acquired then all operations will be governed by the anonymous user parts
210+
of the ACLs.
211+
212+
If a key is acquired, then all AFS operations, including mounts and automounts,
213+
made by a possessor of that key will be secured with that key.
214+
215+
If a file is opened with a particular key and then the file descriptor is
216+
passed to a process that doesn't have that key (perhaps over an AF_UNIX
217+
socket), then the operations on the file will be made with key that was used to
218+
open the file.
219+
220+
221+
========
121222
EXAMPLES
122223
========
123224

124-
Here's what I use to test this. Some of the names and IP addresses are local
125-
to my internal DNS. My "root.afs" partition has a mount point within it for
225+
Here's what I use to test this. Some of the names and IP addresses are local
226+
to my internal DNS. My "root.afs" partition has a mount point within it for
126227
some public volumes volumes.
127228

128-
insmod -S /tmp/rxrpc.o
129-
insmod -S /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
229+
insmod /tmp/rxrpc.o
230+
insmod /tmp/rxkad.o
231+
insmod /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.91
130232

131233
mount -t afs \%root.afs. /afs
132234
mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/
133235

134-
echo add grand.central.org 18.7.14.88:128.2.191.224 > /proc/fs/afs/cells
236+
echo add grand.central.org 18.7.14.88:128.2.191.224 > /proc/fs/afs/cells
135237
mount -t afs "#grand.central.org:root.cell." /afs/grand.central.org/
136238
mount -t afs "#grand.central.org:root.archive." /afs/grand.central.org/archive
137239
mount -t afs "#grand.central.org:root.contrib." /afs/grand.central.org/contrib
@@ -141,15 +243,7 @@ mount -t afs "#grand.central.org:root.service." /afs/grand.central.org/service
141243
mount -t afs "#grand.central.org:root.software." /afs/grand.central.org/software
142244
mount -t afs "#grand.central.org:root.user." /afs/grand.central.org/user
143245

144-
umount /afs/grand.central.org/user
145-
umount /afs/grand.central.org/software
146-
umount /afs/grand.central.org/service
147-
umount /afs/grand.central.org/project
148-
umount /afs/grand.central.org/doc
149-
umount /afs/grand.central.org/contrib
150-
umount /afs/grand.central.org/archive
151-
umount /afs/grand.central.org
152-
umount /afs/cambridge.redhat.com
153246
umount /afs
154247
rmmod kafs
248+
rmmod rxkad
155249
rmmod rxrpc

0 commit comments

Comments
 (0)