This is a test version of Biostars. For the public version, visit https://www.biostars.org.
No space left on device error with deeptools bamCompare

Hello! I'm running a few scripts right now on a server and whenever I run bamCompare I get the 'no space left of device' error.

$ df -H
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       16G   16G     0 100% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             16G  4.0K   16G   1% /dev
tmpfs           3.2G  380K  3.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             16G     0   16G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/xvdf        30G   29G  1.2M 100% /software
/dev/xvdg       985G  748G  196G  80% /data

After the error occurs I am also unable to tab-complete and I get this error message:

-bash: cannot create temp file for here-document: No space left on device

Looking in the /tmp/ directory (size 848KB), it is filled with files that look like this

-rw-------  1 ubuntu ubuntu 4.6M Jul 17 11:25 _deeptools_szwlxqn_.bg

Restarting the server fixes the 'no space left' error, but it will simply happen again if I try to run bamCompare on my files. I hope someone knows what might be going on here. I'm clearly not very experienced with linux. THANK YOU!

software error deeptools picard bash terminal

Your /data/ directory is the one with space for analysis - it has 1TB. Your root directory (/) is mounted on a 16GB device.

What this means is that if you're running analysis outside /data/, (that is, if /tmp/ is being used), you'll run out of space really fast. Try setting the temp folder location in bamCompare (a quick google search says you need to set a parameter in a config file (see here, you will need to dig deeper).

In other news you also need to make space in your root directory

/dev/xvda1       16G   16G     0 100% /

Some errant file may have been saved there. Look at a listing of / and check.

Is it possible to reallocate more space for the root directory? Can't find much to remove..

Your directory cannot be larger than the disk it sits on. If /dev/xvda1 has 16G capacity only, / cannot be larger. I'm not sure if it is possible to mount the / folder on a different device without reinstalling the OS.

For each folder under / that is mounted on /dev/xvda1, run du -sh. Point the largest (which would also be the one that grows the most, like a data directory or a tmp folder) to a new disk.

The config parameter is deprecated now, and instead you can just set the environment variable TMPDIR to whatever temporary directory you want.

1 answer

As per rpolicastro, and for others arriving here with this problem, you can solve this by temporarily changing the TMPDIR location, as follows:

TMPDIR="/Kevin/Projects/analysis/customtemp"
export TMPDIR

This is not permanent and TMPDIR will be restored to its original value once your session ends.

Kevin

Unless you add it to your dotfiles....

If it's only needed by this application, it's easier to not add to the dotfile. In fact, I'd add an alias to the dotfile instead:

function bamCompare {
     export TMPDIR="/custom/temp/directory"
    /path/to/bamCompare "$@"
}
export -f bamCompare

Log in to answer this question.