======Disk Quotas====== A **disk quota** is a limit for the amount of disk space consumed by a user. All EECS student accounts have disk quotas. This document explains the current quota limits, how to check your disk usage, and how to reduce your disk usage. ^ Group ^ Limit ^ | Faculty and Staff | none | | Current Students | 20GB | =====Checking Disk Usage===== To check your current disk usage, log onto a EECS Linux system and run the quota command. Here is some example output: ~> quota -s Disk quotas for user netid (uid #####): Filesystem space quota limit grace files quota limit grace fs1.eecs.utk.edu:/export/home/system/0/mctest 3484K 5120M 6400M 188 0 0 Important fields: * **space** - current disk usage (in KB) * **quota** - soft quota; if you have reached this, you have seven days to bring your usage back down below it * **limit** - hard quota; if you have reached this, you will not be able to write anything else to the disk * **grace** - time remaining for you to bring your usage back down below your quota; otherwise, you will be unable to write anything else to the disk If you go above your disk quota, you will get a message like the one below: cmd: writing to 'XXXXXX': Disk quota exceeded An account can be in one of three states: - **Under quota:** Your disk usage is in good shape. - **Between quota and limit:** You have a certain number of days left (timeleft) to bring your usage back down below your quota; otherwise, you will no longer be able to save anything or write anything to your home area. - **Over limit:** You will be unable to write or save anything to your home area. You must get back down below your quota to do so. =====Reducing Disk Usage===== ====Finding Where Space Is Used==== To get your disk usage down you will need to delete some of the files in your home area. To find out which of your files are taking up the most space run the following command: du -sk * .?* | sort -n **Explanation:** ''du'' is the disk usage command, and the s and k options stand for “summarize” and “show number of kilobytes” respectively. The next two arguments indicate what files to examine – in this case all files (*) and all dotfiles (.?*). The output from du will be sorted numerically. The above command should produce output like this: 884 www-home 1964 .adobe 1996 .openoffice 2028 .mozilla 2496 .phoenix 12864 stuff 13776 projects 34400 ntprofile Each line shows the space (in KB) occupied by the given file or directory. (Ignore the . and .. entries if they are listed.) For example, in the above output the ntprofile directory is occupying 34400 KB, or approximately 34 MB. Alternatively, you can run the following command to display the size of your files in a more human-readable way. du -sh * .?* | sort -n The above command should produce output like this (note that sort -n does not differentiate between K, M, G, etc.): 1.9M .adobe 1.9M .openoffice 2.0M .mozilla 2.4M .phoenix 12.8M stuff 13.7M projects 34.4M ntprofile 884K www-home To find out how much disk space your entire home area is occupying, run the following command: du -sh ~ ====Removing Files==== There are several types of unneeded files that occupy disk space: cached Web pages, object files, and infrequently accessed files. ===Web Browser Cache=== The Web browser cache contains local copies of all the Web pages you have visited. The cache is typically located in ~/.mozilla/userprofile/XXXXXXXX.slt/Cache. The files in this directory can be safely removed. (XXXXXXXX will be a random string of characters). To minimize the amount of cached content, set the cache size in your Web browser preferences to a smaller amount – such as 5 MB – rather than the typical default of 50 MB. ===Object Files=== Object files are created as part of the compilation process for C/C++ applications. These files can occupy large amounts of disk space, but are not necessary once you are done compiling the program. Also, “core” files that are created when a program crashes can be rather large, and may not be particularly useful. To locate such files, use the find command. find ~ -name '*.o' find ~ -name 'core' The first command lists all files whose name ends in “.o”. The second command lists all files whose name is “core”. Look at the list of these files and determine if any of them can be deleted. ===Infrequently Accessed Files=== Another way of reducing your disk usage is to compress files that you do not use very often. For an example, suppose you took CS 360 and have a directory with all the files used for that class. You may want to access these files in the future, but do not need to access them every day. You can compress these files to save space. Suppose your CS 360 files are stored in ~/cs360. To compress your files, run the following commands: cd tar -cvfz cs360.tgz cs360/* This would compress all of the files and subdirectories in the ~/cs360 directory, and store the compressed files in an archive named cs360.tgz. Now you can delete the contents of the ~/cs360 directory. When you need to access the contents of the archive in the future, run the following command: tar -xvfz cs360.tgz This will decompress and extract the files from cs360.tgz and create (if it doesn’t already exist) a cs360 directory with all the extracted files. The archive cs360.tgz will not be affected by the extraction, so you should delete the cs360 directory once you are finished using the extracted files. Consider deleting unused files from your home drive or copying them to external media such as USB thumb drives. ===Deleting the Trash in Gnome=== As Gnome is the default desktop for our machines, it's important to remember to empty the trash periodically. To do this in the default Gnome session, simply open up an file browser window (e.g. in the top task bar menus, go to Places → Home Folder), then the Trash folder should show up in the left navigation pane. Right-click on the Trash folder and select “Empty Trash.”