File Space

Last update on Friday, 23-Mar-2007 13:40:45 CDT.

Allocation Areas & Quotas

There are three main directories or filesystems of importance that exist on the Altix. You are allocated a finite amount of diskspace on each.

Directory Quota Backed Up? Description
/home/userid 300MB Yes Upon login, you will be situated in /home/userid, where userid is your logon name. This directory can be referenced with the $HOME environment variable.
/scratch/userid 8GB No You are automatically granted an allocation of diskspace in the scratch directory.
/tmp
/var/tmp
/var/spool
100MB each No Various programs may write intermediary files in these directories Files older than 7 days are deleted automatically for /tmp and 28 days for /var/tmp.

Policies

Of the three filesystems mentioned above only your /home directory is backed up. Files can be restored upon request.

Extensions to your /home space will be strongly resisted beyond the standard allocation. The staff will consider increases to your /scratch space only for justifiably legitimate needs.

During batch job execution, if at all possible, avoid file transfers involving the tape archive or a remote host. Needed input files that are unavailable on cosmos should first be copied locally, say, to /scratch. These files can then be copied to a job's $TMPDIR using the standard 'cp' command. Large output files resulting from batch job execution should be handled similarly.

User files on any SC medium, disk or tape, must be be files that are directly relevant to your work on a SC system. Such files are the following:

  1. Input files to codes you run on an SC system;
  2. Output files resulting from runs on an SC system;
  3. Source files needed to construct executables that will run on a SC system;
  4. Executable files used on an SC system;
  5. Other binary and/or accessory files needed to run an application on a SC system

The saving of data files on cosmos that are unrelated to processing on it is NOT allowed. Users should also delete all files that are no longer needed. Please cooperate with the staff in this important task.

Common File Commands

Display disk space allotments: quota

% quota -v
Disk quotas for user aggie (uid 1234): 
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
/dev/xscsi/pci01.03.0-1/target1/lun0/part3
                      0    4096    8192               0    5000   10000        
/dev/lxvm/scratch
                      0  8388608 8388608              0   20000   30000        
/dev/lxvm/home    69664  300000  300000              24   20000   30000        
/dev/lxvm/tmp         0  100000  100000               0   20000   30000        
/dev/lxvm/var_tmp
                      0  100000  100000               0   20000   30000        
/dev/lxvm/var_spool
                      0  100000  100000               1   20000   30000

The four leftmost columns indicate the filesystem, blocks used, quota, and upper limit. The system will prevent you from writing files beyond your upper limit. Numerical amounts of disk space are given in kilobytes.

Display files and directories: ls

% ls -l      
total 464
drwx------    2 aggie  user           18 May 26 11:03 dira
drwx------    2 aggie  user           30 May 26 11:03 dirb
drwx------    2 aggie  user           18 May 26 11:20 dirc
drwx------    2 aggie  user           18 May 26 11:26 dird
-rw-------    1 aggie  user        43008 May 26 10:56 filea
-rw-------    1 aggie  user        57344 May 26 10:56 fileb
-rw-------    1 aggie  user       353280 May 26 10:56 filec

Sizes are given in bytes. The -a option lists files preceded by a dot. Consult the ls man page for more information about the ls command..

Recursively display disk usage for directories: du

% du -k
32      ./.ssh
48      ./dira
416     ./dirb
23      ./dirc
45      ./dird
69      .
69      total

This indicates the amount of disk space used for each directory including the current working directory. Consult the du man page for more information about the du command.

Locate files in a directory tree: find

Files can be searched according to a variety of conditions. Options that are most commonly used are -name and -size. The full list is given in the find man page.

% find . -size +5000k
./dira/core
./dirc/filed
./dird/filee
./core

In this example, we are searching for files that are greater than 5 megabytes. Consult the find man page for more information about the find command.

Protection & File Security

File security in unix involves three different catagories of users. Files and directories may be owned by user, group and other. Each of class of user can possess read, write, and execute permissions. Permissions for a particular file are listed with the 'ls -al' command.

% ls -al
drwx------    7 aggie  user        16384 May 26 13:34 .
drwxr-xr-x   29 root   root        16384 May 21 12:22 ..
drwx------    2 aggie  user           29 May 26 12:21 dira
-rw-rw----    1 aggie  user        43008 May 26 10:56 filea
-rw----rw-    1 aggie  user        57344 May 26 10:56 fileb
-rw-------    1 aggie  user       353280 May 26 10:56 filec
-rwx------    1 aggie  user        23552 May 26 13:34 script
-rw-------    1 aggie  user         3072 May 26 14:24 scriptb

The left column indicates what class of user and what kind of permission belongs to a file. The first field indicates whether or not it is a directory. The next three indicate permissions for the user class. Three more indicate permissions for the group class and the last three highlight permissions for all others.

As an illustrated example, we see that 'dira' is a directory that has read, write, and execute permissions available to user 'aggie'. Execute permissions for directories permit traversal for that class of user.

'filea' has read and write permissions for the user 'aggie' and the group 'user'.

'fileb' has read and write permissions for the user 'aggie' and all other users not in the group user. This is undesirable if 'fileb' is intended to be a private file.

Notice that the current directory, as indicated by the single dot, has full permissions for aggie and no other. If this is aggie's home directory then no other user would be allowed to view the directory contents. Under normal circumstances, modifications to the default home directory permissions are not needed.

Alters permissions to files and directories: chmod

The chmod command adds or removes specified permissions for any of the three classes of users.

% ls -l fileb
-rw----rw-    1 aggie  user        57344 May 26 10:56 fileb
% chmod o-rw fileb
% ls -l fileb
-rw-------    1 aggie  user        57344 May 26 10:56 fileb

Here we have revoked read and write permissions for all other users not in the group 'user'.

% ls -l scriptb
-rw-------    1 aggie  user         3072 May 26 14:24 scriptb
% chmod u+x scriptb
% ls -l scriptb
-rwx------    1 aggie  user         3072 May 26 14:24 scriptb

'aggie' has now applied user execute permissions to the file 'scriptb'. Consult the chmod man page for more information about the chmod command.

Additional Information

All of the commands outlined above are described in detail in on-line manual pages. To call up the manual page for the 'find' command simply type at the command prompt:

% man find

An introduction to UNIX commands can be found here.