Lab2 AFS

This lab will familiarize you with some basic AFS commands. AFS is the file system that allows you to "see" the same files when logged into any of the lab solaris/unix machines or unix.ic.ucsc.edu. You will also set the permissions on your hw1 directory so that both you and your partner can access it.

Preparation

Before coming to lab you should have read the following and completed the online review questions (in the format of a WebCT quiz).

What to do

  1. For this lab you will need to work with a partner. If you have not yet selected a partner for the programming assignments, then just work with whoever ends up in one of the workstations next to you. If you need help getting a partner (e.g. students on both sides are already partnered), ask the TA for assistance.
  2. Create a subdirectory named lab2 in your lab directory (that you should have created during lab1).
  3. Give your partner lookup, read, write, and insert access to the lab2 directory. Note that "fs sa somedir someuser write" gives MORE than write access and is not what you should be using (see the section "The fs command" in the afs primer that was part of the preparation for this lab).
  4. If you and your partner are working on one computer today (as you should when programming in the future for this class), have the partner that did NOT login to the workstation, login to unix.ic using ssh from a console window. They do that by typing "ssh partnerName@unix.ic". You should now have at least two terminal/console windows open, one for you and one for your partner.
  5. Test the access setup for your lab2 directory by having your partner (from their computer or a console window logged in as them), create a file in the directory, and modify an existing file in the directory that you create. You can create a file using any editor. Try "pico" if you don't already know some other unix editor.
  6. Have your partner attempt to delete a file from your lab2 directory, this should fail. The command to delete a file is "rm" (short for remove).
  7. Document that you have completed the above using "script". script is a program that records a terminal session in a file. You start recording by typing "script filename" or just "script" which will put the session into the default file "typescript". When you are done recording type "exit". You can review the contents of the recording by opening the file with an editor or just dumping it with "more filename".
  8. To create the script file that you are to submit for this lab do the following:
    1. cd into your lab2 directory.
    2. Start recording with "script lab2.txt".
    3. Type "ls -l" to print a detailed listing of the contents of the directory.
    4. Type "pwd" to print the full path of the current directory.
    5. Type "fs la" to print the access setup for the directory.
    6. Type "exit" to end the script recording.
  9. Be sure and submit the resulting "lab2.txt" file using WebCT. Both you and your partner need to submit the file. You should BOTH have created a lab directory with a lab2 subdirectory.