Quick Client Action

of Kiss Coda Wiki

Table of contents

  1. Notice
  2. Load Coda Kernel Module
  3. Obtain and Install Coda Client
  4. Perform Follow-up Operations
  5. Run Coda Client
  6. Connect to the Test Server!
  7. Authenticate with the Test Server (Obtain Write Access)
  8. Explore Around
  9. Shutdown Coda Client
  10. Access Coda manual pages
  11. What to do next?

Notice

For the easiest way to install a Coda client you should see Client Binary Installer first.

If your OS/architecture is not available there, then this page is for you.

Load Coda Kernel Module

Linux users already have out-of-the-box kernels with Coda module compiled. If you manually compiled your kernel and did not include this module, consider installing a stock, distribution kernel for this test, and simply move to loading the module.

    # modprobe coda

    # lsmod  | grep coda
    coda                   30404  3

Earlier versions of FreeBSD shipped with a pre-compiled Coda module, which had to be loaded before you can run Venus:

    # kldload coda
    # kldstat  | grep coda
     3    1 0xc252b000 10000    coda.ko

FreeBSD users are advised that that the Coda module shipped with FreeBSD 6.x is known to be unstable, and should only use the Coda module shipped with FreeBSD 7.0 up to 8.x.

NetBSD includes kernel support for Coda. FIXME: document whether explicit loading is necessary or not.

If you need to manually compile Coda kernel module, see more about it on Quick Kernel Module Action.

Obtain and Install Coda Client

For Debian GNU/Linux (possibly just replace “stable” with “testing” or “unstable”):

    echo 'deb http://www.coda.cs.cmu.edu/debian stable/' >> /etc/apt/sources.list
    apt-get update
    apt-get install coda-client

FreeBSD users could install the either coda6_client or the coda6_server port:

    cd /usr/ports/net/coda6_client
    make install

It was also possible to use pre-compiled coda-client and coda-server packages on FreeBSD.

FIXME: document what are the command to activate Coda support on NetBSD.

For building from source, you may save the following bash shell script as coda_cvs.sh. It will automate the complete build and install phase.

To successfully compile and install Coda, you will need to have root privileges and the following development packages:

cvs autoconf automake libtool flex bison g++ curses-dev libreadline5-dev.

Once you’ve taken care of the above pre-requisites, simply run the script as

    chmod 755 coda_cvs.sh; ./coda_cvs.sh

If you don’t like copy-pasting, you can download it directly from http://www.hcoop.net/~docelic/coda_cvs.sh. Don’t forget to verify the contents before running a script fetched from the Net!

The script included below contains fixes absent in the original but is untested.

The script will, by default, build complete Coda package and install the client part.

    #!/bin/bash -e

    # Script to build and install Coda client and/or server from source.
    # Davor Ocelic, docelic@mail.inet.hr, Feb 2007.
    #
    # Coda, an Advanced Netowrked Filesystem, http://www.coda.cs.cmu.edu/
    #
    # Usage:
    # sh ./coda_cvs.sh [nolwp] [norpc] [norvm] [nocoda] [server]
    #
    # So common invocation is (to build and install client):
    #   sh ./coda_cvs.sh
    #
    # And to install server part after client is compiled and installed:
    #   cd coda-cvs/coda && make server-install
    #
    # Or to build only server part directly with the script:
    #   sh ./coda_cvs.sh server
    #

    mkdir -p coda-cvs
    cd coda-cvs/

    PREFIX=/usr/local/coda

    export CVSROOT=:pserver:anonymous@coda.cs.cmu.edu:/coda-src

    if echo "$*" | grep -v noup >/dev/null; then
            echo "UPDATING CVS MODULES"
            if [ -d lwp  ]; then lwp_action="up -d";  else lwp_action=co; fi
            if [ -d rpc2 ]; then rpc2_action="up -d"; else rpc2_action=co; fi
            if [ -d rvm  ]; then rvm_action="up -d";  else rvm_action=co; fi
            if [ -d coda ]; then coda_action="up -d"; else coda_action=co; fi
            cvs -z3 $lwp_action  -P lwp
            cvs -z3 $rpc2_action -P rpc2
            cvs -z3 $rvm_action  -P rvm
            cvs -z3 $coda_action -P coda
    fi

    if echo "$*" | grep nolwp >/dev/null; then :; else
            echo "BUILDING LWP"
            cd lwp; sh bootstrap.sh; ./configure --prefix=$PREFIX \
                       && make && make install; cd ..
    fi

    if echo "$*" | grep norpc >/dev/null; then :; else
            echo "BUILDING RPC2"
            cd rpc2; sh bootstrap.sh; ./configure --prefix=$PREFIX \
               --with-lwp-includes=$PREFIX/include \
               --with-lwp-library=$PREFIX/lib && make && make install; cd ..
    fi

    if echo "$*" | grep norvm >/dev/null; then :; else
            echo "BUILDING RVM"
            cd rvm; sh bootstrap.sh; ./configure --prefix=$PREFIX \
               --with-lwp-includes=$PREFIX/include \
               --with-lwp-library=$PREFIX/lib && make && make install; cd ..
    fi

    if echo "$*" | grep nocoda >/dev/null; then :; else
            type=client

            if echo "$*" | grep server >/dev/null; then
                    type=server
            fi

            echo "BUILDING CODA (Will install files for client/server: $type)"

            cd coda; sh bootstrap.sh; ./configure --prefix=$PREFIX \
               --with-lwp=$PREFIX \
               --with-rpc2=$PREFIX \
               --with-rvm=$PREFIX && make && make ${type}-install; cd ..
    fi

    echo "ALL DONE. YOU ARE WONDERFUL!"

