The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to resize tmp

Discussion in 'General Discussion' started by yamaharr1, Jul 14, 2008.

  1. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    I have read and read and read so many posts but the posts are very out dated and many of the commands I see in them do not work. An example is if I use the command "lsof /tmp | grep deleted" to see why my tmp is getting filled up it is not recognized.

    Can anyone give an up to date list of commands and instructions on how to resizing the tmp partition?

    I am using a Linux system and need to go from 485M to 1G
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
  3. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Looks interesting is there any information on how to use it? Or where to place the script?
     
  4. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    You must be root to run this script. You can place this script inside /root.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,468
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might do better to use cPanels securetmp script. Searching the forums for securetmp brings back several posts, including this one with chirpy's details on how to remove and recreate tmp.
    http://forums.cpanel.net/showthread.php?t=76122&highlight=securetmp

    If you followed that after editing /scripts/securetmp with the size you want tmp to be you should be gold.
     
  6. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    I have had to use one of these guides already to repair tmpDSK but I didn't think about editing the /scripts/securetmp to create a larger area but would that really work?
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,468
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You bet. There are threads around here about that as well. Try the search tool, it works well. :)
     
  8. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    As I mentioned in my first post I have "read and read and read" I guess I should have said I have search and read, search and read, search and read but there just comes a time when enough is enough and you must post hoping for others to point you in the right direction.

    Now off to the search functions again to see if I can find some guides on using the / scripts/securetmp to also resize not my ideal way of doing things but hopefully it will be acceptable.
     
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,468
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  10. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Thanks infopro for the links, I found much of those already in other posts which promted me to write this thread because many of the commands that are used did not work for me many times I received "command not found".


    But your last link was perfect and has now worked out just as I needed thanks again.
    http://forums.cpanel.net/showthread.php?t=64526&highlight=edit+securetmp
     
  11. nitaish

    nitaish Well-Known Member
    PartnerNOC

    Joined:
    Jan 6, 2006
    Messages:
    123
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Mulund, India, India
  12. h4f

    h4f Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Increase the size in the /scripts/securetmp directory and then copy paste the commands below, have just done it on 5 servers worked good.

    service mysql stop
    service httpd stop
    umount /var/tmp
    umount /tmp
    rm -rf /usr/tmpDSK
    /scripts/securetmp --auto
    service mysql start
    service httpd start
    df -h
     
  13. mfwl

    mfwl Registered

    Joined:
    Feb 11, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for this info - really helped!!!
     
  14. innsites

    innsites Well-Known Member

    Joined:
    Nov 30, 2005
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    cannot resize /tmp -- WHY?

    I edited /scripts/securetmp:
    my $tmpdsksize = 15360000; # Must be larger than 250000

    Then
    root@ded [~]# /usr/sbin/lsof /tmp

    Then went through steps described in post. Got this response:
    umount: /tmp: device is busy
    umount: /tmp: device is busy
    Proceeded:
    root@ded [~]# /scripts/securetmp --auto
    Securing /tmp & /var/tmp
    /tmp is already secure
    Setting up /var/tmp... Done
    Checking fstab for entries ...Done
    Logrotate TMPDIR already configured
    Process Complete

    BUT no change in size?
    root@ded [~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /usr/tmpDSK 485M 460M 0 100% /tmp
     
  15. charliesxia

    charliesxia Member

    Joined:
    Aug 3, 2006
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    0
    I changed the tmp dir 1G to 4G successfully
    but after the reboot it turn back to 1G
    anyone can help ??
    Thank you
     
  16. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    yes that weird thing happened to me too , after server reboot its back to default 2gb :(
     
  17. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    Do that step by step:

    pico /scripts/securetmp
    Modify "my $tmpdsksize"

    service mysql stop
    service httpd stop
    pstree -p | grep tailwatchd
    then kill the processes
    umount /var/tmp
    fuser -cu /tmp
    then kill all processes appears to you
    umount /tmp
    rm -rf /usr/tmpDSK
    /scripts/securetmp --auto
    service mysql start
    service httpd start

    reboot -n

    Done
     
Loading...

Share This Page