1

On VPS when I press tab under my user I get:

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

but it works fine under root, what's happening?

2
  • Which filesystem? With ext2/ext3/ext4 see tune2fs's option -m.
    – Cyrus
    Aug 28, 2015 at 6:28
  • If the error is this clear, you could’ve included the output of df right away. ;) Also, the output of df -i, please.
    – Daniel B
    Aug 28, 2015 at 8:24

3 Answers 3

3

As you press tab certain/specific script(s) is/are launched
(several can be defined, which one that gets launched depends on the command currently typed at the prompt).
These scripts often use temporary files in /tmp

The login where you see this has either ran out of space in /tmp (e.g. quota), alternatively has no quota at all, or the script is (erroneously?) attempting to write/handle too large data.

Generally root has more quota or no limits.

sudo -i
cd /tmp
du -h | sort -n | less

should display what there is in /tmp and the space it occupies.

Also:

df -h --output=source,target,ipcent,pcent
Filesystem     Mounted on     IUse%  Use%
...

should, in a "normal" situation not have high numbers under the Use%-columns, for either /tmp or tmpfs (which there is, depends on system setup).

2
  • df -h should help as well
    – nKn
    Aug 28, 2015 at 8:23
  • Reverted, tmpfs might be in use - /tmp in RAM. Thanks for reminding @Daniel B
    – Hannu
    Aug 28, 2015 at 8:31
0

Check how your filesystem is formatted. Typical setups I ran into used these settings:

  • Format Ext2 (ok, now somewhat dated an probably ext4)
  • Reserved space: 5%.

The last means that 5% of the space is reserved for uid 0.

If you have a 200GB drive and one single partition, then a regular user can fill it up to 190GB. At that point she will get an filesystem full error. Df will report 100% in use.

If, at this time, you try this as root you can write up to another 5%. Df will show over 100% full.


Now apply that to your problem. Is a filesystem which is being used over 100% full?

0

We got bit with this today, and it turned out to be an issue with the Inodes.

You should run df -i to see how many Inodes you're using. If your IUse% is at or near 100, you should find as many small or zero-sized files you can, and delete them all.

You can find the files with (credit to the linked article):

for i in /*; do echo $i; find $i |wc -l; done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .