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?
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).
Check how your filesystem is formatted. Typical setups I ran into used these settings:
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?
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
tune2fs
's option-m
.df
right away. ;) Also, the output ofdf -i
, please.