[OpenAFS-devel] OpenAFS for FreeBSD 5.2 patch

Adriaan de Groot adridg@cs.kun.nl
Tue, 16 Mar 2004 16:06:43 +0100 (MET)


[Apologies for the dupe wrt. the port-freebsd list.]

On Mon, 15 Mar 2004, Garance A Drosihn wrote:
> I'm building a second machine for stress-testing this (my main
> maachine has too much important data on it).

The system builds fine on a pristine 5.2.1-R machine with the right
sysname and after linking GENERIC -> MYSYSNAME in
/usr/src/sys/i386/somewhere. Mentioned earlier on this list, and not a big
problem.

But then I hit a big roadblock, the "what now?" phase. The documentation
available from the openafs site is all based on IBM's docs, and assumes
that you're copying files off of the cdrom. Things like afs.conf, which
I've not got. After much wandering around, I've created a cacheconf file,
ThisCell, and CellServDB, and am left with just afsd coring on an illegal
syscall on startup.  ... ah, there, in /usr/local/lib/openafs/libafs.ko.
So in spite of it mostly working now, is there some "configuring a FreeBSD
AFS client machine, installed from source, for ninnies?"

Gosh, afsd tells me 0 non-empty cache files. OK. And after much mucking
about, klog works too.

So here's the AFS-on-FreeBSD-for-ninnies doc (remember, never complain if
you're not willing to write a patch):

1) Get the AFS sources from CVS. There is documentation here on how to get it.

http://www.openafs.org/cgi-bin/cvsweb.cgi/~checkout~/openafs/README.CVS?rev=1.1.2.2&content-type=text/plain



2) Run regen.sh in the checked-out tree. This requires autoconf and
automake (pkg_add -r autoconf automake will do here).

3) If you're not running a GENERIC kernel, go to your kernel build tree,
probably in /usr/src/sys/i386/compile, move any existing GENERIC out of
the way there, and ln -s yourkernelconfig GENERIC.

4) Back to the openafs tree, and run ./configure --afs-sys-name=i386_fbsd_52

5) make && make install

6) mkdir /afs /usr/local/etc/openafs

7) Choose a filesystem of sufficient size (1G? The notion of "large" and
"small" has changed since the docs for openafs were written). Call this
$CACHE (we'll use $CACHE to denote this filesystem later).

8) In /usr/local/etc/openafs, create the cacheconfig, ThisCell and
CellServDB files. Typical contents are:

	=== cacheconfig
	/afs:$CACHE:50000
	=== cacheconfig

	=== ThisCell
	your.domain.com
	=== ThisCell

	=== CellServDB
	>your.domain.here #organization
	10.0.0.1          #machine_name
	=== CellServDB

where 10.0.0.1 should be the IP of (one of) the server machine. See

http://www.openafs.org/pages/doc/QuickStartUnix/auqbg005.htm#HDRWQ68
http://www.openafs.org/pages/doc/QuickStartUnix/auqbg005.htm#HDRWQ66

for cacheconfig and CellServDB, respectively.

9) kldload /usr/local/lib/openafs/libafs.ko

10) afsd .. this might take some time.

11) In the meantime, get your admin to create a user for you. This is
something like:

	pts createuser -user yourname
	pts adduser -user yourname -group yourgroup
	kas create -name yourname

You'll have to enter a password, and perhaps using -admin_username is
useful as well.

12) Back at the lab, login again as yourname, and try to run klog.
Ideally, you give your password and it doesn't complain at all. Running
tokens should tell you you're you for AFS. cd /afs and play around with
what's there. See how you can list directories? Read files?

13) Type "cd" to cd out of the afs filespace and back to your home
directory. See how the kernel panics with vrele: negative refcoubnt? Isn't
the disk buffers remaining count soothing?





OK, steps 1-12 are useful. 13 is what happened to me, so the caveat about
the 5.2 client being unstable are to be taken to heart.

[ade]