Update instructions to reflect syntax changes, in particular 'make srpm'
[openafs-wiki.git] / AdminFAQ.mdwn
1 ## <a name="3  AFS administration"></a> 3 AFS administration
2
3 The Administration Section of the [[AFSFrequentlyAskedQuestions]].
4
5 [[PreambleFAQ]]
6
7 [[GeneralFAQ]]
8
9 [[UsageFAQ]]
10
11 <div>
12   <p><a href="#3  AFS administration">3 AFS administration</a></p>
13   <ul>
14     <li><a href="#afsVerOfX"> 3.01  Is there a version of <em>program</em> available with AFS authentication?</a>
15     <li><a href="#afsatcell"> 3.02  What is <code>/afs/@cell</code>?</a>
16     <li><a href="#vldb"> 3.03  Given that AFS data is location independent, how does an AFS client determine which server houses the data its user is attempting to access?</a>
17     <li><a href="#callbacks"> 3.04  How does AFS maintain consistency on read-write files?</a>
18     <li><a href="#protocols"> 3.05  Which protocols does AFS use?</a>
19     <li><a href="#ports"> 3.06  Which TCP/IP ports and protocols do I need to enable in order to operate AFS through my Internet firewall?</a>
20     <li><a href="#setuid"> 3.07  Are setuid programs executable across AFS cell boundaries?</a>
21     <li><a href="#kstart"> 3.08  How can I run daemons with tokens that do not expire?</a>
22     <li><a href="#crack"> 3.09  Can I check my users' passwords for security purposes?</a>
23     <li><a href="#balance"> 3.10  Is there a way to automatically balance disk usage across fileservers?</a>
24     <li><a href="#shutdown"> 3.11  Can I shutdown an AFS fileserver without affecting users?</a>
25     <li><a href="#mail"> 3.12  How can I set up mail delivery to users with <code>$HOME</code>s in AFS?</a>
26     <li><a href="#shadowro"> 3.13  Should I replicate a ReadOnly volume on the same partition and server as the ReadWrite volume?</a>
27     <li><a href="#multihomed"> 3.14  Will AFS run on a multi-homed fileserver?</a>
28     <li><a href="#replicatehome"> 3.15  Can I replicate my user's home directory AFS volumes?</a>
29     <li><a href="#listclients"> 3.16  How can I list which clients have cached files from a server?</a>
30     <li><a href="#backupvol"> 3.17  Do Backup volumes require as much space as ReadWrite volumes?</a>
31     <li><a href="#ntp"> 3.18  Should I run <code>ntpd</code> on my AFS client?</a>
32     <li><a href="#cellservdb"> 3.19  Why and how should I keep <code>/usr/vice/etc/CellServDB</code> current?</a>
33     <li><a href="#fileservers"> 3.20  How can I compile a list of AFS fileservers?</a>
34     <li><a href="#anonftp"> 3.21  How can I set up anonymous FTP login to access <code>/afs</code>?</a>
35     <li><a href="#encrypt"> 3.22  Is the data sent over the network encrypted in AFS?</a>
36     <li><a href="#filesystems"> 3.23  What underlying filesystems can I use for AFS?</a>
37     <li><a href="#3.30 Compiling _OpenAFS"> 3.24  Compiling OpenAFS from source</a>
38     <li><a href="#3.31 Upgrading _OpenAFS"> 3.25  Upgrading OpenAFS</a>
39     <li><a href="#3.32 Debugging _OpenAFS"> 3.26  Notes on debugging OpenAFS</a>
40     <li><a href="#3.33 Tuning client cache for hug"> 3.27  Tuning client cache for huge data</a>
41     <li><a href="#3.34 Settting up PAM with AFS"> 3.28  Settting up PAM with AFS</a>
42     <li><a href="#afskrbconf"> 3.29  How can I have a Kerberos realm different from the AFS cell name? How can I use an AFS cell across multiple Kerberos realms?</a>
43     <li><a href="#bosinstances"> 3.30  What are the <code>bos</code> instance types? How do I use them?</a>
44     <li><a href="#syscall"> 3.31  afsd gives me "<code>Error -1 in basic initialization.</code>" on startup</a>
45     <li><a href="#translate_et"> 3.32  Error "<code>afs: Tokens for user of AFS id 0 for cell foo.bar.baz are discarded (rxkad error=19270407)</code>"</a>
46     <li><a href="#UserList"> 3.33  I have tickets and tokens, but still get <code>Permission denied</code> for some operations.</a>
47     <li><a href="#flushvol"> 3.34  Recovering broken AFS cache on clients</a>
48     <li><a href="#notinvldb"> 3.35  What does it mean for a volume to not be in the VLDB?</a>
49     <li><a href="#volumegroup"> 3.36  What is a Volume Group?</a>
50     <li><a href="#clone"> 3.37  What is a Clone?</a>
51     <li><a href="#shadow"> 3.38  What is a Shadow?</a>
52     <li><a href="#multirealm"> 3.39  Can I authenticate to my AFS cell using multiple Kerberos realms?</a>
53     <li><a href="#nss"> 3.40  How can I ensure that the userids on client machines match the users' <code>pts</code> ids?</a>
54     <li><a href="#fastrestart"> 3.41  What is Fast Restart?</a>
55     <li><a href="#restart"> 3.42  Why does AFS reboot itself spontaneously at 4:00am every Sunday?</a>
56     <li><a href="#weakcrypto"> 3.43  Why do I get an error -1765328370 when authenticating?</a>
57   </ul>
58 </div>
59
60 [[ResourcesFAQ]]
61
62 [[AboutTheFAQ]]
63
64 [[FurtherReading]]
65
66 ### <a name="afsVerOfX"></a><a name="3.01  Is there a version of xdm"></a><a name="3.02  Is there a version of xloc"></a> 3.01 Is there a version of _program_ available with AFS authentication?
67
68 In general, not specifically; modern systems use authentication frameworks, so that an e.g. AFS plugin can be added to the framework and all programs will thereby be able to use it without modification. On many systems, the authentication framework is PAM (Pluggable Authentication Modules). Acquiring AFS tokens via PAM can be done by several different PAM modules, including Russ Allbery's [pam-afs-session](http://www.eyrie.org/~eagle/software/pam-afs-session/) and Red Hat's `pam_krb5afs`.
69
70 ### <a name="afsatcell"></a><a name="3.03  What is /afs/@cell?"></a> 3.02 What is `/afs/@cell`?
71
72 It is a commonly created symbolic link pointing at `/afs/$your_cell_name`. `@cell` is not something that is provided by AFS. You may decide it is useful in your cell and wish to create it yourself.
73
74 `/afs/@cell` is useful because:
75
76 - If you look after more than one AFS cell, you could create the link in each cell then set your `$PATH` as:
77
78         PATH=$PATH:/afs/@cell/@sys/local/bin
79
80 - For most cells, it shortens the path names to be typed in, thus reducing typos and saving time.
81
82 A disadvantage of using this convention is that when you `cd` into `/afs/@cell` then type `pwd` you see `/afs/@cell` instead of the full name of your cell. This may appear confusing if a user wants to tell a user in another cell the pathname to a file.
83
84 You could create your own `/afs/@cell` with the following script (usable in `ksh` or any POSIX shell):
85
86     #/bin/ksh -
87     # author: mpb
88     [ -L /afs/@cell ] && echo We already have @cell! && exit
89     cell=$(cat /usr/vice/etc/ThisCell)
90     cd /afs/.${cell} && fs mkm temp root.afs
91     cd temp
92     ln -s /afs/${cell} @cell
93     ln -s /afs/.${cell} .@cell            # .@cell for RW path
94     cd /afs/.${cell} && fs rmm temp
95     vos release root.afs; fs checkv
96
97 <http://www-archive.stanford.edu/lists/info-afs/hyper95/0298.html>
98
99 ### <a name="vldb"></a><a name="3.04  Given that AFS data is loc"></a> 3.03 Given that AFS data is location independent, how does an AFS client determine which server houses the data its user is attempting to access?
100
101 The Volume Location Database (VLDB) is stored on AFS Database Servers and is ideally replicated across 3 or more Database Server machines. Replication of the Database ensures high availability and load balances the requests for the data. The VLDB maintains information regarding the current physical location of all volume data (files and directories) in the cell, including the IP address of the [[FileServer]], and the name of the disk partition the data is stored on.
102
103 A list of a cell's Database Servers is stored on the local disk of each AFS Client machine as `/usr/vice/etc/CellServDB`
104
105 The Database Servers also house the Protection Database (user UID and protection group information) and the Backup Database (used by System Administrators to backup AFS file data to tape), and in older sites the Kerberos Authentication Database (encrypted user and server passwords).
106
107 ### <a name="callbacks"></a><a name="3.05  How does AFS maintain cons"></a> 3.04 How does AFS maintain consistency on read-write files?
108
109 AFS uses a mechanism called "callbacks".
110
111 A callback is a promise from the fileserver that the cache version of a file/directory is up-to-date. It is established by the fileserver with the caching of a file.
112
113 When a file is modified, the fileserver breaks the callback. When the user accesses the file again the Cache Manager fetches a new copy if the callback has been broken or it has expired (after 2 hours by default).
114
115 The following paragraphs describe the AFS callback mechanism in more detail:
116
117 If I `open()` `fileA` and start reading, and you then `open()` `fileA`, `write()` a change **\*\*and `close()` or `fsync()`\*\*** the file to get your changes back to the server - at the time the server accepts and writes your changes to the appropriate location on the server disk, the server also breaks callbacks to all clients to which it issued a copy of `fileA`.
118
119 So my client receives a message to break the callback on `fileA`, which it dutifully does. But my application (editor, spreadsheet, whatever I'm using to read fileA) is still running, and doesn't really care that the callback has been broken.
120
121 When something causes the application to `read()` more of the file, the `read()` system call executes AFS cache manager code via the VFS switch, which does check the callback and therefore gets new copies of the data.
122
123 Of course, the application may not re-read data that it has already read, but that would also be the case if you were both using the same host. So, for both AFS and local files, I may not see your changes.
124
125 Now if I exit the application and start it again, or if the application does another `open()` on the file, then I will see the changes you've made.
126
127 This information tends to cause tremendous heartache and discontent - but unnecessarily so. People imagine rampant synchronization problems. In practice this rarely happens and in those rare instances, the data in question is typically not critical enough to cause real problems or crashing and burning of applications. Since 1985, we've found that the synchronization algorithm has been more than adequate in practice - but people still like to worry!
128
129 The source of worry is that, if I make changes to a file from my workstation, your workstation is not guaranteed to be notified until I `close` or `fsync` the file, at which point AFS guarantees that your workstation will be notified. This is a significant departure from NFS, in which no guarantees are provided.
130
131 ### <a name="protocols"></a><a name="3.06  Which protocols does AFS u"></a> 3.05 Which protocols does AFS use?
132
133 AFS may be thought of as a collection of protocols and software processes, nested one on top of the other. The constant interaction between and within these levels makes AFS a very sophisticated software system.
134
135 At the lowest level is the UDP protocol. UDP is the connection to the actual network wire. The next protocol level is the remote procedure call (RPC). In general, RPCs allow the developer to build applications using the client/server model, hiding the underlying networking mechanisms. AFS uses Rx, an RPC protocol developed specifically for AFS during its development phase at Carnegie Mellon University.
136
137 Above the RPC is a series of server processes and interfaces that all use Rx for communication between machines. Fileserver, volserver, upserver, upclient, and bosserver are server processes that export RPC interfaces to allow their user interface commands to request actions and get information. For example, a bos status  command will examine the bos server process on the indicated file server machine.
138
139 Database servers use ubik, a replicated database mechanism which is implemented using RPC. Ubik guarantees that the copies of AFS databases of multiple server machines remain consistent. It provides an application programming interface (API) for database reads and writes, and uses RPCs to keep the database synchronized. The database server processes, `vlserver` and `ptserver`, reside above ubik. These processes export an RPC interface which allows user commands to control their operation. For instance, the `pts` command is used to communicate with the `ptserver`, while the command `vos` uses the `vlserver`'s RPC interface.
140
141 Some application programs are quite complex, and draw on RPC interfaces for communication with an assortment of processes. Scout utilizes the RPC interface to file server processes to display and monitor the status of file servers. The `uss` command interfaces with `ptserver`, `volserver`, and `vlserver` to create new user accounts.
142
143 The Cache Manager also exports an RPC interface. This interface is used principally by file server machines to break callbacks. It can also be used to obtain Cache Manager status information. The program `cmdebug` shows the status of a Cache Manager using this interface.
144
145 For additional information, Section 1.5 of the AFS System Administrator's Guide and the April 1990 Cache Update contain more information on ubik. Udebug information and short descriptions of all debugging tools were included in the January 1991 Cache Update. Future issues will discuss other debugging tools in more detail.
146
147 [source: <ftp://ftp.transarc.com/pub/afsug/newsletter/apr91>] [Copyright 1991 Transarc Corporation]
148
149 ### <a name="ports"></a><a name="3.07  Which TCP/IP ports and pro"></a> 3.06 Which TCP/IP ports and protocols do I need to enable in order to operate AFS through my Internet firewall?
150
151 Outbound destination ports for a client:
152
153     kerberos 88/udp 88/tcp
154     ntp 123/udp
155     afs3-fileserver 7000/udp
156     afs3-ptserver 7002/udp
157     afs3-vlserver 7003/udp
158     afs3-volserver 7005/udp
159
160 If you also plan to control AFS servers from a client, you will also need
161
162     afs3-bosserver 7007/udp
163
164 You will also need to allow an inbound port
165
166     afs3-callback 7001/udp
167
168 or if you are using Arla
169
170     cachemanager 4711/udp
171
172 (Note: if you are using NAT, you should try to to arrange for the UDP NAT timeout on port 7001 to be at least two hours. Recent [[OpenAFS]] server and client versions will try to send keepalives to keep the callback NAT entry open, but some consumer router/WiFi/NAT devices may have a timeout that is too short even for this keepalive. If the NAT entry expires, your cache manager will not be [[notified of file changes on the server|AdminFAQ#callbacks]] and you will only find out about file changes approximately after two hours, when the callback expires.)
173
174 You will also need to allow various ephemeral UDP source ports for outbound connections, but you will need to do this for DNS and [[NTP|AdminFAQ#ntp]] anyway.
175
176 ### <a name="setuid"></a><a name="3.08  Are setuid programs execut"></a> 3.07 Are setuid programs executable across AFS cell boundaries?
177
178 By default, the setuid bit is ignored but the program may be run (without setuid privilege). It would be bad to allow arbitrary setuid programs in remote cells to run; consider that someone could put a setuid copy of `bash` in a personal cell, arrange for that to be visible via DNS `SRV` records, and then `fs mkmount` a reference to it in their AFS space on e.g. a school machine.
179
180 It is possible to configure an AFS client to honor the setuid bit. This is achieved by `root` (only) running:
181
182        root@toontown # fs setcell -cell $cellname -suid
183
184 where `$cellname` is the name of the foreign cell. Use with care!
185
186 Note that making a program setuid (or setgid) in AFS does **not** mean that the program will get AFS permissions of a user or group. To become AFS authenticated, you have to `aklog`. If you are not authenticated to AFS, AFS treats you as `system:anyuser`. setuid only affects local Unix permissions (and is meaningless on Windows clients).
187
188 ### <a name="kstart"></a><a name="3.09  How can I run daemons with"></a> 3.08 How can I run daemons with tokens that do not expire?
189
190 It is not a good idea to run with tokens that do not expire because this would weaken one of the security features of Kerberos. A (slightly) better approach is to re-authenticate just before the token expires. (Even more preferable would be to get a token for a particular operation, preferably from the user performing some operation, but this is not always possible, especially with services that are not aware of Kerberos.)
191
192 The most common way to achieve this these days is to generate a keytab containing the credentials you want the daemon to have, and use a program like [k5start](http://www.eyrie.org/~eagle/software/kstart/) to run the daemon with those credentials.
193
194 ### <a name="crack"></a><a name="3.10  Can I check my user&#39;s pass"></a> 3.09 Can I check my users' passwords for security purposes?
195
196 The major Kerberos implementations (MIT Kerberos and Heimdal) all include ways to do password strength checking when a user chooses a password. There are not currently any (public!) utilities to check keys in a KDC (which are generated from passwords) against dictionaries; and you cannot (generally) generate an unencrypted KDC dump to check them (the KDC keys are double-encrypted: not only are they stored as encrypted keys instead of the original plaintext passwords, but the entire record is encrypted with the KDC's own master key).
197
198 ### <a name="balance"></a><a name="3.11  Is there a way to automati"></a> 3.10 Is there a way to automatically balance disk usage across fileservers?
199
200 Yes. There is a tool, balance, which does exactly this. It can be retrieved via anonymous ftp from <ftp://ftp.andrew.cmu.edu/pub/AFS-Tools/balance-1.2-beta.tar.gz>. (It does not appear to have been updated since late 2003).
201
202 Actually, it is possible to write arbitrary balancing algorithms for this tool. The default set of "agents" provided for the current version of balance balance by usage, # of volumes, and activity per week, the latter currently requiring a source patch to the AFS volserver. Balance is highly configurable.
203
204 Author: Dan Lovinger Contact: Derrick Brashear &lt;shadow+@andrew.cmu.edu&gt;
205
206 ### <a name="shutdown"></a><a name="3.12  Can I shutdown an AFS file"></a> 3.11 Can I shutdown an AFS fileserver without affecting users?
207
208 Yes, this is an example of the flexibility you have in managing AFS.
209
210 Before attempting to shutdown an AFS fileserver you have to make some arrangements that any services that were being provided are moved to another AFS fileserver:
211
212 1. Move all AFS volumes to another fileserver. (Check you have the space!) This can be done "live" while users are actively using files in those volumes with no detrimental effects.
213
214 1. Make sure that critical services have been replicated on one (or more) other fileserver(s). Such services include:
215   - `vlserver` - Volume Location server
216   - `ptserver` - Protection server
217   - `buserver` - Backup server
218   - `kaserver` - Old Kerberos Authentication server
219   - `fileserver`
220   - Kerberos KDCs, or `kaserver` on older installations
221
222 It is simple to test this before the real shutdown by issuing:
223
224     bos shutdown $server $service
225
226 where `$server` is the name of the server to be shutdown and `$service` is `-all` or the specific service to be shut down. Note that a service instance may *not* be the same as the service name; use `bos status $server` to check. (One common configuration uses short names like `pts` or even `pt` for the `ptserver` service, for example.)
227
228 Kerberos services are usually not managed via `bos`; check the OS's services manager for `krb5kdc`, `kadmind`, `kpasswdd`, and similar. (Different Kerberos implementations will have different service daemons.)
229
230 Other points to bear in mind:
231
232 - `vos remove` any RO volumes on the server to be shutdown. Create corresponding RO volumes on the 2nd fileserver after moving the RW. There are two reasons for this:
233     1. An RO on the same partition ("cheap replica") requires less space than a full-copy RO.
234     2. Because AFS always accesses RO volumes in preference to RW, traffic will be directed to the RO and therefore quiesce the load on the fileserver to be shutdown.
235 - If you are still using `kaserver` and the system to be shutdown has the lowest IP address, there may be a brief delay in authenticating because of timeout experienced before contacting a second `kaserver`.
236
237 ### <a name="mail"></a><a name="3.13  How can I set up mail deli"></a><a name="3.52  Is it a good idea to store"></a> 3.12 How can I set up mail delivery to users with `$HOME`s in AFS?
238
239 Preferably, don't. This has been found to scale poorly because of high load on read-write servers; mail clients check for new mail every few minutes (or even seconds) and this will cause problems for any file server. Additionally, as the mail server cannot authenticate to AFS as the receiving user, you need to carefully manage permissions on the receiving directory tree to avoid mail being lost or the directory being used as a general dropbox with potential security implications.
240
241 See [this message](http://www.openafs.org/pipermail/openafs-info/2007-June/026621.html) for more information about the scalability of mail delivery onto a shared fileserver. (Something to think about: very similar considerations are why the recommendation for Exchange mail servers is to only have a small number of users on each mailbox server.)
242
243 If you absolutely must do this for some reason, here's one way to do it.
244
245 First, you must have your mail delivery daemon AFS authenticated (probably as "`postman`" or similar). [`kstart`](http://www.eyrie.org/~eagle/software/kstart/) can be used to do this. (Note that the mail delivery agent cannot authenticate as the actual user! To do so, it would need access to keytabs for each possible recipient; and it is almost certainly a bad idea to give it access to such keytabs.)
246
247 Second, you need to set up the ACLs so that "`postman`" has lookup rights down to the user's `$HOME` and "`lik`" on the destination directory (for this example, we'll use `$HOME/Mail`).
248
249 ### <a name="cheapclone"></a><a name="3.14  Should I replicate a _Read"></a> 3.13 Should I replicate a [[ReadOnly]] volume on the same partition and server as the [[ReadWrite]] volume?
250
251 Yes, Absolutely! It improves the robustness of your served volumes.
252
253 If [[ReadOnly]] volumes _exist_ (_not_ just "are available"), Cache Managers will not utilize the [[ReadWrite]] version of the volume except via an explicit [[ReadWrite]] mountpoint. This means if **all** RO copies are on dead servers, are offline, are behind a network partition, etc, then clients will not be able to get the data, even if the RW version of the volume is healthy, on a healthy server and in a healthy network.
254
255 However, you are **very** strongly encouraged to keep one RO copy of a volume on the _same server and partition_ as the RW. There are two reasons for this:
256
257 1. The RO that is on the same server and partition as the RW is a clone (just a copy of the header, not a full copy of each file). It therefore is very small, but provides access to the same set of files that all other (full copy) [[ReadOnly]] volumes do. Transarc trainers referred to this as the "cheap replica"; some admins call it a "shadow", but this is not the same as a [[shadow volume|AdminFAQ#shadow volume]].
258 2. To prevent the frustration that occurs when all your ROs are unavailable but a perfectly healthy RW was accessible but not used.
259
260 If you keep a "cheap replica", then by definition, if the RW is available, one of the ROs is also available, and clients will utilize that site.
261
262 ### <a name="multihomed"></a><a name="3.16  Will AFS run on a multi-ho"></a> 3.14 Will AFS run on a multi-homed fileserver?
263
264 (multi-homed = host has more than one network interface.)
265
266 Yes, it will. Older AFS assumed that there is one address per host, but modern [[OpenAFS]] identifies servers ad clients by UUIDs (universally unique identifiers) so that a fileserver will be recognized by any of its registered addresses.
267
268 See the documentation for the [`NetInfo`](http://docs.openafs.org/Reference/5/NetInfo.html) and [`NetRestrict`](http://docs.openafs.org/Reference/5/NetRestrict.html) files. The UUID for a fileserver is generated when the [`sysid`](http://docs.openafs.org/Reference/5/sysid.html) file is created.
269
270 If you have multiple addresses and must use only one of them (say, multiple addresses on the same subnet), you may need to use the `-rxbind` option to the network server processes `bosserver`, `kaserver`, `ptserver`, `vlserver`, `volserver`, `fileserver` as appropriate. (Note that some of these do not currently document `-rxbind`, notably `kaserver` because it is not being maintained. Again, the preferred solution here is to migrate off of `kaserver`, but the `rxbind` option _will_ work if needed.)
271
272 Database servers can *not* safely operate multihomed; the Ubik replication protocol assumes a 1-to-1 mapping between addresses and servers. Use the [`NetInfo`](http://docs.openafs.org/Reference/5/NetInfo.html) and [`NetRestrict`](http://docs.openafs.org/Reference/5/NetRestrict.html) files to associate database servers with a single address.
273
274 ### <a name="replicatehome"></a><a name="3.17  Can I replicate my user&#39;s"></a><a name="3.17  Can I replicate my user&#39;s "></a> 3.15 Can I replicate my user's home directory AFS volumes?
275
276 No.
277
278 Users with `$HOME`s in `/afs` normally have an AFS [[ReadWrite]] volume mounted in their home directory. You can replicate a RW volume, but only as a [[ReadOnly]] volume; there can only be one instance of a [[ReadWrite]] volume.
279
280 In theory you could have RO copies of a user's RW volume on a second server, but in practice this won't work for the following reasons:
281
282 a) AFS has a bias to always access the RO copy of a RW volume if one exists. So the user would have a [[ReadOnly]] `$HOME`, which is not very useful. (You could use an RW mountpoint to avoid this.)
283 b) [[ReadOnly]] volumes are not automatically updated; you would need to manually update each user volume (e.g. `vos release user.fred; fs checkv`).
284
285 The bottom line is: you cannot usefully replicate `$HOME`s across servers.
286
287 (That said, there is one potentially useful case: if there is an extended fileserver outage, you can use `vos convertROtoRW` to promote a [[ReadOnly]] volume to [[ReadWrite]]. You should only do this if the alternative is restoring the entire contents of the downed fileserver from a backup; should the fileserver return to service, the attempt to re-register additional [[ReadWrite]] volume instances will fail. As such, *if* you make sure to use a [[ReadWrite]] mountpoint for user volumes, replicating a user's `$HOME` may prove useful as an online backup.)
288
289 ### <a name="listclients"></a><a name="3.21  How can I list which clien"></a> 3.16 How can I list which clients have cached files from a server?
290
291 By using the following script, which should work in a POSIX-compliant shell, `ksh` or `bash` (but check the path to `rxdebug`, and you need `nslookup` to be installed):
292
293     #!/bin/ksh -
294     #
295     # NAME          afsclients
296     # AUTHOR        Rainer Toebbicke  <rtb@dxcern.cern.ch>
297     # DATE          June 1994
298     # PURPOSE       Display AFS clients which have grabbed files from a server
299
300     if [ $# = 0 ]; then
301         echo "Usage: $0 <afs_server 1> ... <afsserver n>"
302         exit 1
303     fi
304     for n; do
305         /usr/afsws/etc/rxdebug -servers $n -allconn
306     done |
307         grep '^Connection' |
308     while read x y z ipaddr rest; do
309             echo $ipaddr
310         done |
311         sort -u |
312     while read ipaddr; do
313         ipaddr=${ipaddr%%,}
314         n="`nslookup $ipaddr`"
315         n="${n##*Name: }"
316         n="${n%%Address:*}"
317         n="${n##*([ ])}"
318         n="${n%?}"
319         echo "$n ($ipaddr)"
320     done
321
322 An alternative in Perl (still requires `rxdebug` but not `nslookup`):
323
324     #! /usr/bin/perl -w
325         use strict;
326         use warnings;
327         use Socket;
328         
329         my %client;
330         for my $fs (@ARGV) {
331                 open my $rx, '-|', "rxdebug -server \Q$fs\E -allconn" or die "rxdebug: $!";
332                 while (<$rx>) {
333                         /^Connection from host (\S+),/ and $client{$1} = 1;
334                 }
335         }
336         for my $ip (keys %client) {
337                 my ($ia, $host);
338                 $ia = inet_aton($ip);
339                 if (defined ($host = gethostbyaddr($ia, AF_INET))) {
340                         $client{$ip} = "$host ($ip)";
341                 } else {
342                         $client{$ip} = $ip;
343                 }
344         }
345         for my $host (sort values %client) {
346                 print $host, "\n";
347         }
348
349 ### <a name="backupvol"></a><a name="3.22  Do Backup volumes require"></a><a name="3.22  Do Backup volumes require "></a> 3.17 Do Backup volumes require as much space as [[ReadWrite]] volumes?
350
351 Occasionally, but usually not. A backup volume consists of copy-on-write clones of the files in the original volume; if the file in the original is then modified, it will be copied first, leaving the backup volume pointing at the original version. The BK volume is re-synchronised with the RW next time a `vos backup` or `vos backupsys` is run.
352
353 The space needed for the BK volume is directly related to the size of all files changed in the RW between runs of `vos backupsys`.
354
355 ### <a name="ntp"></a><a name="NTP"></a><a name="3.23  Should I run timed on my A"></a> 3.18 Should I run `ntpd` on my AFS client?
356
357 Yes. You should not rely on older time services such as `timed` or programs such as `ntpdate`, and should not use the legacy `settime` functionality of the AFS client. You should also avoid using automatic time synchronization provided by virtual machine hypervisors (indeed, VMware specifically recommends disabling its time synchronization on Linux and using `ntpd`).
358
359 The AFS Servers make use of NTP [[[NTP|FurtherReading#NTP]]] to synchronise time each other and typically with one or more external NTP servers. By default, clients synchronize their time with one of the servers in the local cell. Thus all the machines participating in the AFS cell have an accurate view of the time.
360
361 For further details on NTP see <http://www.ntp.org/>. The latest version is 4.2.6, dated December 2011, which is **much** more recent that the version packaged with Transarc AFS. OpenAFS no longer ships with `timed`, since it is assumed that all sites use NTP.
362
363 A list of NTP servers is available from <http://support.ntp.org/servers/>. Note that you should prefer to have one or more master local servers sync to one of the "pool" servers for your continent, and other local clients sync to the master local server(s).
364
365 The default time setting behavior of the AFS client can be disabled by specifying the `-nosettime` argument to [afsd](http://www.transarc.ibm.com/Library/documentation/afs/3.5/unix/cmd/cmd53.htm). It is **strongly** recommended that you run NTP and use `-nosettime` on all machines (clients *and* servers).
366
367 ### <a name="cellservdb"></a><a name="3.24  Why should I keep /usr/vic"></a><a name="3.25  How can I keep /usr/vice/e"></a> 3.19 Why and how should I keep `/usr/vice/etc/CellServDB` current?
368
369 On AFS clients, `/usr/vice/etc/CellServDB` defines the cells (and their db servers) that can be accessed via `/afs`. Over time, site details change: servers are added/removed or moved onto new network addresses; new cells appear. While some of this can be handled by means of DNS `AFSDB` or `SRV` records, you must know about a cell to even be able to ask about it; the [[CellServDB]] acts as a central directory of cell. (Of course, it is sometimes a good idea to not advertise some internal cells; but that also means not putting them in public-facing DNS, so you will likely want a local [[CellServDB]].)
370
371 In order to keep up-to-date with such changes, the [[CellServDB]] file on each AFS client should be kept consistent with some master copy (at your site).
372
373 As well as updating [[CellServDB]], your AFS administrator should ensure that new cells are mounted in your cell's `root.afs` volume. If a cell is added to [[CellServDB]], either the **client** must be restarted or you must use [`fs newcell`](http://docs.openafs.org/Reference/1/fs_newcell.html) to register the new cell information with the running client.
374
375 The official public master [[CellServDB]] is maintained at `grand.central.org`, from <http://grand.central.org/dl/cellservdb/CellServDB> or <file:///afs/grand.central.org/service/CellServDB>. You can send updates for this to <cellservdb@central.org>.
376
377 The client [[CellServDB]] file must not reside under `/afs` (since it needs to exist before the client starts!) and is best located in local filespace.
378
379 After obtaining an updated [[CellServDB]] and distributing to clients, you will want to run a script similar to this Perl script. (It could be written in shell, but not comprehensibly. Feel free to reimplement in your preferred language.)
380
381         #! /usr/bin/perl
382         use strict;
383         use warnings;
384
385         #
386         # Given a CellServDB file (may be local, may be master), issue "fs newcell" for each listed
387         # cell.  We don't bother checking for changes, as that's much more expensive than making an
388         # unnecessary change.
389         #
390         # Expected usage via puppet:  rather than making it the restart/reconfigure action for the
391         # client (or server) we depend on an exec stanza which does so.  No point in running it if
392         # what changed is something else that requires a full restart.
393         #
394
395         my $cell;
396         my @srv = ();
397
398         while (<>) {
399           chomp;
400           if (/^>(\S+)(?:\s|\Z)/) {
401                 if (defined $cell and @srv) {
402                   system 'fs', 'newcell', $cell, @srv and die "fs newcell failed";
403                 }
404                 $cell = $1;
405                 @srv = ();
406           }
407           # same rules as afsd: if the name doesn't resolve, use the IP
408           elsif (defined $cell and /(^\d+\.\d+\.\d+\.\d+)\s*#(\S+)\s*$/) {
409                 if (defined gethostbyname($2)) {
410                   push @srv, $2;
411                 } else {
412                   push @srv, $1;
413                 }
414           }
415           else {
416                 warn "line $ {.}: can't parse \"$_\"\n";
417           }
418         }
419         # last entry
420         if (defined $cell and @srv) {
421           system 'fs', 'newcell', $cell, @srv and die "fs newcell failed";
422         } else {
423           warn "line $ {.}: no valid cells found\n";
424         }
425
426 ### <a name="fileservers"></a><a name="3.26  How can I compute a list o"></a> 3.20 How can I compile a list of AFS fileservers?
427
428 Here is a Bourne shell command to do it (it will work in GNU bash and the Korn shell, too, and even `csh`):
429
430     stimpy@nick $ vos listvldb -cell `cat /usr/vice/etc/ThisCell` | awk '/server/ {print $2}' | sort -u
431
432 ### <a name="anonftp"></a><a name="3.27  How can I set up anonymous"></a> 3.21 How can I set up anonymous FTP login to access `/afs`?
433
434 The easiest way on a primarily "normal" machine (where you don't want to have everything in AFS) is to actually mount `root.cell` under `~ftp`, and then symlink `/afs` to `~ftp/afs` or whatever. It's as simple as changing the mountpoint in `/usr/vice/etc/cacheinfo` and restarting `afsd`.
435
436 Note that when you do this, anon ftp users can go anywhere `system:anyuser` can (or worse, if you're using IP-based ACLs and the ftp host is listed in any PTS groups). The only "polite" solution I've arrived at is to have the ftp host machine run a minimal [[CellServDB]] and police my ACLs tightly.
437
438 Alternatively, you can make `~ftp` an AFS volume and just mount whatever you need under that - this works well if you can keep everything in AFS, and you don't have the same problems with anonymous "escapes" into `/afs`. (Note that you can often use host `tmpfs` mounts onto AFS directories to hide things or provide host-specific paths.)
439
440 Note that similar considerations apply to web access; it used to be not uncommon for accidental misconfigurations of MIT's web hosts to result in people's home directories showing up in Google searches. This **will** annoy people who do not think of their [[OpenAFS]] home directory as being world-visible! (even though they should realize it and set their ACL appropriately)
441
442 ### <a name="encrypt"></a><a name="3.28 Is the data sent over the n"></a> 3.22 Is the data sent over the network encrypted in AFS?
443
444 [[OpenAFS]] has an `fs` subcommand to turn on encryption of regular file data sent and received by a client. This is a per client setting that persists until reboot. No server actions are needed to support this change. The syntax is:
445
446     fs setcrypt on
447     fs setcrypt off
448     fs getcrypt
449
450 Note that this only encrypts network traffic between the client and server. The data on the server's disk is not encrypted, nor is the data in the client's disk cache. The encryption algorithm used is [fcrypt](http://surfvi.com/~ota/fcrypt-paper.txt), which is a DES variant. Additionally, data read/written without a token is not encrypted over the wire. This (and the use of DES variants, both here and in general) is a shortcoming of AFS's security protocols and is being addressed by the development of a new `rxgk` protocol.
451
452 Enabling encryption by default:
453
454 - [[RedHat]] Linux: ([src](https://lists.openafs.org/pipermail/openafs-info/2002-July/005085.html)) change the last line of `/etc/sysconfig/afs` to `AFS_POST_INIT="/usr/bin/fs setcrypt on"`
455 - Windows ([src](https://lists.openafs.org/pipermail/openafs-info/2003-June/009416.html)) set the following registry value named `SecurityLevel` under `HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters` to 2.
456
457 ### <a name="filesystems"></a><a name="3.29 What underlying filesystems"></a> 3.23 What underlying filesystems can I use for AFS?
458
459 See also [[SupportedConfigurations]].
460
461 What filesystems can be used for fileserver partitions depends on what `configure` switches were used during compilation from sources. To be always on the safe side, use the `--enable-namei-fileserver` configure flag; that will give you a `fileserver` binary which can act on any `/vicep*` partition regardless of its filesystem type. With the namei file server, you can basically use any filesystem you want. The namei file server does not do any fancy stuff behind the scenes but only accesses normal files (their names are a bit strange though).
462
463 Older versions of AFS also provided an inode fileserver. On older Solaris it once gave a 10% speedup over the namei fileserver; but with modern operating systems and disks, the performance difference is negligible. The inode fileserver cannot run on every filesystem, as it abuses the filesystem internals to store AFS metadata and opens files directly by inode number instead of going through the normal filesystem access methanisms. The `fsck` distributed with the operating system will consider these inode-accessed files to be "dangling" and either link them into `lost+found` or delete them entirely; it will also often corrupt the AFS metadata, which it doesn't know about. As of [[OpenAFS]] 1.6, inode fileservers are no longer supported; you can still build from source with inode support, but it has bugs and should only be used in a read-only configuration to copy volumes to a namei fileserver host.
464
465 On the client side, the cache partition requires a filesystem supporting the inode abstraction for the cache (usually `/var/vice/cache`) since the cache manager references files by their inode. Fortunately, it does not store metadata in "unused" parts of the filesystem, and cache creation always provides proper names for the cache files so they won't be damaged by `fsck`.
466
467 The following file systems have been reported _not_ to work for the AFS client cache:
468
469 - [[ReiserFS]]
470 - vxfs (HP-UX)
471 - advfs (Tru64), it initially works but eventually corrupts the cache
472 - efs (SGI) - Transarc AFS supported efs, but [[OpenAFS]] doesn't have a license to use the efs code
473 - zfs (Solaris, FreeBSD, other ports) - you can however use a zvolume with a ufs or other supported filesystem
474
475 The OpenAFS cache manager will detect an unsupported filesystem and refuse to start.
476
477 The following file systems have been reported to work for the AFS client cache:
478
479 - ext2
480 - ext3
481 - hfs (HP-UX)
482 - xfs (at least on IRIX 6.5)
483 - ufs (Solaris, [[Tru64Unix]])
484
485 ### <a name="3.30 Compiling _OpenAFS"></a> 3.24 Compiling [[OpenAFS]] from source
486
487 (Modern [[OpenAFS]] supports proper packaging for various systems; these notes are still somewhat applicable but mostly relevant for 1.2.x.)
488
489 The kernel component of [[OpenAFS]] must be compiled by the same kernel used to compile the kernel, e.g. Solaris must use the cc from SUNWspro and not gcc. [[Tru64Unix]] doesn't support modules, so you have to edit kernel config files and link statically into kernel. Dynamically loaded Kernel modules work on Linux, Solaris, Irix ...
490
491     ./configure --enable-transarc-paths=/usr/etc --with-afs-sysname=i386_linux24
492     make dest
493     cd dest/i386_linux24
494
495 ... and continue the install process described in IBM AFS documentation. If you do "make install", you will end up with some stuff installed into /usr/local but something not, regardless the --enable-transarc-paths option ... "make install" it's messy.
496
497 ### <a name="3.31 Upgrading _OpenAFS"></a> 3.25 Upgrading [[OpenAFS]]
498
499 (Modern [[OpenAFS]] supports proper packaging for various systems; these notes are still somewhat applicable but mostly relevant for 1.2.x.)
500
501 These instructions assume a "dest" tree (the output of `make dest`, and the contents of the official binary distribution tarballs). It is generally preferable to use native packages when they exist; the packaging will handle most of the details of upgrading for you.
502
503 #### Upgrade of AFS on Linux
504
505     /etc/rc.d/init.d/afs stop
506     cd root.client/usr/vice/etc
507     tar cvf - . | (cd /usr/vice/etc; tar xfp -)
508     cp -p afs.rc /etc/rc.d/init.d/afs
509     cp ../../../../lib/pam_afs.krb.so.1  /lib/security
510     cd ../../../../root.server/usr/afs
511     tar cvf - . | (cd /usr/afs; tar xfp -)
512     # echo "auth sufficient /lib/security/pam_afs.so try_first_pass \
513     ignore_root" >> /etc/pam.d/login
514     cd /lib/security
515     vim /etc/sysconfig/afs
516     ln -s pam_afs.krb.so.1 pam_afs.so
517     cd /etc/rc3.d
518     ln -s ../init.d/afs S99afs
519     cd ../rc0.d
520     ln -s ../init.d/afs K01afs
521     cp /usr/vice/etc/afs.conf /etc/sysconfig/afs
522     /etc/rc.d/init.d/afs start
523
524 #### Upgrade of AFS on Solaris 2.6
525
526     cd /etc/rc3.d/
527     mv S20afs aS20afs
528     init 6
529     cd root.server/usr/afs
530     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
531     cd ../../..
532     cp root.client/usr/vice/etc/modload/libafs.nonfs.o /kernel/fs/afs
533     cp root.server/etc/vfsck /usr/lib/fs/afs/fsck
534     cd root.client/usr/vice
535     tar cvf - ./etc | (cd /usr/vice; tar xf -)
536     cd ../../..
537     cp lib/pam_afs.krb.so.1 /usr/lib/security
538     cp lib/pam_afs.so.1 /usr/lib/security
539     cd /etc/rc3.d
540     mv aS20afs S20afs
541     init 6
542
543 #### Upgrade of AFS on Irix 6.5
544
545     /etc/chkconfig -f afsserver off
546     /etc/chkconfig -f afsclient off
547     /etc/chkconfig -f afsml off
548     /etc/chkconfig -f afsxnfs off
549     /etc/reboot
550     cd root.server/usr/afs
551     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
552     cd ../../..
553     cp root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o /usr/vice/etc/sgiload
554     echo "AFS will be compiled statically into kernel"
555     echo "otherwise skip following lines and use chkconfig afsml on"
556     cp root.client/bin/afs.sm  /var/sysgen/system
557     cp root.client/bin/afs /var/sysgen/master.d
558     echo "The next file comes from openafs-*/src/libafs/STATIC.*"
559     cp root.client/bin/libafs.IP22.nonfs.a /var/sysgen/boot/afs.a
560     cp /unix /unix_orig
561     /etc/autoconfig
562     echo "end of static kernel modifications"
563     cd root.client/usr/vice/etc
564     echo "Delete any of the modload/ files which don't fit your platform if you need space"
565     echo "These files originate from openafs-*/src/libafs/MODLOAD.*"
566     tar cvf - . | (cd /usr/vice/etc; tar xf -)
567     /etc/chkconfig -f afsserver on
568     /etc/chkconfig -f afsclient on
569     # /etc/chkconfig -f afsml on - afs is compiled statically into kernel, so leave afsml off
570     /etc/chkconfig -f afsml off
571     /etc/chkconfig -f afsxnfs off
572     /etc/reboot
573
574 #### Upgrade of AFS on [[Tru64Unix]]
575
576     cd root.server/usr/afs/
577     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
578     cd ../../../root.client/bin
579     cp ./libafs.nonfs.o /usr/sys/BINARY/afs.mod
580     ls -la /usr/sys/BINARY/afs.mod
581     doconfig -c FOO
582     cd ../../root.client/usr/vice
583     cp etc/afsd /usr/vice/etc/afsd
584     cp etc/C/afszcm.cat /usr/vice/etc/C/afszcm.cat
585
586 ### <a name="3.32 Debugging _OpenAFS"></a> 3.26 Notes on debugging [[OpenAFS]]
587
588 In case of troubles when you need only `fileserver` process to run (to be able to debug), run the `lwp` fileserver instead of the `pthreads` fileserver (`src/viced/fileserver` instead of `src/tviced/fileserver` if you have a buildtree handy):
589
590     cp src/viced/fileserver /usr/afs/bin (or wherever)
591     bos restart localhost fs -local
592
593 then attach with `gdb`. (This may be less necessary with recent `gdb`; its `pthreads` support used to be quite abysmal. [*ed.*])
594
595 To debug if client running `afsd` kernel process talks to the servers from [[CellServDB]], do:
596
597     tcpdump -vv -s 1500 port 7001
598
599 Other ports are:
600
601         afs3-fileserver 7000/udp    # file server itself
602         afs3-callback   7001/udp    # callbacks to cache managers
603         afs3-prserver   7002/udp    # users & groups database
604         afs3-vlserver   7003/udp    # volume location database
605         afs3-kaserver   7004/udp    # AFS/Kerberos authentication service
606         afs3-volser     7005/udp    # volume managment server
607         afs3-errors     7006/udp    # error interpretation service
608         afs3-bos        7007/udp    # basic overseer process
609         afs3-update     7008/udp    # server-to-server updater
610         afs3-rmtsys     7009/udp    # remote cache manager service
611
612 When `tcpdump` doesn't help, try:
613
614     fstrace setset cm -active
615         # make your error happen
616         fstrace dump cm
617
618 ### <a name="3.33 Tuning client cache for hug"></a> 3.27 Tuning client cache for huge data
619
620 Use on afsd command line -chunk 17 or greater. Be carefull, with certain cache sizes afsd crashes on startup (Linux, [[Tru64Unix]] at least). It is possibly when dcache is too small. Go for:
621
622     /usr/vice/etc/afsd -nosettime -stat 12384 -chunk 19
623
624     > So I ran the full suite of iozone tests (13), but at a single file
625     > size (128M) and one record size (64K).  I set the AFS cache size to > 80000K for both memcache and diskcache.
626
627     Note that memcache size and diskcache size are different things.
628     In the case of memcache, a fixed number of chunks are allocated
629     in memory, such that numChunks * chunkSize = memCacheSize.  In
630     the case of disk cache, there are a lot more chunks, because the
631     disk cache assumes not every chunk will be filled (the underlying
632     filesystem handles disk block allocation for us).  Thus, when you
633     have small file segments, they use up an entire chunk worth of
634     cache in the memcache case, but only their size worth of cache
635     in the diskcache cache.
636
637     -- kolya
638
639 ### <a name="3.34 Settting up PAM with AFS"></a> 3.28 Settting up PAM with AFS
640
641 Solaris
642
643     auth        sufficient    /lib/security/pam_afs.so debug try_first_pass ignore_root debug
644     auth        required      /lib/security/pam_env.so
645     auth        sufficient    /lib/security/pam_unix.so likeauth nullok
646     auth        required      /lib/security/pam_deny.so
647
648     account     required      /lib/security/pam_unix.so
649
650     password    required      /lib/security/pam_cracklib.so retry=3 type=
651     password    sufficient    /lib/security/pam_unix.so nullok use_authtok md5 shadow
652     password    required      /lib/security/pam_deny.so
653
654     session     sufficient    /lib/security/pam_afs.so set_token
655     session     required      /lib/security/pam_limits.so
656     session     required      /lib/security/pam_unix.so
657
658     # reafslog is to unlock dtlogin's screensaver
659     other  auth sufficient /usr/athena/lib/pam_krb4.so reafslog
660
661 ### <a name="afskrbconf"></a><a name="3.37 afs_krb_get_lrealm() using"></a><a name="3.37 afs_krb_get_lrealm() using "></a> 3.29 How can I have a Kerberos realm different from the AFS cell name? How can I use an AFS cell across multiple Kerberos realms?
662
663 OpenAFS defaults to using a Kerberos realm generated from the cell name by uppercasing. You can instead tell it the Kerberos realm to use with a truncated `krb.conf` file:
664
665     /usr/afs/etc/krb.conf        # Transarc paths
666         /etc/openafs/server/krb.conf # FHS paths
667
668 You do not list any KDCs in this file, just space-separated realms on a single line. See also [[below|AdminFAQ#multirealm]]. You can list a maximum of 2 realms in this file in older AFS, but [[OpenAFS]] 1.6 and later allow any number of realms.
669
670 ### <a name="bosinstances"></a><a name="3.40 What are those bos(1) -type"></a> 3.30 What are the `bos` instance types? How do I use them?
671
672 There are, as of this writing, 4 types of [`bos`](http://docs.openafs.org/Reference/8/bos_create.html) server:
673
674 * `simple` - a single program which will be kept running as needed.
675 * `cron` - a single program, plus a time at which it will be automatically run; typically used for cell backups.
676     The time looks like `04:00` to run every day at a given time, or `sun 04:00` to run once a week. Times may be specified in 24-hour or 12-hour (with am/pm suffix); weekdays may be full or abbreviated to 3 characters. Case is ignored. (A legacy usage allows the string `now` to be used; use [`bos exec`](http://docs.openafs.org/Reference/8/bos_exec.html) instead.)
677 * `fs` - a standard fileserver which has three programs that must be run together in a particular way. The `fs` server type will take care of starting, stopping, and restarting these programs in order to keep them working together.
678 * `dafs` - demand attach fileservers are similar to standard fileservers, but have an additional component program to be synchronized. The `dafs` server type will ensure these are started, stopped, and restarted correctly while maintaining synchronization.
679
680 ### <a name="syscall"></a><a name="3.42 afsd gives me  Error -1 in"></a> 3.31 afsd gives me "`Error -1 in basic initialization.`" on startup
681
682 When starting afsd, I get the following:
683
684     # /usr/vice/etc/afsd -nosettime -debug
685     afsd: My home cell is 'foo.bar.baz'
686     ParseCacheInfoFile: Opening cache info file '/usr/vice/etc/cacheinfo'...
687     ParseCacheInfoFile: Cache info file successfully parsed:
688            cacheMountDir: '/afs'
689            cacheBaseDir: '/usr/vice/cache'
690            cacheBlocks: 50000
691     afsd: 5000 inode_for_V entries at 0x8075078, 20000 bytes
692     SScall(137, 28, 17)=-1 afsd: Forking rx listener daemon.
693     afsd: Forking rx callback listener.
694     afsd: Forking rxevent daemon.
695     SScall(137, 28, 48)=-1 SScall(137, 28, 0)=-1 SScall(137, 28, 36)=-1 afsd: Error -1 in basic initialization.
696
697 Make sure the kernel module has been loaded. Modern [[OpenAFS]] startup scripts should ensure this and report an error if it cannot be loaded, but startup scripts from older versions or on systems which can't use loadable kernel modules (requiring the kernel to be relinked) will not catch this and you will get these errors from `SScall`.
698
699 ### <a name="translate_et"></a><a name="3.44 I get error message trhough"></a> 3.32 Error "`afs: Tokens for user of AFS id 0 for cell foo.bar.baz are discarded (rxkad error=19270407)`"
700
701     elmer@toontown ~$ translate_et 19270407
702     19270407 (rxk).7 = security object was passed a bad ticket
703
704 or alternately
705
706     elmer@toontown ~$ grep 19270407 /usr/afsws/include/rx/*
707     /usr/afsws/include/rx/rxkad.h:#define RXKADBADTICKET (19270407L)
708
709 A common cause of this problem (error 19270407) is the use of periods ("`.`") in Kerberos V principals.  If you have a Kerberos principal such as `my.name@REALM.COM` and create the corresponding `pts` userid `my.name`, you will get the cryptic error above. If you want to use such principal names and have OpenAFS 1.4.7 or later, you can pass the option `-allow-dotted-principals` to all server daemons to allow their use. See the `-allow-dotted-principals` option in the fileserver (or any server daemon) documentation for more information. (The problem here is that for compatibility reasons, [[OpenAFS]] uses Kerberos 4 name rules internally; while "`.`" was the name component separator in Kerberos 4, in [[Kerberos5]] it is "`/`" so [[OpenAFS]] translates `.` to `/` when passing names to Kerberos for verification. This means that a Kerberos 5 name with an embedded period cannot be used directly without disabling the translation; but with the translation disabled, you cannot easily use Kerberos 5 names with components. There is ongoing work in this area because `rxgk` requires proper support for these names.)
710
711 In general, the `translate_et` utility can be used to find out what an AFS error number means. This only works for AFS errors; some utilities may also report Kerberos errors in this way, and `translate_et` will not work for these. Some sites have alternative utilities that understand Kerberos as well as AFS errors (see for example (here)[file:///afs/sinenomine.net/user/ballbery/public/translate_err]).
712
713 ### <a name="UserList"></a><a name="3.45 I get tickets and tokens, b"></a> 3.33 I have tickets and tokens, but still get `Permission denied` for some operations.
714
715 This can be caused by the above, or by not being in a server `UserList` (`/usr/afs/etc/UserList` or `/etc/openafs/server/UserList`).
716
717 Also beware that, as described [[above|AdminFAQ#translate_et]], `UserList` accepts only Kerberos 4 name syntax: use `joe.admin` instead of `joe/admin`. See `https://lists.openafs.org/pipermail/openafs-devel/2002-December/008673.html` and the rest of the thread.
718
719 ### <a name="flushvol"></a><a name="3.46 Recovering broken afs cache"></a> 3.34 Recovering broken AFS cache on clients
720
721     >> Does anyone have a trick to force AFS to refresh its cache (for a
722     >> particular directory or even for all files?) The only way I know
723     >> how to accomplish this is to reboot, stop in single user mode,
724     >> rm -rf the cache files and let AFS rebuild everything.
725     >
726     > fs flush and fs flushv have cured corruption problems in the past
727     > on some of our clients.
728
729     Thanks for the tip - I was not aware of the flush* subcommands.
730     Here's a little of what I saw today:
731
732     ls -la
733     /bin/ls: asso.S14Q00246.all.log: Bad address
734     /bin/ls: asso.S14Q00246.all.lst: Bad address
735     /bin/ls: chr14markers.txt: Bad address
736     /bin/ls: geno.summary.txt: Bad address
737     /bin/ls: global.ind.S14Q00246.all.txt: No such device
738     /bin/ls: global.S14Q00246.all.txt: No such device
739     total 103
740     [ other ls results as usual ]
741
742     Flushing a particular file had no effect (the same error as shown above appears). Flushvolume took a long time, but when it eventually completed, the ls -la behaved exactly as one would expect.
743
744 Recent [[OpenAFS]] (1.6.4 and newer) has an [`fs flushall`](http://docs.openafs.org/Reference/1/fs_flushall.html) command in addition to the `flush` and `flushvol` commands.
745
746 Older AFS versions sometimes corrupted their cache filesystems in ways that `fs flushvol` cannot fix. Sometimes this can be corrected with
747
748     root@toontown ~# fs setca 1; fs setca 0
749
750 (set the cache to minimum size, and then back to normal; beware that in most versions of Transarc AFS, you will have to specify the actual cache size instead of `0`!). If this does not work, you can force a cache rebuild by shutting down [[OpenAFS]] and removing `/var/vice/cache/CacheItems` (it is not necessary to remove all cache files), although you may want to remake the filesystem (`mkfs` or `newfs`) instead in case there is actual filesystem corruption.
751
752 If this happens regularly, please file an OpenAFS bug.
753
754 ### <a name="notinvldb"></a><a name="3.47 What does it mean for a vol"></a> 3.35 What does it mean for a volume to not be in the VLDB?
755
756 If a volume is not in the VLDB, you will be unable to perform operations on it using its name; all "vos" operations will need to be done using its numerical id, server, and partition. Furthermore, if a volume is not in the VLDB, it cannot be reached via mountpoints.
757
758 ### <a name="volumegroup"></a><a name="3.48 What is a Volume Group?"></a> 3.36 What is a Volume Group?
759
760 You can think of a Volume Group as an RW volume, and all of the clones of that RW (its RO clone, BK clone, and any other clones). All of the volumes in a Volume Group on the same fileserver can share storage for data that is the same between all of them. This is why, for example, an RO clone usually takes up very little disk space; since an RW and its RO clone are in the same Volume Group, they can share storage for unchanged data.
761
762 All of the volumes in a group usually have very similar volume ID numbers. For example, if an RW volume has ID 536870915, its RO clone will typically be 536870916. However, this is not required, as volume ID numbers can be almost anything. You can even manually specify what volume ID number you want for a volume when you create the volume with "`vos create`".
763
764 Currently, you can only have about 8 volumes in a Volume Group. However, this limitation is due to technical details of the fileserver "namei" disk backend. If that backend is improved in the future, or if different backends are developed, the number of volumes in a volume group could be much greater.
765
766 Some low-level documentation may refer to a "volume group ID". This is always the same as the RW volume ID.
767
768 ### <a name="clone"></a><a name="3.49 What is a Clone?"></a> 3.37 What is a Clone?
769
770 A clone of a volume is a read-only copy of that volume which shares on-disk storage with the original volume. Backup volumes are a particular kind of clone volume. Read-only replicas which reside on the same partition as their read-write volume are another particular kind of clone volume. In some other storage systems this kind of volume is called a "snapshot".
771
772 Clone volumes must belong to the same volume group (see [[previous question|AdminFAQ#volumegroup]]) as the volume which they are a clone of.
773
774 In addition to backup and readonly clones, you may create up to three additional clones of a volume. To do this, use "`vos clone`".
775
776 When you "`vos remove`" a volume, its "backup" clone will also be removed automatically. However, clones created with "`vos clone`" are **not** removed automatically. Unfortunately, these "dangling clones" will no longer be in the VLDB (see [[above|AdminFAQ#notinvldb]]). They belong to a volume group whose leader (RW volume) no longer exists, which is a somewhat undefined state for AFS. Such volumes should be manually deleted as soon as possible.
777
778 ### <a name="shadow"></a><a name="3.50 What is a Shadow?"></a> 3.38 What is a Shadow?
779
780 A shadow of a volume is a duplicate of that volume which resides on a different partition. Shadow volumes do not share storage with their original volumes (unlike clones). A readonly volume on a **different** partition than its readwrite volume could be considered one particular example of a shadow volume; however, in practice the term "shadow volume" is used to refer to volumes created with "vos shadow" and not to refer to readonly volumes.
781
782 A shadow of any readwrite volume may be created using the "vos shadow" command. This will create a new volume which is a shadow of the original volume, and will copy the contents of the old volume to the new volume. This will also set a bit in the header of the new volume that identifies it as a shadow volume. Shadow volumes do not appear in the VLDB (see [[above|AdminFAQ#notinvldb]]) -- "`vos shadow`" does not create a VLDB entry and "`vos syncvldb`" ignores shadow volumes.
783
784 You can "refresh" a shadow volume from its original with "`vos shadow -incremental`". This operation will first check to make sure that the target of the operation is a shadow volume, to prevent the administrator from accidentally corrupting a non-shadow volume. However, if you shadow from a readwrite volume to some shadow of **another** volume, the shadow will be corrupted and will have to be deleted. `vos shadow` will only copy data which has changed, so it is very efficient.
785
786 You can remove the shadow bit from a volume's header with "`vos syncvldb -force`". This will remove the shadow bit and create a VLDB entry for the volume, deleting any previous entry for the RW volume. However, the RW volume itself will not be deleted; it will simply exist without a VLDB entry.
787
788 Attempting to create shadows of two different RW volumes on the same partition with the same name is prohibited by the `volserver`. Technically it is possible to create two shadow volumes with the same name on different partitions; however, this is not advisable and may lead to undefined behavior.
789
790 (Some AFS administrators may refer to an RO clone of an RW volume on the same server/partition as a "shadow"; this terminology predates the existence of shadow volumes and should be avoided.)
791
792 ### <a name="multirealm"></a><a name="3.51 Can I authenticate to my af"></a> 3.39 Can I authenticate to my AFS cell using multiple Kerberos realms?
793
794 Yes. This can be useful if your organization has multiple Kerberos realms with identical user entries: For example you might have an MIT Kerberos realm for Unix-like systems, and an Active Directory domain for Windows with synchronized accounts.
795
796 In order to make this work, you need to do 4 things.
797
798 1. Add a key for the `afs` service to the additional realm and store it in a keytab:
799
800         $ kadmin -q ank -e des-cbc-crc:v4 -kvno <new kvno> afs/your.cell.name@YOUR.SECOND.REALM.NAME
801         $ kadmin -q ktadd -e des-cbc-crc:v4 -k /path/to/afs.keytab afs/your.cell.name@YOUR.SECOND.REALM.NAME
802
803     Note that a kvno must be specified for the key that is different than the kvno for your existing key(s) in the original realm. You can check on the kvno of the existing keys by running "`asetkey list`" on one of your servers. Since keys must be in ascending order in the AFS [[KeyFile]], it will be easiest if you make the new kvno higher than any existing key's kvno.
804
805     It's also worth noting that the process of adding the key to a keytab (at least with MIT krb5) actually creates a new key first, so your kvno will end up being higher than what you specified when you added the principal. You can check on the current kvno by using the command "`kadmin -q getprinc afs/your.cell.name@YOUR.SECOND.REALM.NAME`".
806
807 2. Add the new key to the [[KeyFile]] on your AFS servers:
808
809         $ asetkey add <kvno> /path/to/afs.keytab afs/your.cell.name@YOUR.SECOND.REALM.NAME
810
811     Note that the kvno here needs to be the same one as is reported by the `kadmin getprinc` command.
812
813 3. Create an AFS `krb.conf` with your additional realm's name in it, and place it on all of your AFS servers; see [[above|AdminFAQ#afskrbconf]].
814
815 4. Restart your AFS servers.
816
817 At this point you should be able to run:
818
819     kinit you@YOUR.SECOND.REALM.NAME
820     aklog
821
822 and receive the same privileges as if you had run:
823
824     kinit you@YOUR.CELL.NAME
825     aklog
826
827 ### <a name="nss"></a><a name="3.53  How can I ensure that the"></a><a name="3.53  How can I ensure that the "></a> 3.40 How can I ensure that the userids on client machines match the users' `pts` ids?
828
829 You can use [libnss-afs](http://www.megacz.com/software/libnss-afs.html) for this.
830
831 ### <a name="fastrestart"></a><a name="3.54  What is Fast Restart?"></a> 3.41 What is Fast Restart?
832
833 When compiled with `--enable-fast-restart`, the file server will start up immediately, without first salvaging any volumes which cannot be attached.
834
835 Disadvantages to Fast Restart, [as noted here](http://lists.openafs.org/pipermail/openafs-info/2008-May/029386.html) include:
836
837 1. Volumes in need of salvage remain offline until an administrator intervenes manually
838 2. On an inode-based fileserver, salvaging a single volume crawls every inode; therefore, salvaging volumes individually (rather than partition-at-a-time) duplicates work.
839
840 In [[OpenAFS]] 1.6 there is a [[demand attach fileserver|DemandAttach]] which provides even faster restart while reducing the drawbacks; you should use it instead.
841
842 ### <a name="restart"></a><a name="#3.55  Reboot ?"></a> 3.42 Why does AFS reboot itself spontaneously at 4:00am every Sunday?
843
844 This was made to be the default behavior back in the days when OpenAFS servers had problems with leaking memory and other resources. These days, it is generally seen as not necessary.
845
846 You can disable this behavior with:
847
848     bos setrestart $SERVER_NAME never
849     bos setrestart $SERVER_NAME -newbinary never
850
851 Newer versions of [[OpenAFS]] do not enable this by default.
852
853 ### <a name="weakcrypto"></a><a name="#3.56 weak crypto"></a> 3.43 Why do I get an error -1765328370 when authenticating?
854
855     tweety@toontown ~$ translate_err -1765328370
856     krb5 error -1765328370 = KRB5KDC_ERR_ETYPE_NOSUPP
857
858 (See [[here|AdminFAQ#translate_et]] for `translate_err`.) Usually this means that your KDC has support for `des-cbc-crc` and other weaker encryption types turned off. Re-enable support for DES encryption types and you will get further.
859
860 Check `/etc/krb5.conf` and make sure it has something like the following in it:
861
862         [libdefaults]
863     allow_weak_crypto = true
864
865 Also check `kdc.conf` (possibly located in `/var/kerberos/krb5kdc`; check the documentation for your Kerberos packages) and make sure that `des-cbc-crc:normal` is in the `supported_enctypes` list.
866
867 There is ongoing work to remove the need for DES enctypes.
868