[TIP] Ubuntu 1 MB /tmp Partition Problem

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.[tags]Ubuntu, tmp, tmpfs, 1 MB /tmp problem[/tags]

3 comments to [TIP] Ubuntu 1 MB /tmp Partition Problem

  • Rob White

    Better still to leave the line and just remove the “size=#######,” which will allow your tmp directory to grow to half of your available ram (available at startup).

    I actually add the line above and set the size manually to one-half ram _plus_ one-half configured swap space.

    For various reasons having your /tmp drive self-clean between boots and completely ram based will greatly increase the speed of many operations. (e.g. an install that “copies through” /tmp wont become a disk-to-disk copy operation unless it _must_ overflow into swap).

    Many distros put /tmp into a tmpfs (hence the name tmpfs 8-) by default, and unless you are _pressed_ for ram, you should too.

  • Gordon Haverland

    Many applications which are not written properly, will generate errors about not enough room, when they actually do have enough room. What seems to happen is that people seem to think Linux is a 2 partition system: 1 partition for swap and 1 partition for filesystem. But if you actually have separate filesystems for /tmp, /usr, /usr/local, /var, /home, etc., more often than not the program in question is looking for freespace on /, and not in the filesystem where the room is actually needed.

  • @Rob: That is indeed a good suggestion.

    @Gordon: You are correct. But there are many applications that actually need the space in /tmp and not just the final location. One example is as given by rob in a “copy through” install.

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

SUBSCRIBE!





Tweet