How to check why your linux vps disk space is full


Your linux vps disk space is full, how to check it. The disk space is full because of some reasons like the log file or spam email.

vps full

Step 1: ssh to your server as root

Step 2: change dir to /

cd /

Step 3: check disk usage:

du -hs *

If you use the below command successfully, you can determine the largest subdirectory. Here is `home` subdirectory.

[root@tutorialspots.com /]# du -hs *
0       aquota.group
0       aquota.user
5.8M    bin
144K    boot
4.0K    command
132K    dev
16M     etc
10G     home
208K    kloxo-install
27M     lib
4.0K    media
4.0K    mnt
4.0K    opt
0       proc
40K     root
25M     sbin
284K    script
4.0K    selinux
4.0K    service
4.0K    srv
0       sys
90M     targz1
32K     tmp
1.6G    usr
1.5G    var

You you set an error like crash memory. Suppose that you get the result:

[root@tutorialspots.com/]# du -hs *
0       aquota.group
0       aquota.user
5.8M    bin
144K    boot
4.0K    command
132K    dev
16M     etc
10G     home
208K    kloxo-install
27M     lib
4.0K    media
4.0K    mnt
4.0K    opt
0       proc
40K     root
25M     sbin
284K    script
4.0K    selinux
4.0K    service
4.0K    srv
0       sys
90M     targz1
32K     tmp
1.6G    usr
error

Find the next subdirectory after the `usr` subdirectory . Here is `var` subdirectory:
largest directory

Step 4: change directory to the largest subdirectory. And do the loop with step 3, you can find the largest file (subdirectory).

cd var

Step 5: Delete file or subdirectory…

rm -rf /var/qmail/queue/

1 Comment

Leave a Reply