Conserving disk space

     
1. Organize your files by topic in a tree-structured directory. The exercise of simply re-organizing your files into directories and subdirectories can really help save disk space, because it often points out lots of files that you really don't need. This should be your first step.


2. Get a listing of disk space taken up (in kilobytes) by your files and directories by typing

du -k
Often, most of your space is taken up by a few directories.

It is also useful to check your disk quota by typing

quota

The output shown in 1kb blocks should never exceed the quota.

On linux, you can also use System Tools --> Disk Usage Analyzer to get an interactive ring chart showing which directories are taking up the most space. Usually it is one or two directories taking up the most space.

In the example, you can see the space used my selecting the .mozilla directory and then mousing over different rings in the ring graph. We see here that just emptying Mozilla (eg. Firefox) cache would free up about 309 Mb.




3. Empty your trashcan. If you delete items using the File manager, all the file manager does is to move them to a directory called Trash.  They still take up disk space until you go to the trashcan and choose 'Empty trash'. 

4. Delete unneeded files from your mailbox.

5. Clear your Web browser caches.  Web browsers such as Firefox or Seamonkey save the contents of web pages (eg. HTML, graphics, Java applets) in various cache directories so that they don't have to be downloaded each time you return to a previously-visited web page. These cache files can take up an enormous amount of space.  You can clear this space in the Preferences menu. Choose Edit --> Preferences --> Advanced --> Cache.

6. Delete all 'core' files. These are created when a program crashes, take up a lot of space, and are generally of no use to you.

7. Graphics files are the biggest space hog.
8. LibreOffice Draw, and probably some other programs, automatically creates backup files (.bak). After you exit the program, these files can be deleted.

BioLegato creates temporary files and directories with names like 'bioxxxxxxxxxx.tmp'. These can also be deleted if BioLegato is not running. However, if BioLegato is running a long job in the background (eg. a long multiple sequence alignment, phylogeny construction, or database search) it will usually create temporary files and directories that are needed during execution.  
 
9. If you have files that you are unlikely to need again, but want to keep, download them to a USB drive or other media.
 
10. If you have files or directories that are very seldom used, but you want to keep on the system, they can be compressed using 'tar'. For example, to compress a directory structure where the top directory is 'sample' type
tar cvpf sample.tar sample
This will create a tar archive, which can now be compressed by typing
gzip sample.tar
'sample.tar' will be replaced with the smaller 'sample.tar.gz'.
Now, you can delete the original directory by typing

/usr/bin/rm -r sample
When you want to recreate this directory do the following:
gunzip sample.tar.gz      {uncompresses the file}

tar xvpf sample.tar           {recreates the sample
                              directory, and all the
                              files and directories 
                              within it.}

If you need temporary disk space

Some systems also have a directory called /usr/local/tmp that is mounted to all servers on the system. /usr/local/tmp provides temporary disk space regardless of which host your are logged into. Usually, you can create a directory named after your userid in /usr/local/tmp, and set permissions so that you are the only one who has read write and search permissions. Depending on the system, files will probably be deleted after a certain time eg. 24 hr. Therefore,
you shoudn't use /usr/local/tmp for long-running jobs.
 

If you are already over quota, you may not even be able to move items to the trash can. You can remove any file by typing
 
rm filename

or you can delete a whole directory, and all subdirectories and files, by typing
 
rm -rf  directoryname 



Return to BIRCH home page

SUGGESTIONS for topics to be added to this list are welcome! Send email to psgendb@cc.umanitoba.ca