Search Docs by Keyword
Home directory full
If you receive an error that your home directory is full (“no space left on device [your home directory path]”) or an email saying you are over your 100GB home directory quota (and a 95G soft quota that triggers notifications), you will need to remove files to get back under quota. Ordinarily you would just use rm
to remove some files and reduce your usage.
However, a situation may arise where you are not at quota but over quota and when trying to remove files using rm
, you receive the error
rm: cannot remove ‘{somefilename}’: No space left on device
NOTE: Any time you are deleting files, it is important that you check to ensure you enter the correct filename. A good rule of thumb is to use the full path to a file (instead of relative path) or cd to the directory containing the file first. Also, be extra cautious when using wildcards like * .
WORKAROUND
A workaround is to identify some larger file(s) to remove and to reduce that file(s) size to zero bytes. Once enough space is recovered to get you under quota, you should be able to use rm
again. To do this on files you’ve identified for removal, use the truncate command:
truncate -s 0 FILENAME
To truncate a single file down to zero bytes.
or
truncate -s 0 FILE1 FILE2 FILE3
To truncate multiple files down to zero bytes
Example:
truncate -s 0 ~/Jobfiles/August/job12653287.out
It’s always safer to use the full path to a file.
~ as used here is a Unix shortcut for the path to your home directory.
Alternately, you could also use the cat command to insert zero bytes of data into a large file:
cat /dev/null > ~/mybig.file
/dev/null is a special Unix device that is always zero bytes in size
CHECKING USED SPACE
You can check to see your current total home directory (shirtcut “~”) usage using the du command (plus the summary, total, and human-readable options) like so:
[jharvard@holylogin01 ~]$ du -sch ~
80G .
80G total
If you are on a login node, you can also view your computed quota directly like so:
[jharvard@holylogin01 ~]$ df -h .
Filesystem Size Used Avail Use% Mounted on
rcstorenfs:/ifs/rc_homes/home13 95G 80G 15G 9% /n/home13
This shows that the user jharvard has used 80GB out of 100GB. The 95GB shown as the Size is called a soft quota. That is the threshold at which the system will notify you that you are going over.
Please bear in mind that due to the size of our home directories neither is instantaneous. The notification and re-calculation of quotas happens some time during a 24 hour period. So if you manage to go over quota before the next calculation is done, you won’t receive a soft notice. Similarly, it may take some time for your actual usage and computed quota to match again.
To find which files or directories are using the most space:
[jharvard@holylogin01 ~]$ cd ~
[jharvard@holylogin01 ~]$ du -h --max-depth=1 .
384K ./.config
232K ./Test
2.0G ./spack
...
This will show a listing of files and sizes and you can repeat the command down the directory tree to find files to delete.
Bookmarkable Links