Results 1 to 6 of 6

Thread: tmpfs is full

  1. #1
    Join Date
    May 2013
    Location
    The Hague area, The Netherlands
    Posts
    43

    tmpfs is full

    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
    Geert-Jan

    VPS, CentOS 7

  2. #2
    Join Date
    Aug 2015
    Posts
    292
    Why not reboot the system, it will clear the tmpfs.
    Kind regards, Fred

    Alentejo Webdesign
    Webdesign with Passion is what we do
    Web development, Hosting, Speed Optimizing & More......

  3. #3
    Join Date
    Mar 2018
    Posts
    36
    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 by nando89; 05-14-2018 at 10:01 PM.

  4. #4
    Join Date
    May 2013
    Location
    The Hague area, The Netherlands
    Posts
    43
    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.
    Geert-Jan

    VPS, CentOS 7

  5. #5
    Join Date
    Dec 2005
    Location
    The Netherlands
    Posts
    83
    Quote Originally Posted by Pzz View Post
    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.

  6. #6
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    3,291
    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.
    Greetings, Richard.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •