Catalogue
When du shows the device is almost full and you have to delete something

When du shows the device is almost full and you have to delete something

🌐 日本語で読む

Oops!
It’s completely full…

That’s the situation I ran into.
When I tried to install a certain module, it filled up the disk all at once.

1
2
3
4
5
6
ファイルシス   サイズ  使用  残り 使用% マウント位置
/dev/xvda1 8.0G 8.0G 0M 100% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.7G 0 3.7G 0% /dev/shm
tmpfs 3.7G 17M 3.7G 1% /run
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup

Checking file sizes within directories

    1. Move to the target device and check file sizes
    1. From there, check the locations where files are large

Repeating steps 1 and 2 above makes it easier to pin down the cause.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
対象デバイスに移動し、ファイル容量チェック
$ cd /
$ sudo du -sh * | sort -nr

385M root
267M opt
117M home
79M boot
22M etc
17M run
3.1G usr
2.7M tmp
4.3G var ← /var がサイズが大きい
0 sys
0 srv
0 sbin
0 proc
0 mnt
0 media
0 lib64
0 lib
0 dev
0 bin

$ sudo find /var -size +100M -exec ls -lh {} \;

You could also search for archive files that are no longer needed after extraction, such as -name ‘*.tar.gz’.

Please also refer to my earlier post.
The yum cache can quietly grow huge before you even notice.

After deleting various things,
I managed to free up about 30%. Phew.

I really need to keep a close eye on monitoring.

kenzo0107

kenzo0107