CSE 265: System and Network Administration

Lab #10

Today we continue with network file services, but first consider linux kernel modules.

  1. Exploring Kernel Modules

    There are four methods of modifying the configuration of a kernel: modify tunable kernel parameters; provide kernel parameters at boot time; compile the kernel from scratch; and load new drivers and modules on the fly into an existing kernel. The latter is the approach that we explore today.

    Loadable kernel modules are stored under /lib/modules/version where version is the version of your Linux kernel. Recall that uname -a will tell you which kernel you are currently running. The kernel on your RH/Fedora systems has been upgraded (leaving the old one in place) and so there will likely be multiple kernel versions. Take a look through the various subdirectories to see what modules (.ko files) are there.

    Find the vfat module, which is the driver for the Windows FAT filesystem with NT long name support. What type of device do you think the rio500 module supports? Recall that the find command can help you find the rio500.ko file, with a find . -name "*rio500.ko" -print

    The /sbin/lsmod command is used to list the currently loaded modules. Run it to see the modules loaded on your system.

    The /sbin/insmod command is used to load a kernel module. Try loading the dummy device. Can you guess what it does? How do you know that it has been loaded? Is it being used?

    The /sbin/rmmod command is used to unload a kernel module. Unload the dummy module. How do you know that it is no longer loaded? Can you unload the raid5 module?

    Now load the msdos module. You'll get an error about unresolved symbols. This is because the msmod module has dependencies on another module, and can't be loaded until all dependencies are satisfied. To find out what symbols are a problem, run dmesg piped to tail. Look at the common prefix for each of the unresolved symbols. Go ahead and load the missing module first, and then load the msdos module next. What does the "msdos" mean in the fat line of lsmod output?

    Now unload the two modules you just added, but unload msdos last. Do you understand the error message you got? Now unload them in the correct order.

    Many modules are loaded automatically when they are needed, rather than only after being loaded manually as we have been doing so far. However, in order to load certain modules, it is important to know what modules it depends on. That information is stored in a modules dependency file called modules.dep. You can find it in the modules directory for your kernel. If you grep for msdos, you'll see the dependency that you discovered above.

    There is another utility that can automatically resolve module dependencies. It is called modprobe. It can be used to load the msdos module (along with any dependencies).

    This time use modprobe to load the dos module. Run lsmod to see which modules are listed. Is there a dos module? What was loaded instead? The command modprobe -c | grep dos will help you understand what is going on.

    Aliases are defined in /etc/modprobe.conf, where you will see that eth0 and eth1 are just aliases for the modules that know how to use the ethernet ports.

  2. Installing AFS client on a Linux Machine

    1. OpenAFS is not in the usual RPM repositories, which means you cannot use yum for installation. Instead, you can download source and binaries for many distributions (including RHEL 5.1, which is compatible with our CentOS) at [openafs.org]. You'll need to get current versions of
      • openafs (Utilities, Init scripts, and documentation)
      • openafs-client (AFS daemon, PAM modules, client configuration files)
      • kmod-openafs (the one that matches your kernel installation since modules need to match the kernel).
      Download all three and use rpm to install them.
    2. Edit /usr/vice/etc/CellServDB.dist
      You should add the following:
          
      >cc.lehigh.edu          #lehigh university
          128.180.39.25           #fs2.cc.lehigh.edu
          128.180.2.13            #fs3.cc.lehigh.edu
          128.180.2.10            #fs4.cc.lehigh.edu
          128.180.2.11            #fs5.cc.lehigh.edu
      
    3. edit /usr/vice/etc/ThisCell
      It should only have one line:
        cc.lehigh.edu
    4. see that you have directory /afs. It should have been created when we installed openafs RPMs.
    5. To start the client do
      /etc/init.d/openafs-client start
      This may take a little while.
    6. You should now be able to see /afs/cc.lehigh.edu and different sub-directories therein.
    7. When the openafs-client service is running, you'll also be able to see that openafs is loaded as a kernel module.

  3. Note joy of using RHEL/CentOS

    If you are running an unsupported kernel (such as a Fedora kernel), you need to build the kernel module yourself. To see what kind of work that is, look at this lab from 2006 and see Parts I, II, and III.
  4. Using AFS

    Lehigh's afs provides a lot of commercial software like matlab, maple, mathematica. For our linux machines these are located in /afs/cc.lehigh.edu/common/i386_linux26/bin. You can also see your own lehigh folder in /afs/cc.lehigh.edu/home/<your lehigh id> and also your webpage in www-data in your Lehigh-home directory. Note that you wont be able to read/execute your files. You have to log-in to do so.
    1. Install old X-windows libraries for compatibility with matlab.
      yum install xorg-x11-deprecated-libs
    2. switch back to a normal user.
    3. klog lehigh-id
      This attempts to acquire an AFS token for your lehigh-id so that you can access your files. Enter your Lehigh password.
    4. Try running matlab from the afs partition.
      cd /afs/cc.lehigh.edu/common/i386_linux24/bin
      ./matlab

      or
      ./matlab -nojvm -nosplash for non-graphical interface.
    5. Use klist to see who all have valid login tokens for afs directory. Use mount -l to see if AFS is shown as mounted.
    6. See where you have write access in /afs.

In order to sign the lab completion sheet, you will need to:

  1. show me that you have full access to your AFS file system


This page can be reached from http://www.cse.lehigh.edu/~brian/course/2008/sysadmin/labs/
Last revised: 26 March 2008.