AFS Course Space

From PrattWiki
Revision as of 15:08, 14 January 2014 by DukeEgr93 (talk | contribs)
Jump to navigation Jump to search

This page will describe the structure of the AFS shared spaces given to courses and will explain the process for setting up your account to use it.

Introduction

Prior to 2013, Duke's public computers used the Andrew File System to store files. This system allowed individuals to set seven different permissions to each folder within their space. Users could assign permissions to single users or to groups. While this system was extremely flexible, over time, support for it dwindled. In the Spring semester of 2013, Duke switched to CIFS as a file system. While this system has many positive features, it is entirely lacking in the ability to grant permissions to individual folders. It also does not allow for symbolic links. Given these drawbacks, and given the current lack of an alternate way for students and instructors to set up shared course spaces within CIFS, Duke is maintaining a section of AFS-hosted folders, specifically for courses.

Goals

The goals of using the AFS shared spaces are as follows:

  • Allow for file sharing from the instructor to all the students in a class
  • Allow the instructor and teaching assistants to access course-related files for students - this will facilitate both off-line assistance and grading

AFS Location

The AFS folders are all located at

/afs/acpub.duke.edu/courses/YEAR_SEMESTER/DEPARTMENT/CLASS

For example, the Spring 2014 offering of EGR 103L has a set of folders at

/afs/acpub.duke.edu/courses/2014_spring/egr/103l

Within the CLASS folder, there will be a folder for each section (for example, 002). For Dr. Gustafson's courses, however, students will not need to worry about the section folder, only the CLASS folder.

Personal AFS Folders

For Dr. Gustafson's classes, each student will have a folder within the CLASS folder. The folder will be the same as the student's NET ID. For example, in EGR 103L, a student with a NET ID of mrg would have a folder:

/afs/acpub.duke.edu/courses/2014_fall/egr/103l/mrg

If you find that you do not have a folder, be sure to check the directory. If you are in the correct directory and still do not have a folder, let Dr. G. know.

When these folders are created, permissions are set as follows:

  • system:administrators and mrg have all permissions
  • the student and the TAs have read, list, insert, delete, write, and lock permissions, but not administer permissions
  • no one else has any other permissions

Fortunately, whenever a new folder is created, it will take on the permissions of the folder in which it was created. In other words, as long as the student always first changes into the shared AFS space, everything created there can be seen by the student and the instruction team.

There is also a folder called public within the CLASS directory. For this folder,

  • system:administrators and mrg have all permissions
  • all students and TAs have read and list permissions

This way, files that students need to copy can be hosted in the shared space and all students can copy the file without any chance of accidentally (or intentionally) removing those files.

Shortcuts

One problem with the CIFS is that it will not allow symbolic links, or shortcuts, to folders. In other words, to get to the public space for EGR 103L, a person would have to type out

cd /afs/acpub.duke.edu/courses/2014_fall/egr/103l/public

every time (unless a path using .. were available).

To make life a little easier, you can either create a symbolic link to your directory or an alias that changes into your space within a particular class.

Creating a Symbolic Link

Creating a symbolic link basically places a "folder" in your home directory that is linked to the AFS folder you want to use. You can then use that link in exactly the same way you would use any other folder. The command to make a symbolic link is:

ln AFS_FOLDER -s LINK_NAME

For example, for user mrg to make a symbolic link from the /winhomes/mrg directory to the /afs/acpub.duke.edu/courses/2014_fall/egr/103l/mrg directory, that user might type

cd
ln /afs/acpub.duke.edu/courses/2014_fall/egr/103l/mrg -s EGR103

After running that command, there should be a "folder" called EGR103 inside the user's home directory. To switch into that folder, the user could just use the cd command:

cd EGR224

or, if not in the home directory to start with,

cd ~/EGR224

Creating an Alias

NOTE:THE SHORTCUTS DEPEND ON WHAT KIND OF SHELL YOU ARE USING. To check, type

echo $SHELL

in a terminal window. If your shell is /bin/bash, follow the first set of instructions; it it is /bin/tcsh, follow the second.

For /bin/bash (newer users)

To create a set of aliases, you will first need to make sure that the system checks a configuration file called .bashrc whenever you log in or make a terminal window. You will therefore need to create a file in your home directory called .bash_profile that contains the following:

# start .bash_profile
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi
# end .bash_profile

Type

emacs ~/.bash_profile

copy the above into it, then save that file. You should only ever have to do this once.

Next, you will add the aliases to the bash configuration file, called .bashrc. To do that, type:

emacs ~/.bashrc &

The file may be empty to start with or it may have some other items in it. Regardless, go to the very bottom of the .bashrc file and then add something like the following:

