How to make space in your home dir
If you fall short on space, you need to (re)move some files. Here are some general tips to track the most space-consuming files. The space in
/user/connex is expensive due to the backup policy, so you need to be carefull when you write:
- Temporary data files generated by computations;
- Big PostScript files (at least you can compress them);
- Media files (videos, music, etc.)
- Big personal files not related to work…
The following tips were tested with the GNU version of the unix utilities. They are present in all Linux distributions, but you may experience some problems if you are using Solaris.
Other Disk Spaces
The disk space in
/user/connex is expensive because it is backed up every night and bakups are stored for two years. The first thing you can do is move your big files in other locations. For example:
- local hardisk(s) of your workstation. Keep in mind that, if you run computations on your station, the local disk acces is faster storage than remote disk access. You can have these backed up too, just ask Nicolas.
/user/spc(backed up, so choose carefully what you add there)
First, you can find your total disk usage, in the
/user/connex/disk_usage/ directory. The disk usage is computed each week. Look for the more recent file.
Then, the du utility allows you to scan your home for the big directories/files. For example, if you want to find big files/dirs in your
~/data dir, you can use:
falcone@pcfalcone$ du -sh ~/data/* 0 /user/connex/falcone/data/’%-10s 7.0M /user/connex/falcone/data/AAindex 656K /user/connex/falcone/data/allforam14-B-2002.mase 418K /user/connex/falcone/data/belin 570K /user/connex/falcone/data/cachat 24K /user/connex/falcone/data/distforams 2.2M /user/connex/falcone/data/granada98.ps 18K /user/connex/falcone/data/Librairie_22.03.04_A.xls 70K /user/connex/falcone/data/librairiePlaia 73M /user/connex/falcone/data/papers 24K /user/connex/falcone/data/paul_bookmarks.html 600K /user/connex/falcone/data/points.ps 7.1M /user/connex/falcone/data/renee 6.2M /user/connex/falcone/data/sequences
-s option stands for 'summary' and displays the total size of each items (sums the items in a dir). The
-h option stands for 'human readable' and displays the sizes in a convenient unit.
The config dirs and files in the home directory can be very space consuming, consider removing them for the software you do not use anymore. You can track them with the following command:
$ find ~ -maxdepth 1 -name ".*" | xargs du -sk | sort -n
It prints the config dirs, sorted by size. The size is displayed in kB.
Find Big And Old Files
Alternatively, the find utility allows to find big files. For example, to find all files bigger than 10 MB, run:
falcone@pcfalcone ~/data $ find ~ -size +10M -print /user/connex/falcone/cours/ia0102.tar.bz2 /user/connex/falcone/cours/ia0203.tar.bz2 ...
Find can search for old files too. For example, to search the files not modified in the last 2 years (730 days) and bigger than 1 MB, you can use:
falcone@pcfalcone ~/data $ find ~ -size +1M -mtime +730 -print /user/connex/falcone/public_html/poster/poster2.ps /user/connex/falcone/public_html/prez/OpDoFig1.tar /user/connex/falcone/public_html/prez/po.ps
Finally, you can scan your home for core files and remove them automatically with:
$ find ~ -name "core*" -type f -print | xargs /bin/rm -f
You can easily compress your data files with the very efficient bzip2 utility. For example, if you want to archive the
exp-2006-march/ directory, you can run:
$ tar -jcvf exp-2006-march.tbz2 exp-2006-march/
-j options makes the compression. To uncompress:
$ tar -jxvf exp-2006-march.tbz2
Move your FireFox/Mozilla Cache Directory
You can save space by moving the
mozilla cache directory to your local hard disk. Of course, this operation will improve the speed too.
There is no UI setting for this feature. Although the operation can seem a little bit tricky, it is very easy and safe:
- Choose a directory in your local hard disk (For example, I chose
- Type in the URL bar:
about:config, a page will appear with all your settings
- Right-click on any entry and choose in the pop-up menu:
New > String.
- A pop-up window will appear, type
browser.cache.disk.parent_directory, press OK.
- Another pop-up window will appear, type the location you chose.
- That's all ! Restart your browser and enjoy, you can now remove the old cache.
You can now have a greater cache size without consuming your precious disk quota. For further information: mozillazine.org.