1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

VPS disk space issue

Discussion in 'Site & Server Administration' started by hmk20009, Dec 19, 2017.

  1. #1
    [root@dns ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/cos-root 499G 494G 5.2G 99% /
    devtmpfs 2.9G 0 2.9G 0% /dev
    tmpfs 2.9G 0 2.9G 0% /dev/shm
    tmpfs 2.9G 8.7M 2.9G 1% /run
    tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
    /dev/vda1 985M 202M 733M 22% /boot
    tmpfs 581M 0 581M 0% /run/user/0
    tmpfs 581M 0 581M 0% /run/user/1002



    actual size of my sites is about 70gb
    size of /var folder is about 7 gb

    can you help me figure out this problem and how to solve it.
     
    hmk20009, Dec 19, 2017 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Hello there,

    Something is obviously using a lot of space. You can track down the larger folders by using the following command.

    du -h --max-depth=1 /
    Code (markup):
    You can keep changing the final directory query once you start seeing where the larger folders are to dig deeper, for example:

    du -h --max-depth=1 /home
    Code (markup):
    Regards,
    Chris
     
    RHS-Chris, Dec 21, 2017 IP
  3. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Hello,

    with further investigation
    [root@dns ~]# du -h --max-depth=1 /home
    0 /home/cPanelInstall
    1.1M /home/.cpcpan
    69G /home/virtfs
    168M /home/cpanelsolr
    16K /home/clamav
    47G /home/sumdueu
    116G /home


    [root@dns ~]# du -h --max-depth=1 /
    231M /boot
    0 /dev
    du: cannot access ‘/proc/7647/task/7647/fd/4’: No such file or directory
    du: cannot access ‘/proc/7647/task/7647/fdinfo/4’: No such file or directory
    du: cannot access ‘/proc/7647/fd/4’: No such file or directory
    du: cannot access ‘/proc/7647/fdinfo/4’: No such file or directory
    du: cannot access ‘/proc/7710’: No such file or directory
    du: cannot access ‘/proc/7711’: No such file or directory
    du: cannot access ‘/proc/7714’: No such file or directory
    du: cannot access ‘/proc/7715’: No such file or directory
    0 /proc
    8.4M /run
    0 /sys
    1.3G /etc
    16M /root
    11G /var
    196K /tmp
    11G /usr
    47G /home
    0 /media
    0 /mnt
    165M /opt
    0 /srv
    0 /backup
    70G /

    i am unable to find more than 250 gb where it is being used.
     
    hmk20009, Dec 22, 2017 IP
  4. RomanEpo

    RomanEpo Active Member

    Messages:
    127
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #4
    Just enter high volume directory and use mentioned command to trace used directory.By default /var directory stored all kind of logs files,So trace out which file more big.
    #cd /DirectoryName
    #du -sch *
    Code (markup):
     
    RomanEpo, Feb 17, 2018 IP
  5. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #5
    I tried this command but still unable to find any very directory.

    by all different types of commands i used, all shows about 70 gb is actually used by my vps. but unable to
    find or get any idea where about 350 gb used on vps.
     
    hmk20009, Feb 20, 2018 IP
  6. RomanEpo

    RomanEpo Active Member

    Messages:
    127
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #6
    Just put exact command to your terminal and send here output of command.
    # cd /
    #ls
    #du -sch *
    
    Code (markup):
    Before submit command ,ensure you are in root directory.
     
    RomanEpo, Feb 20, 2018 IP
  7. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #7
    [root@dns ~]# cd /
    [root@dns /]# ls
    backup hs_err_pid21856.log lib sbin
    bin hs_err_pid24601.log lib64 scripts
    boot hs_err_pid2841.log media srv
    core.26256 hs_err_pid28848.log mnt sys
    dev hs_err_pid30368.log opt tmp
    etc hs_err_pid30652.log proc usr
    home hs_err_pid3171.log razor-agent.log var
    hs_err_pid11659.log hs_err_pid4059.log root vmi115958
    hs_err_pid1606.log hs_err_pid7091.log run
    [root@dns /]# du -sch *
    0 backup
    0 bin
    249M boot
    1.9M core.26256
    0 dev
    2.3G etc
    46G home
    16K hs_err_pid11659.log
    16K hs_err_pid1606.log
    16K hs_err_pid21856.log
    16K hs_err_pid24601.log
    16K hs_err_pid2841.log
    20K hs_err_pid28848.log
    16K hs_err_pid30368.log
    16K hs_err_pid30652.log
    20K hs_err_pid3171.log
    16K hs_err_pid4059.log
    16K hs_err_pid7091.log
    0 lib
    0 lib64
    0 media
    0 mnt
    du: cannot access ‘proc/6250/task/6250/fd/4’: No such file or directory
    du: cannot access ‘proc/6250/task/6250/fdinfo/4’: No such file or directory
    du: cannot access ‘proc/6250/fd/4’: No such file or directory
    du: cannot access ‘proc/6250/fdinfo/4’: No such file or directory
    du: cannot access ‘proc/7308’: No such file or directory
    0 proc
    4.0K razor-agent.log
    18M root
    81M run
    0 sbin
    0 scripts
    0 srv
    0 sys
    4.0K vmi115958
    49G total
    [root@dns /]#
     
    hmk20009, Feb 20, 2018 IP
  8. RomanEpo

    RomanEpo Active Member

    Messages:
    127
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #8
    Yes ,You are using total 49 GB space. Just confirm your total volume disk sda size,using mentioned command
    #fdisk -l
    #df -h
    Code (markup):
    Cross match both of them.

    Please send output of mentioned command
    #free -g
    #vmstat -s
    #cat /proc/meminfo
    Code (markup):
     
    Last edited by a moderator: Feb 22, 2018
    RomanEpo, Feb 20, 2018 IP
  9. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #9
    [root@dns /]# fdisk -l
    Disk /dev/vda: 536.9 GB, 536870912000 bytes, 1048576000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x000be984
    Device Boot Start End Blocks Id System
    /dev/vda1 * 2048 2050047 1024000 83 Linux
    /dev/vda2 2050048 1048575999 523262976 8e Linux LVM
    Disk /dev/mapper/cos-root: 535.8 GB, 535818141696 bytes, 1046519808 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    [root@dns /]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/cos-root 499G 418G 81G 84% /
    devtmpfs 2.9G 0 2.9G 0% /dev
    tmpfs 2.9G 0 2.9G 0% /dev/shm
    tmpfs 2.9G 89M 2.8G 4% /run
    tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
    /dev/vda1 985M 250M 685M 27% /boot
    tmpfs 581M 0 581M 0% /run/user/0
    [root@dns /]# free -g
    total used free shared buff/cache available
    Mem: 5 1 3 0 1 3
    Swap: 0 0 0
    [root@dns /]# vmstat -s
    5946076 K total memory
    1442200 K used memory
    1389264 K active memory
    119848 K inactive memory
    4296832 K free memory
    128 K buffer memory
    206916 K swap cache
    0 K total swap
    0 K used swap
    0 K free swap
    14795745 non-nice user cpu ticks
    31765 nice user cpu ticks
    3060827 system cpu ticks
    49431481 idle cpu ticks
    7343146 IO-wait cpu ticks
    0 IRQ cpu ticks
    125982 softirq cpu ticks
    695608 stolen cpu ticks
    134242527 pages paged in
    30693684 pages paged out
    0 pages swapped in
    0 pages swapped out
    843185453 interrupts
    320126046 CPU context switches
    1518797315 boot time
    881499 forks
    [root@dns /]# cat /proc/meminfo
    MemTotal: 5946076 kB
    MemFree: 4113296 kB
    MemAvailable: 4041468 kB
    Buffers: 128 kB
    Cached: 179096 kB
    SwapCached: 0 kB
    Active: 1524896 kB
    Inactive: 148232 kB
    Active(anon): 1499636 kB
    Inactive(anon): 85420 kB
    Active(file): 25260 kB
    Inactive(file): 62812 kB
    Unevictable: 0 kB
    Mlocked: 0 kB
    SwapTotal: 0 kB
    SwapFree: 0 kB
    Dirty: 112 kB
    Writeback: 0 kB
    AnonPages: 1493984 kB
    Mapped: 55692 kB
    Shmem: 91140 kB
    Slab: 60108 kB
    SReclaimable: 26068 kB
    SUnreclaim: 34040 kB
    KernelStack: 4304 kB
    PageTables: 28996 kB
    NFS_Unstable: 0 kB
    Bounce: 0 kB
    WritebackTmp: 0 kB
    CommitLimit: 2973036 kB
    Committed_AS: 3104528 kB
    VmallocTotal: 34359738367 kB
    VmallocUsed: 22604 kB
    VmallocChunk: 34359707148 kB
    HardwareCorrupted: 0 kB
    AnonHugePages: 49152 kB
    HugePages_Total: 0
    HugePages_Free: 0
    HugePages_Rsvd: 0
    HugePages_Surp: 0
    Hugepagesize: 2048 kB
    DirectMap4k: 102272 kB
    DirectMap2M: 3043328 kB
    DirectMap1G: 5242880 kB
    [root@dns /]#
     
    hmk20009, Feb 20, 2018 IP
  10. RomanEpo

    RomanEpo Active Member

    Messages:
    127
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #10
    This is some thing wrong from OS or Platform level.Required to know VPS platform with access for tracing issue,You can raised about this issue to your service provider.
     
    RomanEpo, Feb 22, 2018 IP
  11. Cameron Fillers

    Cameron Fillers Member

    Messages:
    33
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #11
    OP mentioned that he is using a VPS. Depending on the type of VPS, he may be obtaining the status of the master node, as opposed to his own personal VPS. For instance, with OpenVZ, depending on how file system quota is configured, a container may report the disk usage of the entire mounted /vz folder, as opposed to the amount of disk space they are currently using.

    Additionally, based on all the feedback, it looks like the op is unable to shrink the size of the disk, so the virtual disk may have become bloated.

    OP, if you delete content from your log directory, or some of the larger files, does the disk size decrease for /?
     
    Cameron Fillers, Jun 18, 2018 IP
  12. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #12
    by removing logs disk size decreased to 420 gb
     
    hmk20009, Jun 19, 2018 IP
  13. Cameron Fillers

    Cameron Fillers Member

    Messages:
    33
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #13
    Alright. Now that you have done that, are you able to make changes to the .htaccess file now? That may not resolve where the discrepancy in size is, but has decreasing the overall space resolved your ability to edit files.
     
    Cameron Fillers, Jun 19, 2018 IP
  14. Cameron Fillers

    Cameron Fillers Member

    Messages:
    33
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #14
    Also, generally when I am trying to track down issues, I just run the following commands
    cd /
    du -sh *

    and that should show you all the files in the root directory, and directories with their accumulated size. Has helped me track down rogue directories with bloated usage, since you can find one with an abnormally large amount of disk space used, browse into the directory, and run "du -sh *" again to dig deeper until you find the culprit.

    Warning, that it may take a bit of time to run, as it parses the entire tree.
     
    Cameron Fillers, Jun 19, 2018 IP
  15. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #15
    i can make changes to any file including .htaccess
     
    hmk20009, Jun 19, 2018 IP
  16. Cameron Fillers

    Cameron Fillers Member

    Messages:
    33
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #16
    Okay, my apologies. I was under the impression that you were not able to write changes to disk based on the disk being full.

    Please go ahead and try the

    du -sh *

    at /, and see if you are able to locate where the space is
     
    Cameron Fillers, Jun 19, 2018 IP
  17. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #17
    [root@dns ~]# du -sh *
    188K chkrootkit-0.52
    32K core.14330
    40K core.14331
    0 cpanel3-skel
    1.1M cpanel-install.log
    4.0K error_log
    0 FLUSH
    4.0K installer.lock
    144K ~]# journalctl -xe
    28K latest
    0 logfile
    0 mkdir
    1.5M old_rpm_dbs
    4.0K original-ks.cfg
    0 perl5
    40K php.ini.new
    40K php.ini.orig
    16K SET
    16K show
    16K sum*u_w*1
    8.0K tart-up result is done.
    20K tmp
    0 writelog
    28K ystemctl enable php-fpm.service
    [root@dns ~]#
     
    hmk20009, Jun 19, 2018 IP
  18. Cameron Fillers

    Cameron Fillers Member

    Messages:
    33
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #18
    [root@dns ~]# du -sh *
    188K chkrootkit-0.52
    32K core.14330
    40K core.14331
    0 cpanel3-skel
    1.1M cpanel-install.log
    4.0K error_log
    0 FLUSH
    4.0K installer.lock

    it looks like you are doing that from your directory root. please do

    cd /
    du -sh *

    so that you do it from the / directory
     
    Cameron Fillers, Jun 19, 2018 IP
  19. hmk20009

    hmk20009 Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #19
    [root@dns ~]# cd /
    [root@dns /]# du -sh *
    0 backup
    0 bin
    291M boot
    1.9M core.26256
    0 dev
    862M etc
    55G home
    20K hs_err_pid1053.log
    16K hs_err_pid10792.log
    20K hs_err_pid11174.log
    16K hs_err_pid11659.log
    16K hs_err_pid1606.log
    16K hs_err_pid20829.log
    16K hs_err_pid21763.log
    16K hs_err_pid21856.log
    16K hs_err_pid24601.log
    16K hs_err_pid2841.log
    20K hs_err_pid28848.log
    16K hs_err_pid30368.log
    16K hs_err_pid30652.log
    16K hs_err_pid31157.log
    20K hs_err_pid3171.log
    16K hs_err_pid31778.log
    16K hs_err_pid4059.log
    16K hs_err_pid5116.log
    16K hs_err_pid7091.log
    16K hs_err_pid8736.log
    16K hs_err_pid9753.log
    0 lib
    0 lib64
    0 media
    0 mnt
    du: cannot access ‘proc/16637/task/16637/fd/4’: No such file or directory
    du: cannot access ‘proc/16637/task/16637/fdinfo/4’: No such file or directory
    du: cannot access ‘proc/16637/fd/4’: No such file or directory
    du: cannot access ‘proc/16637/fdinfo/4’: No such file or directory
    0 proc
    4.0K razor-agent.log
    21M root
    17M run
    0 sbin
    0 scripts
    0 srv
    0 sys
    4.0K vmi115958
    [root@dns /]#
     
    hmk20009, Jun 19, 2018 IP
  20. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    413
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #20
    Are you using MySQL on this Server?
    It looks like some hidden files occupying space on the Server, Check in MySQL directory if there is InnoDB hidden file that is occupying space.
     
    hostechsupport, Jul 17, 2018 IP