eduardofsj

Member
Sep 15, 2019
6
0
1
Brazil
cPanel Access Level
Root Administrator
I have problem, my root disk is always full but I don't find any tutorial on how to solve this problem, and it is very likely that my logs are full, I clean them but not much, someone could help me how to make a Good space so I can't worry for a long time.


Bash:
[[email protected] ~]# df -l
Sist.fichs      1K-blocos     Ocup     Livres Uso% Montado em
devtmpfs         16207524        0   16207524   0% /dev
tmpfs            16220084        0   16220084   0% /dev/shm
tmpfs            16220084  1312788   14907296   9% /run
tmpfs            16220084        0   16220084   0% /sys/fs/cgroup
/dev/sdc2        20026236 18985988          0 100% /
/dev/sda        461360000 11910716  425990324   3% /nvmehome1
/dev/sdc1          522228     3812     518416   1% /boot/efi
/dev/sdb        461360000    73768  437827272   1% /nvmehome2
/dev/loop0         487652     2380     459672   1% /tmp
/dev/sdc3      3824386440 18880112 3611215640   1% /home
tmpfs             3244020        0    3244020   0% /run/user/0
 

Attachments

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
A useful command for identifying the allocation of disk space usage is the following:

This is done per directory so you'd run the following to get to the top level:

Code:
cd /
Then:

Code:
du -h --max-depth=1

For efficiency, I'll even do the following to just show allocation over 1G:

Code:
du -h --max-depth=1|grep G
 

eduardofsj

Member
Sep 15, 2019
6
0
1
Brazil
cPanel Access Level
Root Administrator
A useful command for identifying the allocation of disk space usage is the following:

This is done per directory so you'd run the following to get to the top level:

Code:
cd /
Then:

Code:
du -h --max-depth=1

For efficiency, I'll even do the following to just show allocation over 1G:

Code:
du -h --max-depth=1|grep G

I got the following command information.

Bash:
[[email protected] /]# du -h --max-depth=1|grep G
11G     ./usr
12G     ./nvmehome1
54G     ./home
du: impossível aceder a «./proc/763919/task/763919/fd/4»: No such file or directory
du: impossível aceder a «./proc/763919/task/763919/fdinfo/4»: No such file or directory
du: impossível aceder a «./proc/763919/fd/3»: No such file or directory
du: impossível aceder a «./proc/763919/fdinfo/3»: No such file or directory
du: impossível aceder a «./proc/763926»: No such file or directory
du: impossível aceder a «./proc/763927»: No such file or directory
6,3G    ./var
83G

Bash:
[[email protected] /]# du -h --max-depth=1
11G     ./usr
4,0K    ./srv
19K     ./tmp
15M     ./ovh
12G     ./nvmehome1
4,0K    ./mnt
346M    ./run
88M     ./backups
8,0K    ./backup
4,0K    ./media
53G     ./home
0       ./sys
0       ./dev
36K     ./nvmehome2
70M     ./etc
205M    ./boot
34M     ./root
16K     ./lost+found
4,0K    ./nvmecd
624M    ./opt
du: impossível aceder a «./proc/764690/task/764690/fd/4»: No such file or directory
du: impossível aceder a «./proc/764690/task/764690/fdinfo/4»: No such file or directory
du: impossível aceder a «./proc/764690/fd/3»: No such file or directory
du: impossível aceder a «./proc/764690/fdinfo/3»: No such file or directory
du: impossível aceder a «./proc/764743»: No such file or directory
0       ./proc
6,3G    ./var
82G     .

The problem is how to clean these files, already put to clean the tmp folder, but still have problem with full root, this causes inconvenience like mysql stop working and etc.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hello,

The problem is how to clean these files, already put to clean the tmp folder, but still have problem with full root, this causes inconvenience like mysql stop working and etc.
You're a step ahead, this doesn't show you what can/needs to be removed at this point. This identifies the locations where the most disk space is allocated.

For you the primary locations are:

Code:
11G     ./usr
12G     ./nvmehome1
54G     ./home
6,3G    ./var
Based on the output of df you provided earlier, nvmehome1 is on a separate mount so you can safely ignore that when looking at issues with disk space for /

Code:
/dev/sda        461360000 11910716  425990324   3% /nvmehome1
home is also on a separate mount:
Code:
/dev/sdc3      3824386440 18880112 3611215640   1% /home
and as such can be ignored in this respect as well.

tmp doesn't have any impact on what's consuming disk space on / so while ensuring that it's maintained is good it's not going to resolve the issues.

This leaves you with /var and /usr as your primary culprits. To investigate further run that command from the /var directory and the /usr directory
 

eduardofsj

Member
Sep 15, 2019
6
0
1
Brazil
cPanel Access Level
Root Administrator
Hello,



You're a step ahead, this doesn't show you what can/needs to be removed at this point. This identifies the locations where the most disk space is allocated.

For you the primary locations are:

Code:
11G     ./usr
12G     ./nvmehome1
54G     ./home
6,3G    ./var
Based on the output of df you provided earlier, nvmehome1 is on a separate mount so you can safely ignore that when looking at issues with disk space for /

Code:
/dev/sda        461360000 11910716  425990324   3% /nvmehome1
home is also on a separate mount:
Code:
/dev/sdc3      3824386440 18880112 3611215640   1% /home
and as such can be ignored in this respect as well.

tmp doesn't have any impact on what's consuming disk space on / so while ensuring that it's maintained is good it's not going to resolve the issues.

This leaves you with /var and /usr as your primary culprits. To investigate further run that command from the /var directory and the /usr directory

Obtain the following information.

Bash:
[[email protected] var]# du -h --max-depth=1|grep G
3,3G    ./lib
1,6G    ./cache
5,9G    .

[[email protected] var]# du -h --max-depth=1
4,0K    ./yp
12K     ./kerberos
45M     ./lve
19K     ./tmp
4,0K    ./crash
4,0K    ./adm
4,0K    ./games
4,0K    ./nis
1,1M    ./named
3,3G    ./lib
64K     ./www
4,0K    ./preserve
24M     ./log
183M    ./spool
1,6G    ./cache
1,6M    ./db
4,0K    ./gopher
529M    ./cpanel
4,0K    ./account
8,0K    ./empty
4,0K    ./opt
200M    ./softaculous
4,0K    ./local
5,9G    .

Code:
[[email protected] usr]# du -h --max-depth=1|grep G
1,1G    ./lib
6,9G    ./local
11G     .

[[email protected] usr]# du -h --max-depth=1
12K     ./src
619M    ./lib64
483M    ./sbin
4,0K    ./games
35M     ./include
4,0K    ./selector
1,1G    ./lib
686M    ./share
486M    ./bin
4,0K    ./etc
4,0K    ./selector.etc
66M     ./libexec
6,9G    ./local
11G     .


I saw that the cache is occupying a good part too, can I delete something? I am afraid to clean something and the problem later, so I am asking for help.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
It really depends on what is being cached. A lot of that stuff you wouldn't want to remove necessarily. I'd also assume the data in /var/lib is most likely attributed to MySQL and most likely can't be removed, the same with the data in /usr/local/ - this would most likely be attributed to the cPanel installation.

Your root partition is pretty small, and you'll have to do some serious digging into the items present to resolve this. Ultimately you may want to enlist the assistance of a qualified system administrator. If you don't have one you might find one here: System Administration Services