A
A
Alexander2019-01-28 12:46:24
linux
Alexander, 2019-01-28 12:46:24

How to find out what is taking up disk space centos?

du-hsx /*

0       /backup
0       /bin
212M    /boot
0       /dev
37M     /etc
3.2G    /home
0       /lib
0       /lib64
0       /media
0       /mnt
124M    /opt
du: cannot access ‘/proc/24620/task/24620/fd/4’: No such file or directory
du: cannot access ‘/proc/24620/task/24620/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/24620/fd/4’: No such file or directory
du: cannot access ‘/proc/24620/fdinfo/4’: No such file or directory
0       /proc
11M     /root
57M     /run
0       /sbin
0       /srv
0       /sys
76K     /tmp
1.5G    /usr
1.5G    /var

df-h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   23G  2.3G  92% /
devtmpfs        476M     0  476M   0% /dev
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           497M   63M  434M  13% /run
tmpfs           497M     0  497M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/0

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir Kuts, 2019-01-28
@fox_12

Execute:
Find the directory where the largest size will be displayed
Then
and execute this command further, going down into the directories until you find the required

P
pfg21, 2019-01-28
@pfg21

put the tool ncdu - the same du only with a console interface on ncurses.
there is an option -x to exclude directories with mounted fs - convenient to eerily.
There is a built-in function for deleting files.

K
ky0, 2019-01-28
@ky0

dumay show different dfnumbers in case the file is deleted, but the descriptor still exists (read - someone is using the file). In this case, the space on the FS is not released. You can find such files, for example, lsof`om.

V
Vladimir Zp, 2019-02-02
@Zeroxzed

Your situation is described in detail here https://serveradmin.ru/disk-zanyat-na-100-i-ne-pon...
In short, some file was most likely deleted, to which some service writes. At the same time, the service was not warned about the deletion and it continues to write. You need to restart this service. This often happens when the web server logs are simply deleted and not restarted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question