Recently someone asked me about an issue he was facing with his Ubuntu Hardy Heron installation. Many of the applications, that he regularly used, were misbehaving. e.g., he couldn’t play flash videos in firefox, downloads were failing, installation of new applications were failing, etc. Everything was giving errors of not enough disk space even though he had quite a few GBs left on his drive. A few of the error messages pointed out that there wasn’t enough space in /tmp. And indeed, he was unable to store anything more than 1 MB inside this particular directory. After a quick look I found out the issue. Ubuntu had created another partition with /tmp being its mount point and its maz size was set to 1 MB.
A search told me that this occurs if you happen to run out of disk space on your root partition some time, so Ubuntu automatically limits the size of /tmp to squeeze as much out of the remaining space as it can. Ideally, original behaviour of /tmp should be restored once you recover some space but it doesn’t happen. The solution? Well, it is pretty simple. Just follow these steps.
Step 1. Open up /etc/mtab in your favourite editor. e.g. gksudo gedit /etc/mtab
Step 2. Look for a line that looks something like below example and delete it.
overflow /tmp tmpfs rw,size=1048576,mode=1777 0 0
Step 3. Save the file and restart your computer. That’s it.
Now, this problem might not just be Ubuntu specific though and might happen with other distros as well. So, if you come across such an issue, try out this solution.