tmpfs is full

Pzz

Verified User
Joined
May 20, 2013
Messages
138
Location
The Hague area, The Netherlands
Hi,

I'm wondering if I do need to do something about a full tmpfs. It's 2 GB and has 100% usage.

Everything seems to work fine (as far as I'm aware of).

I was never concerned about this tmpfs until I started to use ´sudo' (finally) and that give me this error:

Code:
sudo: unable to write to /var/lib/sudo/gj/: No space left on device

This also means that I never used sudo without this error, maybe my user is misconfigured?

... and dr. Google came up with the tmpfs.....

I guess one question ends up in three problems in this one thread. Sorry, won't do it again.

GJ
 
Why not reboot the system, it will clear the tmpfs.
 
Install tmpwatch.

The tmp gets full because the operating system allocates disk space for files in (usually) 4KB blocks, even if you have files of 1 byte each.

Check the timestamp of the session files. Usually you can delete session files older than, say 12 hours. Depending on the usage of the sessions you can in-/decrease the number of hours to keep them.

Run 'tmpwatch' from a cronjob every hour/minute/day (whatever is best for your situation) to clean up old sessions.

Code:
# sudo yum install tmpwatch -y

Once tmpwatch is installed execute the command:

Code:
/usr/sbin/tmpwatch -am 12 /tmp

This will delete all files older than 12 hours.

To configure tmpwatch:

Code:
crontab -e

Code:
04 * * * /usr/sbin/tmpwatch -am 12 /tmp

More:
http://forum.directadmin.com/showthread.php?t=51925
 
Last edited:
Thanks!

I'll give it a try, I allready restarted my server. As a Window-user they always told me the big advantage of linux is that is doesn't have to be restarted.

Now I read that it is common to restart a server every 7 to 10 days.
 
Thanks!

I'll give it a try, I allready restarted my server. As a Window-user they always told me the big advantage of linux is that is doesn't have to be restarted.

Now I read that it is common to restart a server every 7 to 10 days.

No that is not needed, you just need to clean up your tmpfs once in a while like what nando89 said.
 
Now I read that it is common to restart a server every 7 to 10 days.
Don't know where you read that but that's nonsense.

Like Imtek and nando89 said, you can clean up your tmpfs once a while. Or maybe increase the tmpfs size a bit.

The only real reason to restart your Linux server is if you do a kernel upgrade.
 
Back
Top