linux – most used disk directory

Sometimes system troble occur by the disk space problem. we can check root cause by some command.

Volume usage per partition

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        482M     0  482M   0% /dev
tmpfs           492M     0  492M   0% /dev/shm
tmpfs           492M  516K  492M   1% /run
tmpfs           492M     0  492M   0% /sys/fs/cgroup
/dev/xvda1      9.0G  8.3G  798M  92% /
tmpfs            99M     0   99M   0% /run/user/1000

Most used disk directory

Under /

# du -s /* | sort -rn | head -10
4093372 /var
4069492 /usr
160072  /opt
53264   /etc
34652   /boot
7016    /home
548     /run
300     /root
4       /tmp
0       /sys

Under /var/

# du -s /var/* | sort -rn | head -10
1474252 /var/lib
1048576 /var/swpfile
997256  /var/log
390368  /var/cache
182480  /var/www
484     /var/opt
16      /var/spool
0       /var/yp
0       /var/tmp
0       /var/run

Check journal file size

Check size and delte files which are before 3 days

# journalctl --disk-usage
Archived and active journals take up 989.0M on disk.

# journalctl --vacuum-time=3d

About: wpadmin


Leave a Reply

Translate »