最近一台机器出现过几次磁盘使用量报警的情况,经过排查,出现下面的问题
df -lh
/dev/sda3 12G 10G 1.1G 91% /usr
使用超过91%了,需要删除一些文件,但是查看磁盘使用情况
du -sm /usr/*|awk '{sum+=$1}END{print sum}'
使用5191M空间,占用不到50%,这是什么情况呢?
经过咨询,是因为之前升级php的时候,虽然将原始的php文件夹(约5G)删除了,但是服务器上还有php进程没有重启,还在占用这个文件夹内的文件,所以导致文件夹删除了,但是实际空间没有释放,系统还是显示占用了10G空间(刚才计算出来的5G+未释放的5G),所以需要重启这个进程,以便让系统真正释放空间。
lsof|grep delete
php 329 root txt REG 8,3 21235668 1606441 /usr/local/php-5.2.17/bin/php (deleted)
php 329 root 9r REG 8,1 1519 32829 /etc/hosts~ (deleted)
jpool_age 1451 root 2u CHR 136,0 2 /dev/pts/0 (deleted)
jpool_age 1454 root 2u CHR 136,0 2 /dev/pts/0 (deleted)
jpool_age 1454 root 3u REG 8,7 0 57737233 /data0/trunk/soft/agent/.jpool_agent.lock (deleted)
php 4879 root txt REG 8,3 21235668 1606441 /usr/local/php-5.2.17/bin/php (deleted)
sh 5155 root 0u CHR 136,3 5 /dev/pts/3 (deleted)
sh 5155 root 1u CHR 136,3 5 /dev/pts/3 (deleted)
sh 5155 root 2u CHR 136,3 5 /dev/pts/3 (deleted)
php 6145 root txt REG 8,3 21278898 1153063 /usr/home/lvbin1/php-lvbin/bin/php (deleted)
sh 10208 root 1w REG 8,3 5314007509 1344408 /usr/home/xianjun/logs-admin/stats (deleted)
sh 10208 root 2w REG 8,3 5314007509 1344408 /usr/home/xianjun/logs-admin/stats (deleted)
php 13263 root txt REG 8,3 21235668 1606441 /usr/local/php-5.2.17/bin/php (deleted)
php 13964 root txt REG 8,3 21278898 1153063 /usr/home/lvbin1/php-lvbin/bin/php (deleted)
sleep 22755 root 1w REG 8,3 5314007509 1344408 /usr/home/xianjun/logs-admin/stats (deleted)
sleep 22755 root 2w REG 8,3 5314007509 1344408 /usr/home/xianjun/logs-admin/stats (deleted)
php 23202 root 2u CHR 136,6 8 /dev/pts/6 (deleted)
sleep 23303 root 0u CHR 136,1 3 /dev/pts/1 (deleted)
sleep 23303 root 1u CHR 136,1 3 /dev/pts/1 (deleted)
sleep 23303 root 2u CHR 136,1 3 /dev/pts/1 (deleted)
sleep 23448 root 0u CHR 136,2 4 /dev/pts/2 (deleted)
sleep 23448 root 1u CHR 136,2 4 /dev/pts/2 (deleted)
sleep 23448 root 2u CHR 136,2 4 /dev/pts/2 (deleted)
sh 26088 root 0u CHR 136,1 3 /dev/pts/1 (deleted)
sh 26088 root 1u CHR 136,1 3 /dev/pts/1 (deleted)
sh 26088 root 2u CHR 136,1 3 /dev/pts/1 (deleted)
过滤一下/usr目录的内容发现以前删除的目录还在,so...
lsof|grep php-lvbin
php 6145 root txt REG 8,3 21278898 1153063 /usr/home/lvbin1/php-lvbin/bin/php (deleted)
php 13964 root txt REG 8,3 21278898 1153063 /usr/home/lvbin1/php-lvbin/bin/php (deleted)
查看进程6145和13964还在呢,所以重启这两个任务就可以了。
阅读(3477) | 评论(0) | 转发(1) |