Coda File System

Next Previous Contents

4. Exploring Coda's features

4.1 Restarting a server

On the server the command volutil shutdown will stop the server. If it is really toasted, you might need to kill the codasrv process.

To restart the server issue the command startserver . This shell script invokes codasrv with the correct arguments. If it complains about a server already running do the following: first check with ps auxww | grep codasrv if this is the case. If not, remove the file /vice/srv/pid and reissue the startserver command.

4.2 Getting more volumes

It is a good idea to create a few extra volumes on your server and mount these in the coda directory tree. In particular if you want to explore reintegration, conflict resolution and replication servers we recommend that you do that in new volumes and not in the volume mounted on the root of the Coda filesystem.

To make a new volume:

  1. make sure your codasrv, updatecln and updatesrv are running.
  2. type createvol_rep volname vsgaddr partitionname . Typically you determine your own volume name, the VSG address can be found in /vice/db/VSGDB and the partition name will be /vicepa.
  3. mount the volume using cfs makemount path volumename . This creates the mount point, and mounts the volume.

To explore volumes you can use other cfs commands, such as cfs whereis path and cfs listvolume path . To see the FID of a file type cfs getfid path .

4.3 Adding a user

As of release 5.2 we have a tool to manage the user database. It is basic, but can handle things like hierarchical groups and is a major improvement over the old tools.

  1. Run pdbtool on the SCM. Type help to see commands, and type the command without arguments to get more help. There is also a manpage for pdbtool which you may want consult.
  2. Add the user and her user id with the nui command.
  3. Add the user to any groups you want.
  4. Give the new user a password by using the au nu program (from either a client or a server).

The user should now be able to login to Coda just like the first user set up at installation time.

Note: Conversion from a pre 5.2 version of the user databases is done with the pwdtopdbtool tool. This script takes no arguments and converts old databases to new; it overwrites the new databases!

4.4 Exploring ACL's.

You can set and list Access Control Lists on directories using cfs setacl dir user rights [user rights...] . To show the ACLs type cfs listacl directory .

4.5 Monitoring Coda

Use codacon to see many RPC's and a few other actions taken by the client. The file /usr/coda/etc/console also has interesting information.

To see how a server is doing use cmon , in the form cmon server:25 , 25 depicts the width of the column used by the server.

4.6 Using Coda disconnected and reintegrating.

First create a new volume, not equal to your root volume, to explore this. Should you get conflicts in your root volume then they will be hard to repair. See below how to add a volume.

  1. change directory into this volume. Do "ls -l" on the directory where you want to start work while disconnected. Get tokens using clog .
  2. type cfs disconnect or disconnect your network. After 30 seconds you can see that codacon (which you should always run) displays that your server is not reachable anymore.
  3. do some work disconnected, create some files, edit them etc.
  4. type cfs reconnect . Venus will discover that the net is up, but you can speed that up by typing cfs checkservers . Monitoring codacon, you will see that your changes are being re-integrated.

To start Coda while disconnected, you need the ip addresses and hostnames of your servers in /etc/hosts .

4.7 Repairing conflicts

Files and directories can get into conflict due to disconnections of clients or servers from the net, as well as through overlapping open/write/close sequences on two clients. A object that is in conflict is representd as a dangling symbolic link and X- > @vol.vnode.unique is the file the symlinks points to.

How do we get rid of this conflict?

  1. type cfs beginrepair X . This changes X from a symlink into a directory. By doing ls X you will see either local global or server1 server2 server3 . In the first case we have a local global conflict and in the second case a server server conflict.
  2. If the objects in the directory X are files, you have a file conflict, they can also be directories, in which case you can find the content underneath.
  3. If you are nervous, this is a good moment to make copy of your files. They can be found under the directory X while the repair session is in progress.
  4. cfs endrepair X closes up the repair session.
  5. All local global conflicts are repaired with repair . Type repair and follow its cryptic instructions.
  6. Server-server conflicts on files are fixed with either filerepair or with removeinc . Server-server conflicts on directories are fixed with repair .

4.8 Exploring replication

First you will have to add a second server to your Coda cluster. Install the software and use vice-setup again. This time your server is not going to be the SCM. Proceed answering the questions until done.

On the SCM add the following:

  1. Your server needs a server number, to be added to the /vice/db/servers file ON THE SCM .
  2. Make two new entries in the /vice/db/VSGDB file. One for your new server by itself, one of the form: E0000104 scm-server second-server .
  3. Start updatesrv and updateclnt on the second server.
  4. Start codasrv on the second server
  5. Make a new volume from the SCM using createvol_rep giving the address of the volume as E0000104 .
  6. Mount the volume as above.
You can now use this volume and your files will automatically be stored on multiple servers. To temporarily disable a server, and see that things continue to function normally, either shut the server down with volutil shutdown or disconnect its network. You can also isolate the server using our network filters with filcon isolate -s server-name . Using filcon clear server-name clears the filter.

Modifications made to coda files during the server outage will be resolved when the files are first accessed. You see message of the form Resolve path in the codacon output. By typing cfs checkservers you can see if the server is available again.

Next Previous Contents