1.問題描述ide
no space left on device(磁盤空間不足)spa
2.文件刪除原理rest
(1)硬連接數爲0(全部硬連接均被刪除)日誌
(2)進程調用數爲0(沒有進程在調度文件)orm
3.緣由分析進程
硬連接數爲0,進程調度數不爲0it
4.過程演示table
(1)建立大文件class
[root@qyn ~]# seq 500000000 > /var/log/messages |
(2)查看磁盤使用狀況原理
[root@qyn ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 19G 6.1G 12G 35% / |
(3)刪除日誌文件/var/log/messages
[root@qyn ~]# rm -rf /var/log/messages |
(4)查看空間是否被釋放
[root@qyn ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 19G 6.1G 12G 35% / |
(5)查看文件還被哪些進程調用
[root@qyn ~]# lsof | grep delete rsyslogd 2839 root 1w REG 8,3 4888888898 393106 /var/log/messages (deleted) |
(6)重啓對應的服務
[root@qyn ~]# /etc/init.d/rsyslog restart Shutting down system logger: [ OK ] Starting system logger: [ OK ] |
(7)檢查磁盤使用狀況
[root@qyn ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 19G 1.5G 17G 9% / |
問題已經解決了,是否是很神奇,剛開始接觸我也以爲太難以想象了,知識是要不斷擴展的,fighting!