none
[openafs-wiki.git] / AFSLore / AdminFAQ.mdwn
1 ## <a name="3  AFS administration"></a> 3 AFS administration
2
3 The Administration Section of the [[AFSFrequentlyAskedQuestions]].
4
5 - [[PreambleFAQ]]
6 - [[GeneralFAQ]]
7 - [[UsageFAQ]]
8
9 <div>
10   <ul>
11     <li><a href="#3  AFS administration"> 3 AFS administration</a><ul>
12         <li><a href="#3.01  Is there a version of xdm"> 3.01 Is there a version of xdm available with AFS authentication?</a></li>
13         <li><a href="#3.02  Is there a version of xloc"> 3.02 Is there a version of xlock available with AFS authentication?</a></li>
14         <li><a href="#3.03  What is /afs/@cell?"> 3.03 What is /afs/@cell?</a></li>
15         <li><a href="#3.04  Given that AFS data is loc"> 3.04 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></li>
16         <li><a href="#3.05  How does AFS maintain cons"> 3.05 How does AFS maintain consistency on read-write files?</a></li>
17         <li><a href="#3.06  Which protocols does AFS u"> 3.06 Which protocols does AFS use?</a></li>
18         <li><a href="#3.07  Which TCP/IP ports and pro"> 3.07 Which TCP/IP ports and protocols do I need to enable in order to operate AFS through my Internet firewall?</a></li>
19         <li><a href="#3.08  Are setuid programs execut"> 3.08 Are setuid programs executable across AFS cell boundaries?</a></li>
20         <li><a href="#3.09  How can I run daemons with"> 3.09 How can I run daemons with tokens that do not expire?</a></li>
21         <li><a href="#3.10  Can I check my user's pass"> 3.10 Can I check my user's passwords for security purposes?</a></li>
22         <li><a href="#3.11  Is there a way to automati"> 3.11 Is there a way to automatically balance disk usage across fileservers?</a></li>
23         <li><a href="#3.12  Can I shutdown an AFS file"> 3.12 Can I shutdown an AFS fileserver without affecting users?</a></li>
24         <li><a href="#3.13  How can I set up mail deli"> 3.13 How can I set up mail delivery to users with $HOMEs in AFS?</a></li>
25         <li><a href="#3.14  Should I replicate a _Read"> 3.14 Should I replicate a ReadOnly volume on the same partition and server as the ReadWrite volume?</a></li>
26         <li><a href="#3.15  Should I start AFS before"> 3.15 Should I start AFS before NFS in /etc/inittab?</a></li>
27         <li><a href="#3.16  Will AFS run on a multi-ho"> 3.16 Will AFS run on a multi-homed fileserver?</a></li>
28         <li><a href="#3.17  Can I replicate my user's"> 3.17 Can I replicate my user's home directory AFS volumes?</a></li>
29         <li><a href="#3.18  What is the Andrew Benchma"> 3.18 What is the Andrew Benchmark?</a></li>
30         <li><a href="#3.19  Where can I find the Andre"> 3.19 Where can I find the Andrew Benchmark?</a></li>
31         <li><a href="#3.20  Is there a version of HP V"> 3.20 Is there a version of HP VUE login with AFS authentication?</a></li>
32         <li><a href="#3.21  How can I list which clien"> 3.21 How can I list which clients have cached files from a server?</a></li>
33         <li><a href="#3.22  Do Backup volumes require"> 3.22 Do Backup volumes require as much space as ReadWrite volumes?</a></li>
34         <li><a href="#3.23  Should I run timed on my A"> 3.23 Should I run timed on my AFS client?</a></li>
35         <li><a href="#3.24  Why should I keep /usr/vic"> 3.24 Why should I keep /usr/vice/etc/CellServDB current?</a></li>
36         <li><a href="#3.25  How can I keep /usr/vice/e"> 3.25 How can I keep /usr/vice/etc/CellServDB current?</a></li>
37         <li><a href="#3.26  How can I compute a list o"> 3.26 How can I compute a list of AFS fileservers?</a></li>
38         <li><a href="#3.27  How can I set up anonymous"> 3.27 How can I set up anonymous FTP login to access /afs?</a></li>
39         <li><a href="#3.28 Is the data sent over the n"> 3.28 Is the data sent over the network encrypted in AFS ?</a></li>
40         <li><a href="#3.29 What underlying filesystems"> 3.29 What underlying filesystems can I use for AFS ?</a></li>
41         <li><a href="#3.30 Compiling _OpenAFS"> 3.30 Compiling OpenAFS</a></li>
42         <li><a href="#3.31 Upgrading _OpenAFS"> 3.31 Upgrading OpenAFS</a></li>
43         <li><a href="#3.32 Debugging _OpenAFS"> 3.32 Debugging OpenAFS</a></li>
44         <li><a href="#3.33 Tuning client cache for hug"> 3.33 Tuning client cache for huge data</a></li>
45         <li><a href="#3.34 Settting up PAM with AFS"> 3.34 Settting up PAM with AFS</a></li>
46         <li><a href="#3.35 Setting up AFS key in KDC a"> 3.35 Setting up AFS key in KDC and KeyFile</a></li>
47         <li><a href="#3.36 Obtaining and getting asetk"> 3.36 Obtaining and getting asetkey compiled</a></li>
48         <li><a href="#3.37 afs_krb_get_lrealm() using"> 3.37 afs_krb_get_lrealm() using /usr/afs/etc/krb.conf</a></li>
49         <li><a href="#3.38 Moving from kaserver to Hei"> 3.38 Moving from kaserver to Heimdal KDC</a></li>
50         <li><a href="#3.39 Moving from KTH-KRB4 to Hei"> 3.39 Moving from KTH-KRB4 to Heimdal KDC</a></li>
51         <li><a href="#3.40 What are those bos(1) -type"> 3.40 What are those bos(1) -type values simple and cron?</a></li>
52         <li><a href="#3.41 KDC listens on port 88 inst"> 3.41 KDC listens on port 88 instead of 750</a></li>
53         <li><a href="#3.42 afsd gives me "Error -1 in"> 3.42 afsd gives me "Error -1 in basic initialization." on startup</a></li>
54         <li><a href="#3.43 Although I get krb tickets,"> 3.43 Although I get krb tickets, afslog doesn't give me tokens, I see UDP packets to port 4444</a></li>
55         <li><a href="#3.44 I get error message trhough"> 3.44 I get error message trhough syslogd: "afs: Tokens for user of AFS id 0 for cell foo.bar.baz are discarded (rxkad error=19270407)"</a></li>
56         <li><a href="#3.45 I get tickets and tokens, b"> 3.45 I get tickets and tokens, but still get Permission denied.</a></li>
57         <li><a href="#3.46 Recovering broken afs cache"> 3.46 Recovering broken afs cache on clients</a></li>
58         <li><a href="#3.47 What does it mean for a vol"> 3.47 What does it mean for a volume to not be in the VLDB?</a></li>
59         <li><a href="#3.48 What is a Volume Group?"> 3.48 What is a Volume Group?</a></li>
60         <li><a href="#3.49 What is a Clone?"> 3.49 What is a Clone?</a></li>
61         <li><a href="#3.50 What is a Shadow?"> 3.50 What is a Shadow?</a></li>
62         <li><a href="#3.51 Can I authenticate to my af"> 3.51 Can I authenticate to my afs cell using multiple kerberos Realms?</a></li>
63       </ul>
64     </li>
65   </ul>
66 </div>
67
68 - [[ResourcesFAQ]]
69 - [[AboutTheFAQ]]
70 - [[FurtherReading]]
71
72 ### <a name="3.01  Is there a version of xdm"></a><a name="3.01  Is there a version of xdm "></a> 3.01 Is there a version of xdm available with AFS authentication?
73
74 Yes, xdm can be found in:
75
76 <file:///afs/transarc.com/public/afs-contrib/tools/xdm> <ftp://ftp.transarc.com/pub/afs-contrib/tools/xdm/MANIFEST>
77
78 ### <a name="3.02  Is there a version of xloc"></a> 3.02 Is there a version of xlock available with AFS authentication?
79
80 Yes, xlock can be found in:
81
82 <file:///afs/transarc.com/public/afs-contrib/tools/xlock> <ftp://ftp.transarc.com/pub/afs-contrib/tools/xlock/MANIFEST>
83
84 ### <a name="3.03  What is /afs/@cell?"></a> 3.03 What is /afs/@cell?
85
86 It is a symbolic link pointing at /afs/$your\_cell\_name.
87
88 NB, @cell is not something that is provided by AFS. You may decide it is useful in your cell and wish to create it yourself.
89
90 /afs/@cell is useful because:
91
92 - If you look after more than one AFS cell, you could create the link in each cell then set your PATH as:
93   - PATH=$PATH:/afs/@cell/@sys/local/bin
94
95 - For most cells, it shortens the path names to be typed in thus reducing typos and saving time.
96
97 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.
98
99 You could create your own /afs/@cell with the following:
100
101     #/bin/ksh -
102     # author: mpb
103     [ -L /afs/@cell ] && echo We already have @cell! && exit
104     cell=$(cat /usr/vice/etc/ThisCell)
105     cd /afs/.${cell} && fs mkm temp root.afs
106     cd temp
107     ln -s /afs/${cell} @cell
108     ln -s /afs/.${cell} .@cell            # .@cell for RW path
109     cd /afs/.${cell} && fs rmm temp
110     vos release root.afs; fs checkv
111
112 <http://www-archive.stanford.edu/lists/info-afs/hyper95/0298.html>
113
114 ### <a name="3.04  Given that AFS data is loc"></a> 3.04 Given that AFS data is location independent, how does an AFS client determine which server houses the data its user is attempting to access?
115
116 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.
117
118 A list of a cell's Database Servers is stored on the local disk of each AFS Client machine as: /usr/vice/etc/CellServDB
119
120 The Database Servers also house the Kerberos Authentication Database (encrypted user and server passwords), the Protection Database (user UID and protection group information) and the Backup Database (used by System Administrators to backup AFS file data to tape).
121
122 ### <a name="3.05  How does AFS maintain cons"></a> 3.05 How does AFS maintain consistency on read-write files?
123
124 AFS uses a mechanism called "callback".
125
126 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.
127
128 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.
129
130 The following paragraphs describe AFS callback mechanism in more detail:
131
132 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.
133
134 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.
135
136 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.
137
138 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.
139
140 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.
141
142 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!
143
144 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.
145
146 Partially because of the worry factor and largely because of Posix, this will change in DFS. DFS synchronization semantics are identical to local file system synchronization.
147
148 [ DFS is the Distributed File System which is part of the Distributed ] [ Computing Environment (DCE). ]
149
150 ### <a name="3.06  Which protocols does AFS u"></a> 3.06 Which protocols does AFS use?
151
152 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.
153
154 At the lowest level is the UDP protocol, which is part of TCP/IP. 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.
155
156 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.
157
158 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, kaserver, 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 klog uses the kaserver's RPC interface.
159
160 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 kaserver, ptserver, volserver and vlserver to create new user accounts.
161
162 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.
163
164 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.
165
166 [ source: <ftp://ftp.transarc.com/pub/afsug/newsletter/apr91> ] [ Copyright 1991 Transarc Corporation ]
167
168 ### <a name="3.07  Which TCP/IP ports and pro"></a> 3.07 Which TCP/IP ports and protocols do I need to enable in order to operate AFS through my Internet firewall?
169
170 Assuming you have already taken care of nameserving, you may wish to use an Internet timeserver for Network Time Protocol [[[NTP|Main/FurtherReading#NTP]]] and the question about [[timed|Main/WebHome#NTP]]:
171
172 ntp 123/udp
173
174 A list of NTP servers is available via anonymous FTP from:
175
176 - <http://www.eecis.udel.edu/~mills/ntp/servers.html>
177
178 For further details on NTP see: <http://www.eecis.udel.edu/~ntp/>
179
180 For a "minimal" AFS service which does not allow inbound or outbound klog:
181
182        cachemanager    4711/udp (only if you use the arla-client instead of OpenAFS)
183        fileserver      7000/udp
184        cachemanager    7001/udp
185        ptserver        7002/udp
186        vlserver        7003/udp
187        kaserver        7004/udp
188        volserver       7005/udp
189        reserved        7006/udp
190        bosserver       7007/udp
191
192 (Ports in the 7020-7029 range are used by the AFS backup system, and won't be needed by external clients performing simple file accesses.)
193
194 Additionally, for "klog" to work through the firewall you need to allow inbound and outbound UDP on ports &gt;1024 (probably 1024&lt;port&lt;2048 would suffice depending on the number of simultaneous klogs).
195
196 See also: <http://www-archive.stanford.edu/lists/info-afs/hyper95/0874.html>
197
198 ### <a name="3.08  Are setuid programs execut"></a> 3.08 Are setuid programs executable across AFS cell boundaries?
199
200 By default, the setuid bit is ignored but the program may be run (without setuid privilege).
201
202 It is possible to configure an AFS client to honour the setuid bit. This is achieved by root running:
203
204        root@toontown # fs setcell -cell $cellname -suid
205
206 (where $cellname is the name of the foreign cell. Use with care!).
207
208 NB: 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 klog. If you are not authenticated, AFS treats you as "system:anyuser".
209
210 ### <a name="3.09  How can I run daemons with"></a> 3.09 How can I run daemons with tokens that do not expire?
211
212 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.
213
214 A better approach is to re-authenticate just before the token expires.
215
216 There are two examples of this that have been contributed to afs-contrib. The first is "reauth":
217
218 - <file:///afs/transarc.com/public/afs-contrib/tools/reauth/>
219 - <ftp://ftp.transarc.com/pub/afs-contrib/tools/reauth/MANIFEST>
220 - <ftp://ftp.andrew.cmu.edu/pub/AFS-Tools/reauth-0.0.5.tar.gz>
221
222 The second is "lat":
223
224 <file:///afs/transarc.com/public/afs-contrib/pointers/UMich-lat-authenticated-batch-jobs> <ftp://ftp.transarc.com/pub/afs-contrib/pointers/UMich-lat-authenticated-batch-jobs>
225
226 Another collection of tools was [mentioned](https://lists.openafs.org/pipermail/openafs-info/2002-October/006353.html) by [[DanielClark]]:
227
228 Another option is [OpenPBS](http://www.openpbs.org/) and [Password Storage and Retrieval](http://www.lam-mpi.org/software/psr/) (PSR), where you encrypt your AFS password with a public key and put it in your home directory, and trusted machine(s) which have the private key on local disk then decrypt your password and run your job. MIT uses a variant of this (e.g. [a](http://web.mit.edu/longjobs/www/) &amp; [b](http://mit.edu/longjobs-dev/notebook/)) that uses their own code (see [longjobs documentation](http://web.mit.edu/longjobs-dev/doc/netsec.txt) sections III and IV) instead of PSR.
229
230 ### <a name="3.10  Can I check my user&#39;s pass"></a> 3.10 Can I check my user's passwords for security purposes?
231
232 Yes. Alec Muffett's Crack tool (at version 4.1f) has been converted to work on the Transarc kaserver database. This modified Crack (AFS Crack) is available via anonymous ftp from:
233
234 - <ftp://export.acs.cmu.edu/pub/crack.tar.Z>
235 - <ftp://ftp.andrew.cmu.edu/pub/AFS-Tools/crack.tar.Z>
236
237 and is known to work on: pmax\_\* sun4\*\_\* hp700\_\* rs\_aix\* next\_\*
238
239 It uses the file /usr/afs/db/kaserver.DB0, which is the database on the kaserver machine that contains the encrypted passwords. As a bonus, AFS Crack is usually two to three orders of magnitude faster than the standard Crack since there is no concept of salting in a Kerberos database.
240
241 On a normal UNIX /etc/passwd file, each password can have been encrypted around 4096 (2^12) different saltings of the crypt(3) algorithm, so for a large number of users it is easy to see that a potentially large (up to 4095) number of seperate encryptions of each word checked has been avoided.
242
243 Author: Dan Lovinger Contact: Derrick J. Brashear &lt;shadow+@andrew.cmu.edu&gt;
244
245 <table border="1" cellpadding="0" cellspacing="0">
246   <tr>
247     <td> Note: </td>
248     <td> AFS Crack does not work for MIT Kerberos Databases. The author is willing to give general guidance to someone interested in doing the (probably minimal) amount of work to port it to do MIT Kerberos. The author does not have access to a MIT Kerberos server to do this. </td>
249   </tr>
250 </table>
251
252 ### <a name="3.11  Is there a way to automati"></a> 3.11 Is there a way to automatically balance disk usage across fileservers?
253
254 Yes. There is a tool, balance, which does exactly this. It can be retrieved via anonymous ftp from:
255
256 - <ftp://ftp.andrew.cmu.edu/pub/AFS-Tools/balance-1.1b.tar.gz>
257
258 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.
259
260 Author: Dan Lovinger Contact: Derrick Brashear &lt;shadow+@andrew.cmu.edu&gt;
261
262 ### <a name="3.12  Can I shutdown an AFS file"></a> 3.12 Can I shutdown an AFS fileserver without affecting users?
263
264 Yes, this is an example of the flexibility you have in managing AFS.
265
266 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:
267
268 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.
269
270 1. Make sure that critical services have been replicated on one (or more) other fileserver(s). Such services include:
271   - kaserver - Kerberos Authentication server
272   - vlserver - Volume Location server
273   - ptserver - Protection server
274   - buserver - Backup server
275
276 It is simple to test this before the real shutdown by issuing:
277
278        bos shutdown $server $service
279
280        where: $server is the name of the server to be shutdown
281          and  $service is one (or all) of: kaserver vlserver ptserver buserver
282
283 Other points to bear in mind:
284
285 - "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:
286   1. An RO on the same partition ("cheap replica") requires less space than a full-copy RO.
287   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.
288
289 - If 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.
290
291 ### <a name="3.13  How can I set up mail deli"></a> 3.13 How can I set up mail delivery to users with $HOMEs in AFS?
292
293 There are many ways to do this. Here, only two methods are considered:
294
295 Method 1: deliver into local filestore
296
297 This is the simplest to implement. Set up your mail delivery to append mail to /var/spool/mail/$USER on one mailserver host. The mailserver is an AFS client so users draw their mail out of local filestore into their AFS $HOME (eg: inc).
298
299 Note that if you expect your (AFS unauthenticated) mail delivery program to be able to process .forward files in AFS $HOMEs then you need to add "system:anyuser rl" to each $HOMEs ACL.
300
301 The advantages are:
302
303 - Simple to implement and maintain.
304 - No need to authenticate into AFS.
305
306 The drawbacks are:
307
308 - It doesn't scale very well.
309 - Users have to login to the mailserver to access their new mail.
310 - Probably less secure than having your mailbox in AFS.
311 - System administrator has to manage space in /var/spool/mail.
312
313 Method 2: deliver into AFS
314
315 This takes a little more setting up than the first method.
316
317 First, you must have your mail delivery daemon AFS authenticated (probably as "postman"). The reauth example in afs-contrib shows how a daemon can renew its token. You will also need to setup the daemon startup soon after boot time to klog (see the -pipe option).
318
319 Second, you need to set up the ACLs so that "postman" has lookup rights down to the user's $HOME and "lik" on $HOME/Mail.
320
321 Advantages:
322
323 - Scales better than first method.
324 - Delivers to user's $HOME in AFS giving location independence.
325 - Probably more secure than first method.
326 - User responsible for space used by mail.
327
328 Disadvantages:
329
330 - More complicated to set up.
331 - Need to correctly set ACLs down to $HOME/Mail for every user.
332 - Probably need to store postman's password in a file so that the mail delivery daemon can klog after boot time. This may be OK if the daemon runs on a relatively secure host.
333
334 An example of how to do this for IBM RISC System/6000 is auth-sendmail. A beta test version of auth-sendmail can be found in:
335
336 <file:///afs/transarc.com/public/afs-contrib/doc/faq/auth-sendmail.tar.Z> <ftp://ftp.transarc.com/pub/afs-contrib/doc/faq/auth-sendmail.tar.Z>
337
338 ### <a name="3.14  Should I replicate a _Read"></a> 3.14 Should I replicate a [[ReadOnly]] volume on the same partition and server as the [[ReadWrite]] volume?
339
340 Yes, Absolutely! It improves the robustness of your served volumes.
341
342 If [[ReadOnly]] volumes exist (note use of term **exist** rather than **are available**), Cache Managers will **never** utilize the [[ReadWrite]] version of the volume. The only way to access the RW volume is via the "dot" path (or by special mounting).
343
344 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.
345
346 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:
347
348 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]] volume do. Transarc trainers refer to this as the "cheap replica".
349 2. To prevent the frustration that occurs when all your ROs are unavailable but a perfectly healthy RW was accessible but not used.
350
351 If you keep a "cheap replica", then by definition, if the RW is available, one of the RO's is also available, and clients will utilize that site.
352
353 ### <a name="3.15  Should I start AFS before"></a><a name="3.15  Should I start AFS before "></a> 3.15 Should I start AFS before NFS in /etc/inittab?
354
355 Yes, it is possible to run both AFS and NFS on the same system but you should start AFS first.
356
357 In IBM's AIX 3.2, your /etc/inittab would contain:
358
359     rcafs:2:wait:/etc/rc.afs > /dev/console 2>&1 # Start AFS daemons
360     rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS daemons
361
362 With AIX, you need to load NFS kernel extensions before the AFS KEs in /etc/rc.afs like this:
363
364     #!/bin/sh -
365     # example /etc/rc.afs for an AFS fileserver running AIX 3.2
366     #
367     echo "Installing NFS kernel extensions (for AFS+NFS)"
368     /etc/gfsinstall -a /usr/lib/drivers/nfs.ext
369     echo "Installing AFS kernel extensions..."
370     D=/usr/afs/bin/dkload
371     ${D}/cfgexport -a ${D}/export.ext
372     ${D}/cfgafs    -a ${D}/afs.ext
373     /usr/afs/bin/bosserver &
374
375 ### <a name="3.16  Will AFS run on a multi-ho"></a> 3.16 Will AFS run on a multi-homed fileserver?
376
377 (multi-homed = host has more than one network interface.)
378
379 Yes, it will. However, AFS was designed for hosts with a single IP address. There can be problems if you have one host name being resolved to several IP addresses.
380
381 Transarc suggest designating unique hostnames for each network interface. For example, a host called "spot" has two tokenring and one ethernet interfaces: spot-tr0, spot-tr1, spot-en0. Then, select which interface will be used for AFS and use that hostname in the [[CellServDB]] file (eg: spot-tr0).
382
383 You also have to remember to use the AFS interface name with any AFS commands that require a server name (eg: vos listvol spot-tr0).
384
385 There is a more detailed discussion of this in the August 1993 issue of "Cache Update" (see: <ftp://ftp.transarc.com/pub/afsug/newsletter/aug93>).
386
387 The simplest way of dealing with this is to make your AFS fileservers single-homed (eg only use one network interface).
388
389 At release 3.4 of AFS, it is possible to have multi-homed fileservers (but _not_ multi-homed database servers).
390
391 ### <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.17 Can I replicate my user's home directory AFS volumes?
392
393 No.
394
395 Users with $HOMEs in /afs normally have an AFS [[ReadWrite]] volume mounted in their home directory.
396
397 You can replicate a RW volume but only as a [[ReadOnly]] volume and there can only be one instance of a [[ReadWrite]] volume.
398
399 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:
400
401     a) AFS has built-in bias to always access the RO copy of a RW volume.
402        So the user would have a ReadOnly $HOME which is not too useful!
403
404     b) Even if a) was not true you would have to arrange frequent
405        synchronisation of the RO copy with the RW volume (for example:
406        "vos release user.fred; fs checkv") and this would have to be
407        done for all such user volumes.
408
409     c) Presumably, the idea of replicating is to recover the $HOME
410        in the event of a server crash. Even if a) and b) were not
411        problems consider what you might have to do to recover a $HOME:
412
413        1) Create a new RW volume for the user on the second server
414           (perhaps named "user.fred.2").
415
416        2) Now, where do you mount it?
417
418           The existing mountpoint cannot be used because it already has
419           the ReadOnly copy of the original volume mounted there.
420
421           Let's choose: /afs/MyCell/user/fred.2
422
423        3) Copy data from the RO of the original into the new RW volume
424           user.fred.2
425
426        4) Change the user's entry in the password file for the new $HOME:
427           /afs/MyCell/user/fred.2
428
429        You would have to attempt steps 1 to 4 for every user who had
430        their RW volume on the crashed server. By the time you had done
431        all of this, the crashed server would probably have rebooted.
432
433        The bottom line is: you cannot replicate $HOMEs across servers.
434
435 ### <a name="3.18  What is the Andrew Benchma"></a> 3.18 What is the Andrew Benchmark?
436
437 "It is a script that operates on a collection of files constituting an application program. The operations are intended to represent typical actions of an average user. The input to the benchmark is a source tree of about 70 files. The files total about 200 KB in size. The benchmark consists of five distinct phases:
438
439       I MakeDir - Construct a target subtree that is identical to the
440                   source subtree.
441      II Copy    - Copy every file from the source subtree to the target subtree.
442     III ScanDir - Traverse the target subtree and examine the status
443                   of every file in it.
444      IV ReadAll - Scan every byte of every file in the target subtree.
445       V Make    - Complete and link all files in the target subtree."
446
447 Source: <file:///afs/transarc.com/public/afs-contrib/doc/benchmark/Andrew.Benchmark.ps> <ftp://ftp.transarc.com/pub/afs-contrib/doc/benchmark/Andrew.Benchmark.ps>
448
449 ### <a name="3.19  Where can I find the Andre"></a> 3.19 Where can I find the Andrew Benchmark?
450
451 From Daniel Joseph Barnhart Clark's [message](http://lists.openafs.org/pipermail/openafs-info/2004-April/012942.html):
452
453 It's linked to from <http://www.citi.umich.edu/projects/linux-scalability/tools.html>; CITI also has some useful mods at <http://www.citi.umich.edu/projects/nfs-perf/results/cmarion/>.
454
455 ### <a name="3.20  Is there a version of HP V"></a> 3.20 Is there a version of HP VUE login with AFS authentication?
456
457 Yes, the availability of this is described in: <file:///afs/transarc.com/public/afs-contrib/pointers/HP-VUElogin.txt> <ftp://ftp.transarc.com/pub/afs-contrib/pointers/HP-VUElogin.txt>
458
459 If you don't have access to the above, please contact Rajeev Pandey of Hewlett Packard whose email address is &lt;rpandey@cv.hp.com&gt;.
460
461 ### <a name="3.21  How can I list which clien"></a> 3.21 How can I list which clients have cached files from a server?
462
463 By using the following script:
464
465     #!/bin/ksh -
466     #
467     # NAME          afsclients
468     # AUTHOR        Rainer Toebbicke  <rtb@dxcern.cern.ch>
469     # DATE          June 1994
470     # PURPOSE       Display AFS clients which have grabbed files from a server
471
472     if [ $# = 0 ]; then
473             echo "Usage: $0 <afs_server 1> ... <afsserver n>"
474             exit 1
475     fi
476     for n; do
477             /usr/afsws/etc/rxdebug -servers $n -allconn
478     done | grep '^Connection' | \
479     while  read x y z ipaddr rest; do echo $ipaddr; done | sort -u |
480     while read ipaddr; do
481             ipaddr=${ipaddr%%,}
482             n="`nslookup $ipaddr`"
483             n="${n##*Name: }"
484             n="${n%%Address:*}"
485             n="${n##*([ ])}"
486             n="${n%?}"
487             echo "$n ($ipaddr)"
488     done
489
490 ### <a name="3.22  Do Backup volumes require"></a><a name="3.22  Do Backup volumes require "></a> 3.22 Do Backup volumes require as much space as [[ReadWrite]] volumes?
491
492 No.
493
494 The technique used is to create a new volume, where every file in the RW copy is pointed to by the new backup volume. The files don't exist in the BK, only in the RW volume. The backup volume therefore takes up very little space.
495
496 If the user now starts modifying data, the old copy must not be destroyed.
497
498 There is a Copy-On-Write bit in the vnode - if the fileserver writes to a vnode with the bit on it allocates a new vnode for the data and turns off the COW bit. The BK volume hangs onto the old data, and the RW volume slowly splits itself away over time.
499
500 The BK volume is re-synchronised with the RW next time a "vos backupsys" is run.
501
502 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".
503
504 ### <a name="3.23  Should I run timed on my A"></a> 3.23 Should I run timed on my AFS client?
505
506 No.
507
508 <a name="NTP"></a> The AFS Servers make use of NTP [[[NTP|Main/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.
509
510 For further details on NTP see: <http://www.eecis.udel.edu/~ntp/>. The latest version is 4.1, dated August 2001, which is **much** more recent that the version packaged with Transarc AFS.
511
512 A list of NTP servers is available via anonymous FTP from:
513
514 - <http://www.eecis.udel.edu/~mills/ntp/servers.html>
515
516 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). This is recommended for AFS servers which are also configured as clients (because servers normally run NTP daemons) and for clients that run NTP.
517
518 ### <a name="3.24  Why should I keep /usr/vic"></a> 3.24 Why should I keep /usr/vice/etc/CellServDB current?
519
520 On AFS clients, /usr/vice/etc/CellservDB, defines the cells and (their servers) that can be accessed via /afs.
521
522 Over time, site details change: servers are added/removed or moved onto new network addresses. New sites appear.
523
524 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).
525
526 As well as updating [[CellservDB]], your AFS administrator should ensure that new cells are mounted in your cell's root.afs volume.
527
528 If a cell is added to [[CellServDB]] then the **client** must either be restared or you must the AFS command "fs newcell -cell .. -servers ... ...".
529
530 ### <a name="3.25  How can I keep /usr/vice/e"></a> 3.25 How can I keep /usr/vice/etc/CellServDB current?
531
532 Do a daily copy from a master source and update the AFS kernel sitelist.
533
534 One good master source is the grand.central.org [[CellServDB]], available from <http://grand.central.org/dl/cellservdb/CellServDB> or <file:/afs/openafs.org/service/CellServDB> (N.B. update to /afs/grand.central.org path when available). You can send updates for this to <cellservdb@central.org>.
535
536 The client [[CellServDB]] file must not reside under /afs and is best located in local filespace.
537
538 Simply updating a client [[CellServDB]] file is not enough. You also need to update the AFS kernel sitelist by either: 1 rebooting the client or 1 running "fs newcell $cell\_name $server\_list" for each site in the [[CellServDB]] file.
539
540 A script to update the AFS kernel sitelist on a running system is newCellServDB.
541
542 <file:///afs/ece.cmu.edu/usr/awk/Public/newCellServDB> <ftp://ftp.ece.cmu.edu/pub/afs-tools/newCellServDB>
543
544 One way to distribute [[CellServDB]] is to have a root cron job on each AFS client copy the file then run newCellServDB.
545
546 Example:
547
548     #!/bin/ksh -
549     #
550     # NAME       syncCellServDB
551     # PURPOSE    Update local CellServDB file and update AFS kernel sitelist
552     # USAGE      run by daily root cron job eg:
553     #                    0 3 * * * /usr/local/sbin/syncCellServDB
554     #
555     # NOTE       "@cell" is a symbolic link to /afs/$this_cell_name
556
557     src=/afs/@cell/service/etc/CellServDB
558     dst=/usr/vice/etc/CellServDB
559     xec=/usr/local/sbin/newCellServDB
560     log=/var/log/syncCellServDB
561
562     if [ -s ${src} ]; then
563             if [ ${src} -nt ${dst} ]; then
564                     cp $dst ${dst}- && cp $src $dst && $xec 2>&1 >$log
565             else
566                     echo "master copy no newer: no processing to be done" >$log
567             fi
568     else
569             echo "zero length file: ${src}" >&2
570     fi
571
572 ### <a name="3.26  How can I compute a list o"></a> 3.26 How can I compute a list of AFS fileservers?
573
574 Here is a Bourne shell command to do it (it will work in GNU bash and the Korn shell, too):
575
576        stimpy@nick $ vos listvldb -cell `cat /usr/vice/etc/ThisCell` \\
577                      | awk '(/server/) {print $2}' | sort -u
578
579 ### <a name="3.27  How can I set up anonymous"></a> 3.27 How can I set up anonymous FTP login to access /afs?
580
581 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.
582
583 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 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.
584
585 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.
586
587 Unless you need to do authenticating ftp, you are _strongly_ recommended using wu-ftpdv2.4 (or better).
588
589 ### <a name="3.28 Is the data sent over the n"></a> 3.28 Is the data sent over the network encrypted in AFS ?
590
591 There is still no easy way to do this in Transarc AFS, but [[OpenAFS]] now has a "fs" subcommand to turn on encryption of regular file data sent and received by a client. This is a per client setting that persist until reboot. No server actions are needed to support this change. The syntax is:
592
593 - `fs setcrypt on`
594 - `fs setcrypt off`
595 - `fs getcrypt`
596
597 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.
598
599 Getting encryption enabled by default:
600
601 - [[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"`
602 - 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.
603
604 I have not tested either of these procedures. -- [[TedAnderson]] - 05 Jun 2003
605
606 ### <a name="3.29 What underlying filesystems"></a> 3.29 What underlying filesystems can I use for AFS ?
607
608 See also [[SupportedConfigurations]].
609
610 You need to distinguish between the filesystem used by the file server to store the actual AFS data (by convention in /vicep?) and the filesystem used by the client cache manager to cache files.
611
612 Fileserver is started by bosserver. It depends, what ./configure switches were used during compilation from sources. To be always on the safe side, use --enable-namei-fileserver configure flag. That will give you fileserver binary which can act on any /vicep? partition regardless it's filesystem type. With the new 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).
613
614 The opposite to namei fileserver is inode based nameserver. According to openafs-devel email list, it gave on some Solaris box 10% speedup over the namei based server. The namei based fileserver cannot run on every filesystem, as it stores some internal afs-specific data into the filesystem. Typically, /sbin/fsck distributed withthe operating system zaps these data. Inode based fileserver directly operates on the inodes of the underlying file system which therefore has to fully support the inode abstraction scheme. The the Administrators Guide for more details (they differ from system to system).
615
616 On the client side where you run /usr/afs/etc/afsd as a kernel process, you always have to use a file system supporting the inode abstraction for the cache (usually /usr/vice/cache) since the cache manager references files by their inode. Fortunately, it does not do such tricky stuff as the inode based fileserver.
617
618 The following file systems have been reported _not_ to work for the AFS client cache:
619
620 - reiserfs
621 - vxfs (HP-UX)
622 - advfs (Tru64), it works but gives cachecurruption
623 - efs (SGI) - IBM AFS does support efs, but openafs doesn't have a license for that.
624
625 - Patch committed to cvs around 6/2003 will now enforce this in some cases and generate a warning to the user if the filesystem type is wrong.
626
627 The following file systems have been reported to work for the AFS client cache:
628
629 - ext2
630 - ext3
631 - hfs (HP-UX)
632 - xfs (at least on IRIX 6.5)
633 - ufs (Solaris, [[Tru64Unix]])
634
635 ### <a name="3.30 Compiling _OpenAFS"></a> 3.30 Compiling [[OpenAFS]]
636
637 The kernel parts on Solaris have to be compiled with Sun cc, same for other platforms, i.e. you need same compiler used to compile kernel to compile your afs modules. [[Tru64Unix]] doesn't support modules, so you have to edit kernel config files and link statically into kernel. Kernel module insertion works fine on Linux, Solaris, Irix ...
638
639     ./configure --enable-transarc-paths=/usr/etc --with-afs-sysname=i386_linux24
640     make dest
641     cd dest/i386_linux24
642
643 ... 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.
644
645 ### <a name="3.31 Upgrading _OpenAFS"></a> 3.31 Upgrading [[OpenAFS]]
646
647 Upgrade of AFS on Linux
648
649     /etc/rc.d/init.d/afs stop
650     cd root.client/usr/vice/etc
651     tar cvf - . | (cd /usr/vice/etc; tar xfp -)
652     cp -p afs.rc /etc/rc.d/init.d/afs
653     cp ../../../../lib/pam_afs.krb.so.1  /lib/security
654     cd ../../../../root.server/usr/afs
655     tar cvf - . | (cd /usr/afs; tar xfp -)
656     # echo "auth sufficient /lib/security/pam_afs.so try_first_pass \
657     ignore_root" >> /etc/pam.d/login
658     cd /lib/security
659     vim /etc/sysconfig/afs
660     ln -s pam_afs.krb.so.1 pam_afs.so
661     cd /etc/rc3.d
662     ln -s ../init.d/afs S99afs
663     cd ../rc0.d
664     ln -s ../init.d/afs K01afs
665     cp /usr/vice/etc/afs.conf /etc/sysconfig/afs
666     /etc/rc.d/init.d/afs start
667
668 Upgrade of AFS on Solaris 2.6
669
670     cd /etc/rc3.d/
671     mv S20afs aS20afs
672     init 6
673     cd root.server/usr/afs
674     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
675     cd ../../..
676     cp root.client/usr/vice/etc/modload/libafs.nonfs.o /kernel/fs/afs
677     cp root.server/etc/vfsck /usr/lib/fs/afs/fsck
678     cd root.client/usr/vice
679     tar cvf - ./etc | (cd /usr/vice; tar xf -)
680     cd ../../..
681     cp lib/pam_afs.krb.so.1 /usr/lib/security
682     cp lib/pam_afs.so.1 /usr/lib/security
683     cd /etc/rc3.d
684     mv aS20afs S20afs
685     init 6
686
687 Upgrade of AFS on Irix 6.5
688
689     /etc/chkconfig -f afsserver off
690     /etc/chkconfig -f afsclient off
691     /etc/chkconfig -f afsml off
692     /etc/chkconfig -f afsxnfs off
693     /etc/reboot
694     cd root.server/usr/afs
695     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
696     cd ../../..
697     cp root.client/usr/vice/etc/sgiload/libafs.IP22.nonfs.o /usr/vice/etc/sgiload
698     echo "AFS will be compiled statically into kernel"
699     echo "otherwise skip following lines and use chkconfig afsml on"
700     cp root.client/bin/afs.sm  /var/sysgen/system
701     cp root.client/bin/afs /var/sysgen/master.d
702     echo "The next file comes from openafs-*/src/libafs/STATIC.*"
703     cp root.client/bin/libafs.IP22.nonfs.a /var/sysgen/boot/afs.a
704     cp /unix /unix_orig
705     /etc/autoconfig
706     echo "end of static kernel modifications"
707     cd root.client/usr/vice/etc
708     echo "Delete any of the modload/ files which don't fit your platform if you need space"
709     echo "These files originate from openafs-*/src/libafs/MODLOAD.*"
710     tar cvf - . | (cd /usr/vice/etc; tar xf -)
711     /etc/chkconfig -f afsserver on
712     /etc/chkconfig -f afsclient on
713     # /etc/chkconfig -f afsml on - afs is compiled statically into kernel, so leave afsml off
714     /etc/chkconfig -f afsml off
715     /etc/chkconfig -f afsxnfs off
716     /etc/reboot
717
718 Upgrade of AFS on [[Tru64Unix]]
719
720     cd root.server/usr/afs/
721     tar cvf - ./bin | (cd /usr/afs; tar xfp -)
722     cd ../../../root.client/bin
723     cp ./libafs.nonfs.o /usr/sys/BINARY/afs.mod
724     ls -la /usr/sys/BINARY/afs.mod
725     doconfig -c FOO
726     cd ../../root.client/usr/vice
727     cp etc/afsd /usr/vice/etc/afsd
728     cp etc/C/afszcm.cat /usr/vice/etc/C/afszcm.cat
729
730 ### <a name="3.32 Debugging _OpenAFS"></a> 3.32 Debugging [[OpenAFS]]
731
732 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):
733
734 cp src/viced/fileserver /usr/afs/bin (or wherever)
735
736     bos restart calomys fs -local
737
738 ... then attach with gdb
739
740 To debug if client running afsd kernel process talks to the servers from [[CellServDB]], do:
741
742     tcpdump -vv -s 1500 port 7001
743
744 Other ports are:
745
746     fileserver      7000/udp                        # fileport (FILESERVICE)
747     afscb           7001/udp                        # kernel extensions
748     afsprot         7002/udp                        # ptserver (PROTSERVICE)
749     afsvldb         7003/udp                        # vlserver (VLDBSERVICE)
750     afskauth        7004/udp                        # kaserver (KAUTHSERVICE)
751     afsvol          7005/udp                        # volserver (VOLUMESERVICE)
752     afserror        7006/udp                        # ERRORSERVICE
753     afsnanny        7007/udp                        # bosserver (NANNYSERVICE)
754     afsupdate       7008/udp                        # upserver (UPDATESERVICE)
755     afsrmtsys       7009/udp                        # RMTSYSSERVICE
756
757 When tcpdump doesn't help, try:
758
759     fstrace setset cm -active; make your error happen; fstrace dump cm
760
761 ### <a name="3.33 Tuning client cache for hug"></a> 3.33 Tuning client cache for huge data
762
763 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:
764
765     /usr/vice/etc/afsd -nosettime -stat 12384 -chunk 19
766
767     > So I ran the full suite of iozone tests (13), but at a single file
768     > size (128M) and one record size (64K).  I set the AFS cache size to > 80000K for both memcache and diskcache.
769
770     Note that memcache size and diskcache size are different things.
771     In the case of memcache, a fixed number of chunks are allocated
772     in memory, such that numChunks * chunkSize = memCacheSize.  In
773     the case of disk cache, there are a lot more chunks, because the
774     disk cache assumes not every chunk will be filled (the underlying
775     filesystem handles disk block allocation for us).  Thus, when you
776     have small file segments, they use up an entire chunk worth of
777     cache in the memcache case, but only their size worth of cache
778     in the diskcache cache.
779
780     -- kolya
781
782 ### <a name="3.34 Settting up PAM with AFS"></a> 3.34 Settting up PAM with AFS
783
784 Solaris
785
786     auth        sufficient    /lib/security/pam_afs.so debug try_first_pass ignore_root debug
787     auth        required      /lib/security/pam_env.so
788     auth        sufficient    /lib/security/pam_unix.so likeauth nullok
789     auth        required      /lib/security/pam_deny.so
790
791     account     required      /lib/security/pam_unix.so
792
793     password    required      /lib/security/pam_cracklib.so retry=3 type=
794     password    sufficient    /lib/security/pam_unix.so nullok use_authtok md5 shadow
795     password    required      /lib/security/pam_deny.so
796
797     session     sufficient    /lib/security/pam_afs.so set_token
798     session     required      /lib/security/pam_limits.so
799     session     required      /lib/security/pam_unix.so
800
801     # reafslog is to unlock dtlogin's screensaver
802     other  auth sufficient /usr/athena/lib/pam_krb4.so reafslog
803
804 ### <a name="3.35 Setting up AFS key in KDC a"></a> 3.35 Setting up AFS key in KDC and [[KeyFile]]
805
806 The easiest method is not much recommended, as the password is possibly very weak:
807
808     dattan# bos addkey server -kvno <n+1>
809     <pw>
810     <pw-again>
811
812     dattan# kstring2key -c <cellname>
813     <pw>
814
815     dattan# kadmin ckey afs
816     <cut-n-paste the ascii output from above>
817
818 Beware, there is currently a byte order bug in the kadmin tool as of May 2001 in KTH-KRB. If you run kadmin on a little indian machine (PC, Alpha, ...) you must swap the bytes manually. Here is a small example:
819
820     bg$ kstring2key -c sics.se
821     password:
822     ascii = \361\334\211\221\221\206\325\334
823     hex   = f1dc89919186d5dc
824     bg$ kadmin
825     kadmin: ckey afs
826     bg.admin@SICS.SE's Password:
827     New DES key for afs: \221\211\334\361\334\325\206\221
828
829 Please note how the bytes are swapped in groups of four.
830
831 This bug is fixed in an upcoming release.
832
833 Better approach is to create random key in KDC using "ksrvutil get" (rather then "ksrvutil add" which asks you for the new password), export it into /etc/srvtab ("ksrvutil ext") and from there copy it into /usr/afs/etc/KeyFile using asetkey utility from /afs/transarc.com/public/afs-contrib. After some years, you may wish to regenerate the random afs key using "ksrvutil change" in KDC and exporting it again.
834
835 There are two nice pages abou this:
836
837 <http://www.cs.cmu.edu/afs/andrew.cmu.edu/usr/shadow/www/afs/afs-with-kerberos.html> <http://www.contrib.andrew.cmu.edu/~shadow/afs/afs-with-kerberos.html>
838
839 As someone noted, you might need some ext\_srvtab utility to extract the key from /etc/srvtab, but I don't remeber that I needed it. Then he also suggets to use asetkey utility.
840
841 Create afs.natur\\.cuni\\.cz@NATUR.CUNI.CZ principal entry in kerberos:
842
843       principal name: afs
844       principal instance: natur.cuni.cz
845       principal realm: NATUR.CUNI.CZ
846
847 Import this key from Kerberos (/etc/srvtab) into AFS /usr/afs/etc/KeyFile using asetkey utility, which is I think from /afs/transarc.com/public/afs-contrib
848
849 ./asetkey add 0 /etc/srvtab <afs.natur.cuni.cz@NATUR.CUNI.CZ>
850
851 This [[KeyFile]] with the AFS-key you can just always re-copy to new AFS **server** machines. Be sure that the key version number KVNO is always same in this [[KeyFile]] and in Kerberos database. On all these machines you of course need afs.hostname.REALM key loaded into their /etc/srvtab (create them with 'ksrvutil get'). It seems klog(1) needs afs@REALM, so copy the principal afs.cell.name@REALM to it.
852
853 You can test if you have same keys in kerberos and AFS like this:
854
855     kauth username
856     tokens
857
858 If you have some tokens now, then it works and you can now shutdown kaserver. Users, which you have created in AFS under kaserver are in /usr/afs/db/kaserver.\*, but you can just forget them. Create these users again in Kerberos IV.
859
860 AFS users are then looked up in:
861
862 kerberos database (/var/kerberos/principal.db)
863
864 /usr/afs/etc/UserList (permission to manipulate 'bos')
865
866 system:administrators (permissions for vos, pts, fs, i.e. 'pts adduser' etc)
867
868     ---------------------------------------------------------------------------------
869     Another approach, untested:
870
871     http://www.natur.cuni.cz/~majordomo/krb4/krb4.9703/msg00002.html
872
873     Date: Tue, 9 May 2000 10:57:23 +0200 (MET DST)
874     From: Johan Hedin <johanh  at  fusion.kth.se>
875     To: Erland Fristedt <Erland.Fristedt@wcs.eraj.ericsson.se>
876     Cc: krb4@sics.se
877     Subject: Re: AFS+KTH-KRB problem
878
879     This is a printout how we got it to work. Hope this helps.
880
881     /Johan Hedin
882
883     callisto#/usr/athena/sbin/ksrvutil -p johanh.admin -f srvtab get
884     Name [rcmd]: afs
885     Instance [callisto]: fusion.kth.se
886     Realm [FUSION.KTH.SE]:
887     Is this correct? (y,n) [y]
888     Add more keys? (y,n) [n]
889     Password for johanh.admin@FUSION.KTH.SE:
890     Warning: Are you sure `fusion.kth.se' should not be `fusion'?
891     Added afs.fusion.kth.se@FUSION.KTH.SE
892     Old keyfile in srvtab.old.
893     callisto#/usr/athena/sbin/ksrvutil -p johanh.admin -f srvtab list
894     Version    Principal
895        4     afs.fusion.kth.se@FUSION.KTH.SE
896     callisto#/tmp/asetkey add 4 srvtab afs.fusion.kth.se@FUSION.KTH.SE
897     callisto#cd ..
898     callisto#bin/bos status callisto
899     Instance buserver, currently running normally.
900     Instance ptserver, currently running normally.
901     Instance vlserver, currently running normally.
902     Instance fs, currently running normally.
903         Auxiliary status is: file server running.
904     callisto#bin/fs la /afs
905     Access list for /afs is
906     Normal rights:
907
908       system:administrators rlidwka
909
910     --------------------------------------------------------------------------------
911     > Tokens held by the Cache Manager:
912     >
913     > User's (AFS ID 6020) tokens for afs@sunrise.ericsson.se [Expires May  5
914     > 04:05]
915     >    --End of list--
916
917     You got your tickets alright, but then
918
919     > > touch /afs/.sunrise.ericsson.se/tabort
920     > afs: Tokens for user of AFS id 6020 for cell sunrise.ericsson.se are
921     > discarded (rxkad error=19270407)
922
923     grep 19270407 /usr/afsws/include/rx/*
924     /usr/afsws/include/rx/rxkad.h:#define RXKADBADTICKET (19270407L)
925
926     so I would guess that the key version number and/or the key on your
927     AFS servers does not match the key of the afs principal.
928
929     Use klist -v to figure out about key version numbers and then use
930
931     $ kstring2key -c sunrise.ericsson.se
932     password:
933     ascii = \242\345\345\260\323p\263\233
934     hex   = a2e5e5b0d370b39b
935
936     or some other means to ensure that you use the same keys.
937
938 ### <a name="3.36 Obtaining and getting asetk"></a> 3.36 Obtaining and getting asetkey compiled
939
940 Better approach is to create random key in KDC, export it into /etc/srvtab and from there move in /usr/afs/etc/KeyFile using asetkey utility from /afs/transarc.com/public/afs-contrib
941
942     |  I can not get asetkey to compile.
943     |
944     |  asetkey.c: In function `main':
945     |  asetkey.c:25: `AFSCONF_SERVERNAME' undeclared (first use in this function)
946     |  asetkey.c:25: (Each undeclared identifier is reported only once
947     |  asetkey.c:25: for each function it appears in.)
948     +--->8
949
950 AFS 3.5 got rid of a few commonly-used AFS defines; I suspect they are now API calls of some kind, akin to the POSIX move from hardcoded constants to use of \{,f\}pathconf() and sysconf(). I have no idea what those calls are, though.
951
952 In the meantime, the following two defines are useful in building stuff on AFS 3.5:
953
954     #define AFSCONF_CLIENTNAME      "/usr/vice/etc"
955     #define AFSCONF_SERVERNAME      "/usr/afs/etc"
956
957 ### <a name="3.37 afs_krb_get_lrealm() using"></a><a name="3.37 afs_krb_get_lrealm() using "></a> 3.37 afs\_krb\_get\_lrealm() using /usr/afs/etc/krb.conf
958
959 In this file you can set also another REALM to be used by you afs server processes, if the REALM should differ from the system-wide REALM (
960
961     /etc/krb.conf
962
963 ).
964
965 Don't forget it's related to these entries in Kerberos KDC:
966
967     afs.cell.name@REALM
968     krbtgt CELL.NAME@REALM
969
970 If you use heimdal (or MIT krb5), do:
971
972 echo "REALM" &gt; /usr/afs/etc/krb.conf
973
974 ### <a name="3.38 Moving from kaserver to Hei"></a> 3.38 Moving from kaserver to Heimdal KDC
975
976     > While converting all our administration tools, we have discovered that
977     > the time a principal changed his/her/its password is _not_ carried over
978     > from the kaserver DB.
979
980 First of all, some Heimdal's configure flags:
981
982     --enable-kaserver
983
984 requires krb4 libs, so for that you'll need a working krb4 are you still using a kaserver/kaserver emulation ?
985
986     --enable-kaserver-db
987
988 is just for dumping a kaserver krb4 database. If you are no longer running a kaserver, you don't need it.
989
990 Migration itself:
991
992 <https://lists.openafs.org/pipermail/openafs-info/2002-May/004326.html>
993
994 This works while migrating from kaserver:
995
996     /usr/heimdal/libexec/hprop --source=kaserver --cell=xxx
997     --kaspecials --stdout | /usr/heimdal/libexec/hpropd --no-inetd --stdin
998
999 This somewhat doesn't:
1000
1001     /usr/heimdal/libexec/hprop --source=kaserver --cell=xxx
1002     --encrypt --master-key=<path to key> --kaspecials --stdout |
1003     /usr/heimdal/libexec/hpropd --stdin
1004
1005 ### <a name="3.39 Moving from KTH-KRB4 to Hei"></a> 3.39 Moving from KTH-KRB4 to Heimdal KDC
1006
1007     /usr/heimdal/libexec/hprop -n -k /etc/krb5.keytab --source=krb4-dump -d /var/kerberos/dump.txt --master-key=/.k -D | /usr/heimdal/libexec/hpropd -n
1008
1009     or
1010
1011     1. dump of the krb4 database with kdb_util
1012     2. dump of the "default" heimdal database with kadmin -l
1013     3. /usr/heimdal/libexec/hprop -n -k /etc/krb5.keytab --source=krb4-dump -d /usr/heimdal/libexec/hprop -n -k /etc/krb5.keytab --source=krb4-dump -d
1014        where /etc/krb5.keytab contains hprop/`hostname` keys
1015     4. merge of the converted database with file from (2) via kadmin
1016
1017     The special thing for me is the use of "-D" in the (3) which seems to
1018     cause conversion des-cbc-sha1 keys of old krb4 database entries to
1019     des-cbc-md5.
1020
1021 ### <a name="3.40 What are those bos(1) -type"></a> 3.40 What are those bos(1) -type values simple and cron?
1022
1023 Typically, admins do this once they configure new afs server:
1024
1025     bos create foo ptserver simple /usr/afs/bin/ptserver -cell bar.baz
1026     bos create foo vlserver simple /usr/afs/bin/vlserver -cell bar.baz
1027     bos create foo fs fs /usr/afs/bin/fileserver /usr/afs/bin/volserver /usr/afs/bin/salvager -cell bar.baz
1028
1029 Type "simple" has one process. type "cron" gets forked at the appropriate time.
1030
1031 ### <a name="3.41 KDC listens on port 88 inst"></a> 3.41 KDC listens on port 88 instead of 750
1032
1033     "Kramer, Matthew" <mattkr@bu.edu> writes:
1034
1035     > Hello,
1036     >       Our Kerberos 4 environment listens on only port 750 and doesn't
1037     > listen on port 88.  For Win2K/XP machines this causes a problem in
1038     > C:\openafs-1.2.8\src\kauth\user_nt.c line 144 when the Kerberos port is
1039     > queried from the %systemroot%\system32\drivers\etc\services file.  Win2K
1040     > and XP both return 88 which is correct for Kerberos 5 but in our case
1041     > not for Kerberos 4.  Why doesn't it instead query for kerberos-iv which
1042     > would return the correct value of 750?
1043     >
1044     > Y:\src\kauth>diff user_nt.c.orig user_nt.c
1045     > 144c144
1046     > <       sp = getservbyname("kerberos", "udp");
1047     > ---
1048     > >       sp = getservbyname("kerberos-iv", "udp");
1049     >
1050     A quick work around could be to use Loves requestforwarder found at
1051
1052     ftp://ftp.stacken.kth.se/pub/projects/krb-forward/krb-forward-0.1.tar.gz
1053
1054     /JockeF
1055
1056 ### <a name="3.42 afsd gives me &quot;Error -1 in"></a><a name="3.42 afsd gives me &quot;Error -1 in "></a> 3.42 afsd gives me "Error -1 in basic initialization." on startup
1057
1058 When starting afsd, I get the following:
1059
1060     # /usr/vice/etc/afsd -nosettime -debug
1061     afsd: My home cell is 'foo.bar.baz'
1062     ParseCacheInfoFile: Opening cache info file '/usr/vice/etc/cacheinfo'...
1063     ParseCacheInfoFile: Cache info file successfully parsed:
1064            cacheMountDir: '/afs'
1065            cacheBaseDir: '/usr/vice/cache'
1066            cacheBlocks: 50000
1067     afsd: 5000 inode_for_V entries at 0x8075078, 20000 bytes
1068     SScall(137, 28, 17)=-1 afsd: Forking rx listener daemon.
1069     afsd: Forking rx callback listener.
1070     afsd: Forking rxevent daemon.
1071     SScall(137, 28, 48)=-1 SScall(137, 28, 0)=-1 SScall(137, 28, 36)=-1 afsd: Error -1 in basic initialization.
1072
1073 Solution: make sure you have kernel module loaded.
1074
1075 ### <a name="3.43 Although I get krb tickets,"></a> 3.43 Although I get krb tickets, afslog doesn't give me tokens, I see UDP packets to port 4444
1076
1077 Using tcpdump I see the following traffic. What runs on the port 4444?
1078
1079     15:16:54.815194 IP foo.bar.baz.32772 > foo.bar.baz.4444: UDP, length: 269
1080     15:16:54.815199 IP foo.bar.baz > foo.bar.baz: icmp 305: foo.bar.baz udp port 4444 unreachable
1081
1082 This is the 5-&gt;4 ticket conversion service on UDP port 4444. Assuming your afs servers know how to deal with krb5 tickets (since openafs-1.2.10? and 1.3.6x?) include the following in /etc/krb5.conf:
1083
1084     [appdefaults]
1085             afs-use-524 = local
1086
1087 ### <a name="3.44 I get error message trhough"></a> 3.44 I get error message trhough syslogd: "afs: Tokens for user of AFS id 0 for cell foo.bar.baz are discarded (rxkad error=19270407)"
1088
1089 Answer:
1090
1091     grep 19270407 /usr/afsws/include/rx/*
1092     /usr/afsws/include/rx/rxkad.h:#define RXKADBADTICKET (19270407L)
1093
1094 ### <a name="3.45 I get tickets and tokens, b"></a> 3.45 I get tickets and tokens, but still get Permission denied.
1095
1096 Answer: /usr/afs/etc/UserList accepts only krb4 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.
1097
1098 ### <a name="3.46 Recovering broken afs cache"></a> 3.46 Recovering broken afs cache on clients
1099
1100     >> Does anyone have a trick to force AFS to refresh its cache (for a
1101     >> particular directory or even for all files?) The only way I know
1102     >> how to accomplish this is to reboot, stop in single user mode,
1103     >> rm -rf the cache files and let AFS rebuild everything.
1104     >
1105     > fs flush and fs flushv have cured corruption problems in the past
1106     > on some of our clients.
1107
1108     Thanks for the tip - I was not aware of the flush* subcommands.
1109     Here's a little of what I saw today:
1110
1111     ls -la
1112     /bin/ls: asso.S14Q00246.all.log: Bad address
1113     /bin/ls: asso.S14Q00246.all.lst: Bad address
1114     /bin/ls: chr14markers.txt: Bad address
1115     /bin/ls: geno.summary.txt: Bad address
1116     /bin/ls: global.ind.S14Q00246.all.txt: No such device
1117     /bin/ls: global.S14Q00246.all.txt: No such device
1118     total 103
1119     [ other ls results as usual ]
1120
1121     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.
1122
1123 ### <a name="3.47 What does it mean for a vol"></a> 3.47 What does it mean for a volume to not be in the VLDB?
1124
1125 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.
1126
1127 ### <a name="3.48 What is a Volume Group?"></a> 3.48 What is a Volume Group?
1128
1129 A volume group is a set of volumes whose volume id numbers differ only in the last three bits. This means that up to eight volumes may belong to a single volume group.
1130
1131 Volumes which share storage on a partition (for example, a volume and its backup, or the r/w and r/o copy of a volume on the same partition) must be part of the same volume group.
1132
1133 ### <a name="3.49 What is a Clone?"></a> 3.49 What is a Clone?
1134
1135 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".
1136
1137 Clone volumes must belong to the same volume group (see previous question) as the volume which they are a clone of.
1138
1139 In addition to backup and readonly clones, you may create up to three additional clones of a volume. To do this, use "vos clone".
1140
1141 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 question 3.47). 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.
1142
1143 ### <a name="3.50 What is a Shadow?"></a> 3.50 What is a Shadow?
1144
1145 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.
1146
1147 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 shadow volume that identifies it as a shadow volume. Shadow volumes do not appear in the VLDB (see question 3.47) -- "vos shadow" does not create a VLDB entry and "vos syncvldb" ignores shadow volumes.
1148
1149 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.
1150
1151 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.
1152
1153 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.
1154
1155 ### <a name="3.51 Can I authenticate to my af"></a> 3.51 Can I authenticate to my afs cell using multiple kerberos Realms?
1156
1157 Yes. This can be usefull 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.
1158
1159 As long as you only need to support 2 realms, and one of them has the same name as the afs cell(or the uppercase of the name of the afs cell) you can do this without upgrading to a new version of AFS. If you need more Realms, or if neither Realm name matches your cell name, there is work to support this in the development tree.
1160
1161 In order to make this work, you need to do 4 things.
1162
1163 1) add a key for the afs service to the additional realm and store it in a keytab:
1164
1165     $ kadmin -q ank -e des-cbc-crc:v4 -kvno <new kvno> afs/your.cell.name@YOUR.SECOND.REALM.NAME
1166     $ kadmin -q ktadd -e des-cbc-crc:v4 -k /path/to/afs.keytab afs/your.cell.name@YOUR.SECOND.REALM.NAME
1167
1168 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.
1169
1170 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 "kadmin -q getprinc afs/your.cell.name@YOUR.SECOND.REALM.NAME" command.
1171
1172 2) add the new key to the afs [[KeyFile]] on your afs servers:
1173
1174     $ asetkey add <kvno> /path/to/afs.keytab afs/your.cell.name@YOUR.SECOND.REALM.NAME
1175
1176 note that the kvno here needs to be the same one as is reported by the kadmin getprinc command.
1177
1178 3) create an afs krb.conf with your additional Realm's name in it, and place it on all of your AFS servers:
1179
1180     echo "YOUR.SECOND.REALM.NAME" > /usr/afs/etc/krb.conf
1181
1182 4) restart you afs servers.
1183
1184 at this point you should be able to run:
1185
1186     kinit you@YOUR.SECOND.REALM.NAME
1187     aklog
1188
1189 and recieve the same privileges as if you had run:
1190
1191     kinit you@YOUR.CELL.NAME
1192     aklog