Quotas
Student accounts in the Computer Science Department are to aid students in completing CS Department coursework. Other activities which may advance a student's education but do not relate directly to current coursework are of secondary importance. Activities which do not advance a students education in the CS department are not to be participated in using CS department resources. These include word processing, game playing, downloading multimedia, commercial endeavors, or participating in any illegal, hateful, or offensive practices. Policies relating to CS Department computers and accounts must reflect the fact that the Department needs to effectively allocate its resources and maintain the security of its network. We reserve the right to delete or seize any files which we consider inappropriate or unnecessary on the Computer Science Department Network File server. This includes MP3s, multimedia files, copyrighted material, and any other files which are not necessary for your current semester's coursework.
Disk Quotas
Disk Quotas are limits on how much server space a single user can control. This prevents a single user from taking more than his or her share of system resources. Disk space is a limited resource and by placing limits on server disk space we hope to maintain enough server space for all of our system's needs.
Your disk usage which counts against the quota is calculated by totaling the space used by all files owned by you that are stored on the file server. This number should generally be the same as the sum of all the files in your home directory. Your quota limit is determined by your status in the Computer Science Department:
Guest: 200MB (Anyone taking a CS class who is not a UGrad or Grad) UGrad: 300MB (An officially declared CS undergraduate student) Grad: 500MB (A graduate student in the Computer Science Program)
To determine which group you are in, type id at a Linux terminal. id returns the user (uid) and group (gid) ownership settings for your files. The gid is your status on the CS Department network. Another way to determine your status is by the location of your home directory. Type pwd from your home directory to see the location of your directory on the server. If you are incorrectly classified, please see the System Programmers.
What Happens When I Go Over Quota?
There are two types of quota limits: hard and soft limits. Your official quota is your soft limit. When you exceed your soft limit you get a seven day grace period before your account gets locked. After those seven days you can not save to your network disk space. In Windows that means that you can not save to the F: drive. In Linux that means that you can not log into a window manager. Should this happen, you can either free up account space using the Windows machines or you will have to log onto the Linux machines using the text console (using ctrl-alt-F2 or ctrl-alt-F3) and free up some space. Should you use a Linux text console, remember to return it to graphical mode (ctrl-alt-F7 or ctrl-alt-F8) when you are finished. You should not be able to save a file that will put you over your hard limit. The hard limits are Guest: 250MB, UGrad: 375MB, and Grad: 625MB.
How do I Stay Below Quota?
The best way to stay below quota is to delete old files. Your account should enable you to complete your coursework for the current semester. You should save old coursework to a flash drive, available at the bookstore in various sizes.
What Can I Delete from My Account?
A good place to start is by cleaning out your .Trash and Desktop directories. You should delete any core dump files. Also make sure to empty your Konqueror, Mozilla, and Netscape cache. Windows users should clean off their desktops and empty the Internet Explorer Cache.
I Accidentally Deleted My Files. Can I Get Them Back?
No. The Computer Science Network backup is only used to restore from a catastrophic emergency. It is impractical and unreasonable to take our backup off-line to restore a single user's files. The System Programmers can not do it for you. Don't ask. You are advised, admonished, and warned to make backups of your data on a flash drive or in some secondary location. Do not rely exclusively on the CS Network.
Still Over Quota
Many students create their accounts as guests in the CS program, later declare their intent to major in Computer Science, but never have their status on the network changed. If you are incorrectly classified then come see the System Programmers in 1140TMCB.
Often files that you submit as part of coursework in your classes remain owned by you. These files stay on the network and continue to count against your quota. If these files are large they can significantly affect your available server space. If you need more space and suspect that files you have submitted as coursework are counting against you, then see the System Programmers in 1140TMCB and we will change the ownership of those files.
If you are having other problems with your quota, please double check that you are classified correctly on the network, that you really are taking up less disk space than your quota limit, and that you have deleted all unnecessary files. Then see the System Programmers in 1140TMCB.
How Can I Use Large Temporary or Test Files?
You can save large temporary files for testing purposes on the local drive of the workstation you are using. For Linux use /tmp and for Windows use C:/temp. Remember: this is public space, it does not belong to your account, and will not follow you to other workstations. It might be deleted if more space is needed on the hard drive. Be careful not to fill up the hard drive of the Linux workstations. You can check local disk space using df -h and seeing how much free space is on the partition mounted on / (in our labs it is usually /dev/sda3). Please delete your temporary files when you are done with them.
Account Maintenance in Windows
Most of your account maintenance can be done in Windows Explorer found in the Start Menu under Programs->Accessories.
Determining Disk Usage
Because Windows does not correctly read file sizes from the Samba server, Windows Explorer has some difficulties calculating your network disk usage. Any disk space symbolically linked to your account (your F: drive) will be reported in the disk usage totals. Even if you do not have any symbolic links in your directory Windows still may be confused and report incorrect network disk space usage.
The best way to get an accurate total of your quota usage is to SSH to a Linux workstation (see Remote Login doc) and check run the command:
quota <username>
Where the output reports blocks shows the number of kilobytes you are using on the network. Once you have determined your quota usage you can use Windows Explorer to manage your files.
Selecting Multiple Files
There are two ways to select multiple files with Windows Explorer. If you hold down the Shift key while you click on two files, it will select both those files and all the files listed between them. If you hold down the Ctrl key while selecting two files, it will only select those two files. You can select as many files as you want with either of these methods, or with any combination of these methods. Selecting a selected file deselects it.
Deleting, Moving, and Copying Files
To delete files with Windows Explorer you should find the files you want to delete and select them. You can then delete them either using the Delete key or by right clicking on the file and selecting delete.
Windows explorer allows you to move or copy a file by dragging it and dropping it in the desired location. If you simply drag a file from one location to another on the same drive, Windows Explorer will move that file. If you hold down the Ctrl key while you drag the file, then Windows Explorer will copy that file. Windows Explorer will also copy a file if you drag it to a different drive. You know when Windows Explorer will copy a file because it displays a small plus sign "+" next to the file being dragged.
Creating Shortcuts, Folders, and Renaming Files
Holding down the Alt key will create a shortcut to the file you are dragging. You can also create a shortcut through the menus in Windows Explorer. Click on File->New->Shortcut and give the wizard the relevant information. The Browse button allows you to step through the directory tree to find the file you want to create a shortcut for.
Creating new folders is done through the File->New->Folder menu option. This will create a folder in the open directory called "New Folder" and it will highlight the name of the folder. The new folder is created with its name highlighted, so you can put in a new name if you want it called something else. You can change the name of any folder or file by right clicking on the folder or file and selecting Rename. The name will then be highlighted and typing will overwrite the old name. Hit enter or select another file or folder when you are done.
Compressing Files
PowerArchiver is installed on all the windows machines in the openlabs. It is a graphical tool for compressing and decompressing files. It claims to be compatible with most methods of compression including tar, bzip2, gzip, etc. By default it uses PKZip which is the standard DOS file compression. You can get a free fully featured evaluation copy of PowerArchiver from [http://www.powerarchiver.com/download/ their website]. PowerArchiver is a very powerful utility that allows one to create self-extracting files and basic installation scripts. This document will only discuss how to use PowerArchiver to do basic compression and decompression.
To compress a file or directory with PowerArchiver click on the New button on the tool bar or select New Archive from the file menu. Go to the directory where you would like the compressed file to reside and type in the desired filename, then click Save. The Add window should appear allowing you to list the files that you would like compressed. Simply highlight the files that you want in your archive and click Add. You can always Add additional files later if you choose. Once you have added some files to your archive, PowerArchive displays the list of files in your archive and allows you to do things like Add new files or Delete (remove) files from your archive. The Extract button allows you to decompress a file into a specific location. When you add a file to an archive PowerArchiver does not delete the original file, so to save space you need to remember to delete the uncompressed file when you are done. Also, when you extract a file PowerArchiver does not remove it from the archive.
To uncompress a file or directory in windows you can just click on the file in Windows Explorer and the PowerArchiver should automatically open. You can then click on Extract and specify a location you want the files extracted into. Another way to decompress files is to open PowerArchiver and click on the Open toolbar button or go to Open Archive in the File menu, then select the file you want to examine. PowerArchiver allows you to decompress just selected files from an archive or view text files without decompressing them.
For more information about PowerArchiver try reading the Brief Tutorial under the help menu, or consulting the online help.
Account Maintanence in Linux
Though most of your account maintance can be performed graphically within your window manager of choice (Gnome, KDE, Windowmaker, etc), we will describe how to perform most of these functions from the terminal prompt.
Determining Disk Usage
The best way to get an accurate total of your quota usage is to run the quota script:
quota <username>
Where the output reports blocks shows the number of kilobytes you are using on the network.
The shell command du is a very useful way to check your disk usage. The basic command is:
du -hs
from your home directory. The -h displays the usage values in human readable form, i.e. with a K for kilobytes or an M for megabytes. Including the -s option will present a summary of the total usage, rather than giving you the size of each individual file and subdirectory. To find out more about du or to explore other exciting du options try using the man du command.
grep is a very useful command to use with du. grep searches through its input for the provided search string and outputs the lines of input which contain the string. You can input into grep the output of du using the pipe '|'. For example:
du -h | grep csproject
will return the sizes of directories and files containing the word "csproject."
To just see the listing of what's using a large amounts of disk space:
du -h | grep M
will return all the lines that have "M" in it (megabytes)
Deleting Files, Copying Files, and Creating Directories
Deleting files in Linux is done with the rm (remove) command. Be very careful with this command. You can remove multiple files with wildcards like *, ?, and regular expressions. Make sure that you know exactly what files you will be deleting with your expression:
rm <file>
- -r (recursive) -- removes all sub directories in the current directory, and their contents. This option is very '''dangerous'''.
- -i (interactive) -- prompt before removing each file. A good, safe thing to do.
- -f (force) -- do not prompt before removing files. Caution is warranted.
- -v (vebose) -- list each file that is removed. This can be very helpful. Hit Ctrl-c very quickly as soon as you notice a directory that you need being deleted.
The rm expression will not delete directories without the -r option. You can remove empty directories using the rmdir command. The safest way to remove a number of directories is to remove all of the files in each directory, then rmdir the directory. That should help you avoid accidentally deleting something important.
You can copy files using the cp command. The basic syntax is:
cp <source> <destination>
- -r (recursive) -- copies the directory and all sub directories to the destination. Preserves directory structure.
- -v (verbose) -- lists each file that is copied.
- -p (preserve) -- preserves file attributes.
cp will not copy directories without the -r command.
You can make new directories with mkdir.
Compressing Files
The standard Linux compression utility is gzip. The command gzip compresses a single file and appends .gz to the end of the filename. Files compressed with gzip are uncompressed with the gunzip command. For example, to compress <myfile> use gzip <myfile> which yields <myfile>.gz. To uncompress <myfile>.gz use gunzip <myfile>.gz to get <myfile>. gzip preserves access and modification times.
- -r (recurse) individually compresses or decompress each file in each subdirectory.
- -h (help) lists options for gzip or gunzip.
- -l (list) report compression statistics for file
gzip and gunzip only compress one file at a time. To combine a directory of files into a single file for compression you should use tar. tar is a utility for managing backup archives.
The command:
tar -cf <outfile>.tar <indirectory>
creates an archive of name <outfile>.tar from the directory <indirectory>. -c (create) makes a new archive and -f (file) specifies that the output should be a file (rather than the console):
tar -xf <outfile>.tar
De-archives the tar file to output the original directory with the original filenames. -x (extract) tells tar to de-archive, and -f (file) specifies that the input comes from a file.
An especially important command with tar is -z which uses gzip to compress the tar archive. Should you want to compress an entire directory <mydir> the syntax would be:
tar -czf <outfile>.tar <mydir>
which would produce <outfile>.tar in the same directory as <mydir>. If you wanted to, you could now delete <mydir> and leave only the compressed version <outfile>.tar. When you want to read <outfile>.tar again you should use the command:
tar -xzf <outfile>.tar
which would create <mydir> again, allowing you to delete <outfile>.tar.
- -v (verbose) outputs to console each action that takes place.
- -t (list) lists the files in the archive.
- -tv (list verbose) gives the same information as ls -l about the files in the archive.
- -A (concatenate) appends tar files to an archive.
- -r (append) appends input to the end of an archive.
There is also a zip and unzip utility that reads DOS PKZip files (PowerArchiver uses PKZip by default). The command:
zip -r <outfile>.zip <indir>
-r tells zip to recursively zip the directoryto create .zip:
unzip <outfile>.zip
unzips <outfile>.zip to create <indir>. zip and unzip have a lot of other options aswell.
bzip2 is another compression utility. The syntax is:
bzip2 <infile>
to compress yielding .bz2. To decompress the syntax is:
bzip2 -d <infile>.bz2
For more information you should refer to the man pages for gzip, tar, zip and bzip2.
Using Kdirstat
kdirstat is an excellent graphical tool for performing most of your account maintenance. You can run the utility by typing kdirstat from the command line. Once it is open it allows you to select a directory to analyze. If you click on a directory in the Open Directory window you will see its contents. Once you are displaying the contents of your desired directory then click okay to analyze that directory. By default it should bedisplaying the contents of your home directory and you can just click okay.
kdirstat displays the relative sizes of each subdirectory as a percentage of the size of that directory. Files are displayed separately from subdirectories in the "<Files>" folder of the directory where they reside. kdirstat allows you to delete a file or directory permanently, move it to the trash bin for a safer delete (it will still count against your quota), or compress a file or directory. If you compress a directory then the compressed file will appear in the "<Files>" folder of the directory tree. By default, kdirstat uses bzip2 compression and does not have the ability to decompress files, so you will need to decompress them using bzip2 -d and tar (refer to the instructions above).