Join the community today
Become a Member

Sysadmin why does centminmod eat big disk space?

Discussion in 'System Administration' started by arlon, Jul 6, 2016.

  1. arlon

    arlon Member

    83
    6
    8
    Feb 20, 2016
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.13.6
    10.1
    i running centminmod on 15gb disk space and 4GB left
    disk space usage:
    4.1G home
    1.1G swapfile
    3.1G usr
    1.2G var

    home disk usage
    [root@ home]# du -sh *
    4.0K mysqltmp
    218M nginx
    40K usermain
    3.9G usertmp_donotdelete

    my web only need about 200mb, what is usertmp_donotdelete ? why does usertmp_donotdelete eat big disk space?
    why does centminmod eat big disk space?
     
  2. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    which centmin mod version 123.08stable or 123.09beta01 was the initial install from ?

    if 123.08stable or early 123.09beta01, it's a bug of sorts as the routine to calculate tmp size was a bit generous for /tmp size. A large /tmp size is crucial as alot of software will use including mysql server/mariadb server and without adequate /tmp size you can corrupt your mysql data on certain mysql tasks like repairing corrupted mysql data tables etc. Folks or installers that are not aware of this may run into problems in future if /tmp size isn't adequate. But you'd only run into this with some corrupted mysql database tables and when you go to repair and can't repair or end up corrupting your mysql data or making it worse. So it's a hidden problem until you really need that extra /tmp disk space !

    The /tmp routine is improved and fixed greatly in centmin mod 123.09beta01 initial install routine to take better account of your existing disk free space in the calculation for /tmp size.

    Might want to check out these threads which will shed some light :)
     
  3. arlon

    arlon Member

    83
    6
    8
    Feb 20, 2016
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.13.6
    10.1
    im using 123.08stable
     
  4. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah you would of been using the older /tmp sizing formula then

    what's output of these 2 commands
    Code:
    df -hT
    cat /etc/fstab
    Might want to use CODE tags for code How to use forum BBCODE code tags :)
     
  5. arlon

    arlon Member

    83
    6
    8
    Feb 20, 2016
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.13.6
    10.1
    Code:
    [root@apel usermain]# df -hT
    Filesystem           Type   Size  Used Avail Use% Mounted on
    /dev/vda1            ext4    15G   10G  4.1G  72% /
    tmpfs                tmpfs  372M     0  372M   0% /dev/shm
    /home/usertmp_donotdelete                     ext4   3.7G   10M  3.5G   1% /tmp
    
    
    Code:
    [root@apel usermain]# cat /etc/fstab
    
    #
    # /etc/fstab
    # Created by anaconda on Tue Nov 24 20:49:45 2015
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=22bc9de1-fffb-486a-bbb8-f86b962e0dd3 /                       ext4    defaults        1 1
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    /home/usertmp_donotdelete /tmp ext4 loop,rw,noexec,nosuid 0 0
    /swapfile          swap            swap    defaults        0 0
     
  6. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    in that case you can use these 3 commands to reduce /tmp to 1000MB in size
    Code (Text):
    npstop; mysqladmin flush-tables; sleep 15; mysqlstop
    

    this is one whole line
    Code (Text):
    if [[ ! -f /proc/user_beancounters && -f /home/usertmp_donotdelete ]]; then umount -l /home/usertmp_donotdelete; sleep 4; rm -rf /tmp >/dev/null 2>&1; rm -rf /home/usertmp_donotdelete; dd if=/dev/zero of=/home/usertmp_donotdelete bs=1099 count=1000000; echo Y | mkfs.ext4 /home/usertmp_donotdelete; mkdir -p /tmp; mount -t ext4 -o loop,rw,noexec,nosuid /home/usertmp_donotdelete /tmp; chmod 1777 /tmp; ln -s /tmp /var/tmp; df -hT; else echo "system doesn't have /home/usertmp_donotdelete file"; df -hT; fi

    Code (Text):
    mysqlstart; npstart
    
     
    • Like Like x 1
  7. arlon

    arlon Member

    83
    6
    8
    Feb 20, 2016
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.13.6
    10.1
    i have run those command and disk space decreased to 3.1gb from 4.1gb
    Code:
    df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/vda1              15G   11G  3.1G  79% /
    tmpfs                 372M     0  372M   0% /dev/shm
    /home/usertmp_donotdelete
                         1000M  1.4M  946M   1% /tmp
     
  8. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    looks about right you / used space rose by 1GB from previous output before the change while the /tmp underlying file dropped from 3.9GB to 1000MB
     
  9. arlon

    arlon Member

    83
    6
    8
    Feb 20, 2016
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.13.6
    10.1
    after reboot
    Code:
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/vda1              15G  7.2G  6.9G  52% /
    tmpfs                 372M     0  372M   0% /dev/shm
    /home/usertmp_donotdelete                     1000M  1.5M  946M   1% /tmp
     
  10. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah that looks better :)
     
    • Like Like x 1
  11. eva2000

    eva2000 Administrator Staff Member

    31,022
    6,925
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,431
    Local Time:
    1:10 PM
    Nginx 1.13.x
    MariaDB 5.5