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.

increase /usr/tmpDSK and make /tmp point to it

Discussion in 'Database Discussions' started by actived, Mar 30, 2012.

  1. actived

    actived Well-Known Member

    Joined:
    Mar 30, 2012
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Hi all,
    our DB has a 1GB table and is expected to have a couple more tables in GBs soon.
    Refactoring the app is presently out of question though it is scheduled for later (few months).
    So we need more temp space.
    To set up /tmp to point to /usr/tmpDSK we followed this guide:
    How To Increase size of /var/tmp and /tmp in CentOS
    (and looked here too: Increasing the Size of tmpDSK (/tmp) :: The cPanel Admin)
    Currently,
    df -h shows

    Code:
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                           93G   40G   50G  45% /
    /dev/hda1              99M   23M   71M  25% /boot
    tmpfs                1005M     0 1005M   0% /dev/shm
    and mount shows:

    Code:
    /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    /dev/hda1 on /boot type ext3 (rw)
    tmpfs on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    /tmp on /var/tmp type none (rw,noexec,nosuid,bind)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    I did a grep on /usr/local/cpanel/scripts/securetmp for '$tmpdsksize' and the valueis set properly in it:

    Code:
    my $tmpdsksize     = 16971520;    # Must be larger than 250000
    and

    on the command prompt it also shows:
    Code:
    # ls -hal /usr/tmpDSK
    -rw------- 1 root root 17G Mar 30 /usr/tmpDSK
    I've seen that when working properly it should show as /tmp mounted to /usr/tmpDSK with the 16+ GB space.

    What do I do?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could simply add tmpdir=/newpath (where newpath is a location that has more space) to /etc/my.cnf file. If the reason /tmp needs to be larger would be due to MySQL, MySQL doesn't need to write to /tmp location. It can be changed to write elsewhere simply by adding the tmpdir=/newpath value to /etc/my.cnf file.

    I don't advise setting a /tmp as high as you are trying to do. Also, when you check "ls -lah /tmp" what does that show?
     
  3. actived

    actived Well-Known Member

    Joined:
    Mar 30, 2012
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Firstly, thanks for the quick reply!

    Well, I followed this guide now:
    how to increase the size of disk space /tmp (/usr/tmpDSK) partition in linux server « boxtutorials.com

    I suitably adapted it and it seems I was missing only a mount command and an entry in fstab for the same settings to hold after a restart (if I am not wrong).
    It seems to be working fine now. Yay.

    Finally,
    1. about 16GB being too big a value, what would be the max decent value?
    2. /tmp pointing to /usr/tmpDSK now has permissions 1777 with 'loop,noexec,nosuid,rw' in fstab
    Is that good enough (basic-security wise)? This (Securing Your /tmp Partition with Cpanel/WHM) seems to say so.
    3. If I make "newpath" to just any directory, then it would need some special permissions, won't it?
    And is there a reason that /usr/tmpDSK is used commonly instead of say some path like /var/mysqltemp or /home/speciallyfortemp/temp ?

    Thanks again for the prompt reply!
     
  4. actived

    actived Well-Known Member

    Joined:
    Mar 30, 2012
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I'd just like to add for completeness, that while /usr/tmpDSK with 8GB works well, /var/mysqltemp didnt work at all for me. Strange because the MySQL manual says it should work fine.
     
Loading...

Share This Page