Notes regarding the script:

The script updates the CVS tree if it already exists, so it means you can also use this script to perform automatic Coda upgrades.

The whole build consists of modules lwp, rpc2, rvm and coda. To disable build of say, rpc2 and coda (if you already built them), invoke the script as ./coda_cvs.sh norpc2 nocoda.

The script can also be used to install the Coda server, simply use argument server on the command line. (But more on that on a separate Quick Server Action page.)

Perform Follow-up Operations

(Some of this might or not be needed, depending on how you installed the Coda client. If you can’t make an educated decision, perform all of the steps - they’ll do no harm).

On Linux, the following steps should be performed:

The following four lines only need to be executed once:

    echo "coda" >> /etc/modules
    ldconfig /usr/local/coda/lib
    venus-setup realm
    codaconfedit venus.conf kerneldevice `find /dev -name cfs0  | head -n 1`

The following line has to be executed for every shell. (So it is best to put it in some shell initialization file).

    export PATH="/usr/local/coda/sbin:/usr/local/coda/bin:$PATH"

On FreeBSD, the following steps should be performed once after installing the port or package:

Configure the kernel module to load every boot

    echo 'coda_load="YES"' >> /boot/loader.conf

Set up configuration files, initialize cache, and set default realm

    venus-setup <realm>

Run Coda Client

To start Coda client, simply run venus as superuser.

    Date: Sun 02/11/2007

    01:23:32 Coda Venus, version 6.9.5
    01:23:32 /usr/coda/LOG size is 2706432 bytes
    01:23:32 /usr/coda/DATA size is 10821456 bytes
    01:23:32 Loading RVM data
    01:23:32 Last init was Sun Feb 11 01:18:10 2007
    01:23:32 Last shutdown was dirty
    01:23:32 Starting RealmDB scan
    01:23:32        Found 1 realms
    01:23:32 starting VDB scan
    01:23:32        2 volume replicas
    01:23:32        0 replicated volumes
    01:23:32        0 CML entries allocated
    01:23:32        0 CML entries on free-list
    01:23:32 starting FSDB scan (4166, 100000) (25, 75, 4)
    01:23:32        1 cache files in table (0 blocks)
    01:23:32        4165 cache files on free-list
    01:23:32 starting HDB scan
    01:23:32        0 hdb entries in table
    01:23:32        0 hdb entries on free-list
    01:23:32 Mounting root volume...
    01:23:32 Venus starting...
    01:23:32 /coda now mounted.

We’re in business bigtime!

Note 1: if the last message you get is /coda already mounted, and accessing /coda fails, then you just need to first properly stop Venus (see “Shutdown Coda Client” below) and then start it again.

Note 2: if Venus doesn’t want to start (failing at “VDB scan” part), invoke it as venus -init.

Connect to the Test Server!

    $ cfs lv /coda/testserver.coda.cs.cmu.edu

    Status of volume 7f000000 (2130706432) named "/"
    Volume type is ReadWrite
    Connection State is Reachable
    Reintegration age: 0 sec, hogtime 1.000 sec
    Minimum quota is 0, maximum quota is unlimited
    Current blocks used are 389
    The partition has 19539680 blocks available out of 19593852

    $ cd /coda/testserver.coda.cs.cmu.edu/
    $ ls -al
    $ cat WELCOME
    $ cd playground

Authenticate with the Test Server (Obtain Write Access)

    $ clog guest@testserver.coda.cs.cmu.edu
      (PASSWORD 'guest')

    $ ctokens
    Tokens held by the Cache Manager for docelic:
        @testserver.coda.cs.cmu.edu
            Coda user id:    65534
            Expiration time: Mon Feb 12 02:31:12 2007

Explore Around

    $ ls -al
    $ echo 'IT WORKED!' >> QuickStart
    $ cfs la .

Shutdown Coda Client

To shut down the client, you might first want to “unlog”, then close down Venus server (coda client), and manually unmount /coda. (It is important to umount /coda on Linux after Venus server is terminated!)

    $ cunlog guest@testserver.coda.cs.cmu.edu

    # vutil --shutdown
    # umount /coda

Note: on FreeBSD, /coda would be automatically unmounted so the last step is not necessary.

Access Coda manual pages

If you’ve built Coda from source and installed it to /usr/local/coda, then the manual page viewer won’t be able to find manual pages in the default locations.

Therefore, you will have to run ls /usr/local/coda/share/man/*/ to see available manual pages and, to view specific man pages, run man program with full page path, such as man /usr/local/coda/share/man/man1/cfs.1.

Alternatively, you can modify your MANPATH environment variable to include /usr/local/coda/share/man/. For example,

    export MANPATH=$MANPATH:/usr/local/coda/share/man

Yet another solution is to take a look at the Integrating source-built Coda into the system page.

What to do next?

Well, hey! ;) Now that you’ve seen it quick and dirty, you may continue reading the rest of the documentation, or setting up your own Coda server following a similar quickstart guide, Quick Server Action.

Then optionally see the Integrating source-built Coda into the system page.

Have fun!


At its former host wikidev.net this page has been accessed 3654 times.


Last modified: Thu Jun 26 07:36:56 UTC 2014