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).
- AFS Primer
It would be good to skim it all, but you only need to really concentrate on the two sections titled,
"AFS File Permissions", and "The fs command".
- How to share files (We will be using a variation of
variation II from this web page.)
- AFS Quick Reference (just glance through this last one,
don't study or try to memorize it)
What to do
- 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.
- Create a subdirectory named lab2 in your lab directory (that you should have created during lab1).
- 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).
- 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.
- 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.
- 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).
- 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".
- To create the script file that you are to submit for this lab do the following:
- cd into your lab2 directory.
- Start recording with "
script lab2.txt".
- Type "
ls -l" to print a detailed listing of the contents of the directory.
- Type "
pwd" to print the full path of the current directory.
- Type "
fs la" to print the access setup for the directory.
- Type "
exit" to end the script recording.
- 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.