alias Go103='cd /afs/acpub.duke.edu/courses/2014_fall/egr/103l/NETID'

where NETID is your NET ID. For Dr. G's Spring 2014 courses, use the following:

  • EGR 103L
alias Go103='cd /afs/acpub.duke.edu/courses/2014_spr/egr/103l/NETID'
  • ECE 110L
alias Go110='cd /afs/acpub.duke.edu/courses/2014_spr/ece/110l/NETID'
  • EGR 224L
alias Go224='cd /afs/acpub.duke.edu/courses/2014_spr/egr/224l/NETID'
  • ME 344L
alias Go344='cd /afs/acpub.duke.edu/courses/2014_spr/me/344l/NETID'
  • ECE 382 (note - no "L")
alias Go382='cd /afs/acpub.duke.edu/courses/2014_spr/ece/382/NETID'

After you have added the appropriate line, save the file and close emacs. Then, on the command line, type

source ~/.bashrc

You will only need to do this once; .bashrc generally runs whenever a new window is opened and .bash_profile - which will run your .bashrc - runs whenever you log in, so from this point forward, the alias will exist. To make sure it worked, type the appropriate alias name and it should take you to your space within the shared CLASS directory.

From this point forward, whenever you need to do work for a particular class, just use the alias to get into the space and then work as usual.

For /bin/tcsh (older users)

To do that, type

emacs ~/.cshrc &

Go to the very bottom of the .cshrc file and then add something like the following:

alias Go103 'cd /afs/acpub.duke.edu/courses/2014_spr/egr/103l/NETID'

where NETID is your NET ID. For Dr. G's Spring 2014 courses, use the following:

  • EGR 103L
alias Go103 'cd /afs/acpub.duke.edu/courses/2014_spr/egr/103l/NETID'
  • ECE 110L
alias Go110 'cd /afs/acpub.duke.edu/courses/2014_spr/ece/110l/NETID'
  • EGR 224L
alias Go224 'cd /afs/acpub.duke.edu/courses/2014_spr/egr/224l/NETID'
  • ME 344L
alias Go344 'cd /afs/acpub.duke.edu/courses/2014_spr/me/344l/NETID'
  • ECE 382 (note - no "L")
alias Go382 'cd /afs/acpub.duke.edu/courses/2014_spr/ece/382/NETID'

After you have added the appropriate line, save the file and close emacs. Then, on the command line, type

source ~/.cshrc

You will only need to do this once; .cshrc generally runs whenever a new window is open, so from this point forward, the alias will exist. To make sure it worked, type the appropriate alias name and it should take you to your space within the shared CLASS directory.

From this point forward, whenever you need to do work for a particular class, just use the alias to get into the space and then work as usual.

Copying public files

Many times you will need to copy files from the public space into your own directory. For example, in EGR 103L, Lab 1 has several files you will need. Because symbolic links no longer work, you will just use .. to go up the directory structure the the CLASS folder, then down into the public folder. For example, if user mrg needs to get the Lab 1 files from the public directory and put them into mrg's own lab1 directory, that might be:

Go103

to get into the user's own egr/103l/mrg space, followed by

mkdir lab1

to make a folder for that assignment. Then

cd lab1

to get into the folder and, finally,

cp -i ../../public/lab1/* .

to go up two levels (the CLASS folder), then go into public and from there into public's lab1 folder. Don't forget the space and . at the end.

Transferring Files

The slightly odd location of the AFS space makes transferring files from a personal or lab computer over to the AFS space a little more complicated. The basic process is as follows:

  • Start a file transfer client. In the B209 lab, this means SSH Secure Shell's Secure File Transfer Client; the rest of the instructions are based on that program.
  • Click "Quick Connect"
    • In "Host Name," enter your favorite Teer machine
    • In "User Name," enter your NET ID
    • Click "Connect"
    • Enter your password when prompted
  • The window should now be divided in two sections - a Local section and a Remote section. At the top of the Remote section, there should be a white text entry area with a pulldown icon on the right. Click in that area and type
    /afs/acpub/courses/2013_fall/DEP/CRS/ID
    
    where DEP is the department of the course you are in (e.g. bme, cee, ece, egr, me), CRS is the course number - including the l (letter ell) if there is one, and ID is your NET ID. Hit return - this should take the remote view to your AFS course space
  • In the Remote section, click the new folder icon to add a new folder for the particular assignment; give the folder an appropriate name
  • In the Remote section, double-click the folder you just created. The Remote section should now have a window pointing to your (empty) folder.

You can now drag files in from either the Local section on the left of the SSH Secure File Transfer client, from the MATLAB "Current Directory" window, or from any other place you can click and drag an icon.

Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

References