Linux checks that the disk space is full through df -h, but the actual occupation is not so large

Recently, the project site often reported that the disk is full, but the actual usage is not so much, resulting in inoperability. After remote viewing, it is indeed the case. Now the relevant solutions are recorded as follows:

  1. View existing hard drives
df -h

insert image description here
2. Check the actual occupancy again

// 切换到要目录下
cd /
// 查看实际占用
du -sh *

insert image description here
3. Exclude other problems such as inode

// 查看inode情况
df -hi

insert image description here
4. After analyzing the reason, the relevant files are deleted, but the process is still remaining, and further processing is required

// 删除对应的进程号
lsof | grep delete | xargs kill -9 

Note: If a warning pops up, please execute the following command first:

// 剔除不能检查的文件系统
lsof -e /run/user/1000/gvfs

5. After the completion, check with df -h and find that the disk is normal
insert image description here

Guess you like

Origin blog.csdn.net/jinba225/article/details/109506282