WARNING:
CODA IS BARELY READY FOR PRODUCTION USE. THIS RELEASE IS JUST FOR THOSE INTERESTED IN EXPLORING THOSE FEATURES WHICH WORK. IT CONTAINS KERNEL CODE, AND SERVERS RUNNING WITH ROOT PRIVILEGES, AND COULD LEAD TO DATA LOSS.
To get Coda running you will go through 3 steps:
Before you can use a Coda client you need a new filesystem driver in your kernel. For the most part this driver redirects requests to the user level cache manager venus. Precompiled modules exist for commonly used kernels. If no module exists for you, you'll find instructions below where to find it.
Get a
coda-fs-module-k2.?.?-c?.?.?.arch.rpm rpm package and
install it. k2.?.?
should match your kernel version (use uname
-a) and c?.?.?
should match you Coda version.
Linux kernels change often and many people have custom kernels for their environment. Our modules will generally only work on RedHat Linux kernels and you may have to build a module for your kernel. Look at the section building a kernel module.
You may obtain a Coda lkm from your FreeBSD distribution:
cd /lkm
Check if coda_mod.o
is there already.
Otherwise, you may obtain a Coda lkm from the Coda site:
ftp://ftp.coda.cs.cmu.edu/pub/coda/freebsd/3.0-aout/i386/coda_mod.o
You then install the lkm with:
modload -v -e coda_mod -o /var/run/lkm.coda /lkm/coda_mod.o
You can build support for the Coda VFS layer into your kernel. This is discussed later in the Building FreeBSD section.
NOTE: The GENERIC NetBSD kernel should have Coda enabled. Do an:
nm -o /netbsd | grep coda_open
If this is present, you are done with this section. PROCEED NO
FURTHER
If you need to load an lkm it should be in the NetBSD distribution:
cd /usr/lkm
Check if coda.o is there already. Otherwise, you may obtain a Coda lkm from the Coda site:
ftp://ftp.coda.cs.cmu.edu/pub/coda/netbsd/current/i386/coda-1_3H.o
You then install the lkm with:
modload -v -e coda_lkmentry -o /var/run/lkm.coda /usr/lkm/coda-1_3H.o
You can build support for the Coda VFS layer into your kernel, though this should be automatic. This is discussed later in the Building NetBSD section.
The kernel module is part of the Coda client installer.
These are partial instructions on how to setup and configure the Coda filesystem. Refinements to the setup created here are discussed in http://ftp.coda.cs.cmu.edu/doc/html/manual.html You will probably not need these refinements in the first instance.
The venus-setup
script does all the hard work, it will setup the coda
control files, create /dev/cfs0
to communicate with the
kernel, ... It also initializes a directory for cache files. In your
first Coda run we recommend a small cache, say 20MB. The cache size
should be at least 10Meg, typically 60-200Meg is used. Do not go
above 300Meg. All the files created will be placed under
/usr/coda
. You should make sure that there is enough space
in the file system on which /usr/coda
resides to hold a fully
populated cache.
venus-setup <comma_separated_host_list> <cache_size_in_kb>
venus-setup
and venus
(below) are in /usr/sbin
.
Make sure that /usr/sbin
is in your path or that you use
fully qualified pathnames. We strongly recommend that you try
testserver.coda.cs.cmu.edu as the comma_separated_host_list
first, and keep the cache size to 20000.
NOTE: venus-setup
will edit /etc/services
to add some additional
services.
The following assumes you are running X-Windows. However, you could
run these commands from virtual consoles as well, by omitting the
xterm -e
in front of the commands below.
Start Venus with:
venus &
An -init
flag can be given when venus
is started; it flushes the
local cache contents. venus-setup
forces an init to happen when
venus is first started. The -init
flag can be given if Coda
cannot recover it's cache after a crash, or after editing the
vstab
file manually.
Observe the venus log with:
xterm -e tail -f /usr/coda/etc/console
It will tell you when venus has started and give status.
Type:
xterm -e codacon &
to see the communications between the Venus and Vice.
It is possible to see the upcalls from the kernel to Venus by turning up logging in Venus, but they are not very interesting. (To turn on minimal debugging, type:
vutil -d 1
and then tail -f /usr/coda/coda.cache/venus.log
.)
To halt venus, type:
vutil shutdown
umount /coda (Linux only)
Or you can kill -9 venus, if you must.
NOTES for Linux users:
/coda
must
be unmounted. If umounting /coda
gives trouble, make sure to
exit all process that hang on to Coda, e.g. by having files open or
being cd'd into /coda. A utility like lsof
and fuser
can
help with this./proc/fs/coda
has interesting Coda statistics. vutil
-kdebug 4095
and call tracing with vutil ktrace 1
. The
messages appear in /var/log/messages
During installation you will be prompted for the IP address of your client and of your Coda server(s). Enter this as indicated.
All executables can be found in the directory C:\usr\coda\bin
There are two ways to play with Coda:
The CodaStart pogram is a Win32 windows-based application to control and observe the Windows 95 Coda client. It will be enhanced in the future. For now it provides a convenient way to start Venus.exe and to load the kernel module. It also displays the kernel-venus communication for debugging purposes. Printing the messages can be stopped by unticking the 'Monitor' check box. The button 'Reset' clears the display.
You are now ready to browse through the Coda filesystem using the explorer!
relay.exe
in a command Window. This is a 32bit DOS application which you can
also start by double clicking on the file in explorer.
venus.exe -cf 1500 -init
in a command window.
(this gives up to 1500 cache files, try with more if everythings works
fine. Initialization will take longer the more cache file you specifiy.)
mount.exe N:
This maps the Coda filesystem to the N:
drive.You are now ready to browse through the Coda filesystem using the explorer!
venus.exe
. If venus
crashes restarting it is
normally all you need to do. N:
drive
run:
unmount.exe
This will stop relay.exe
(if it is still running) and unload
codadev.vxd
which was loaded by relay.exe
.
NOTE: In some installations the DPMI DOS Extender window suspends when it is not active. In this case untick the window property 'Properties->Misc-> Background->Always Suspend'. If it is unticked, ticking and unticking it again might help. Also untick the 'Termination' flag, to allow Coda to automatically shutdown, when the system shuts down. For your convenience tick the 'Close on Exit' check box in the 'Program' tab.
To set up an SCM server, you will run a script vice-setup. This
script creates configuration files under the /vice
directory and creates files and directories on your system for storage
of file data and metatdata. To answer the questions vice-setup
is asking you need to have the following thought through:
an empty directory (viz /vicepa) where the fileserver will put files. There must be as much free space on this filesystem as the data you wish to store in Coda.
a file or raw partition for RVM metadata. You can use a file but it will be quite slow on a larger server. This partition must be around 4% of the total size of the files you wish to store under /vicepa (e.g. on a 2GB server we use around 80M of rvm data). For first installations we recommend the default 22M options, and using files for RVM log and data. (NOTE: Windows NT Setup creates the file c:\coda\rvm\DATA. Use this for RVM metadata.)
The metadata, held in the RVM data file, is memory mapped. You need that amount of space as virtual memory on your system, in addition to virtual memory to run the server ( 6MB) and other software.
a LOG file, preferably a raw partition on a disk by itself. This needs not be large, a few M's are fine. (NOTE: Windows NT Setup creates the file c:\coda\rvm\LOG. Use this for RVM transaction log.)
All servers in a coda cell need to have a unique number to identify
them. The servername to identifier mappings have to be defined by the
administrator in the file /vice/db/servers
on the SCM. The
format of this file is as follows:
servernameX.domain.name 1
servernameY.domain.name 2
...
There are currently several limitations to which identifiers are actually usable:
two secret tokens of _exactly_ 8 characters (eg elephant).
NOTE: you are now ready to run the setup script. We strongly recommend that you stick to default choices offered as configuring a server differently is quite difficult.
Then run:
vice-setup
and answer its questions. Note down the commands that vice-setup
prints out for you at the end.
Note: For Windows NT you will need the Cygwin B19 Shell which can be started from the "Start" menu. The shell uses the c:\coda directory as the root mountpoint "/".
Start the rpc2portmap server, update server, client and the auth server, as well as the fileserver by typing:
/etc/rc.d/init.d/auth2.init start
/etc/rc.d/init.d/update.init start
/etc/rc.d/init.d/codasrv.init start
/etc/rc.vice start
codastart
Now observe the log:
xterm -e tail -f /vice/srv/SrvLog &
The SrvLog
should show File Server started. If not,
you have a problem.
Determine with ps
that codasrv
, auth2
, rpc2portmap
,
updatesrv
and updateclnt
are running.
During your configuration session, you commmunicated a name for the
root volume to the program. This root volume now needs to be
craeted: the precise command to do this was printed out by the
vice-setup program, below we assume your file space is in
/vicepa
, and your root volume is coda:root
.
createvol_rep coda:root E0000100 /vicepa
NOTE: E0000100 is the Volume Storage Group set up for you by vice-setup. With more servers you can define other groups in /vice/db/VSGDB -- see the Coda User Manual.
Now you are ready to point a Venus (client) at this server. You do this by typing
venus-setup server-name cache-szie-in-kb
NOTE: Windows 95 users should type the IP address and not the
hostname of the server.
Start Venus as explained above. From the coda client side, the root volume will appear under /coda. To use it you must now authenticate to Coda, since it is write protected.
The vice-setup program installed an administrative Coda user on the server. It has a uid you chose and has been assigned password changeme. You may clog into Coda with this uid:
clog "adminuser"
Validate that you have tokens with the ctokens
utility.
You can now create files in coda
, because the administrative user
is on the access control list (ACL) of the /coda
directory. Read the next section to find out how to do more with Coda.