Hi,
I have a disk drive where the inode usage is 100% (using df -i command). However after deleting files substantially, the usage remain 100%.
Answer:
2
![]()
![]()
It's quite easy for a disk to have a large number of inodes used even if the disk is not very full.
An inode is allocated to a file so, if you have gazillions of files, all 1 byte each, you'll run out of inodes long before you run out of disk.
It's also possible that deleting files will not reduce the inode count if the files have multiple hard links. As I said, inodes belong to the file, not the directory entry. If a file has two directory entries linked to it, deleting one will not free the inode.
Additionally, you can delete a directory entry but, if a running process still has the file open, the inode won't be freed.
My initial advice would be to delete all the files you can, then reboot the box to ensure no processes are left holding the files open.
If you do that and you still have a problem, let us know.
By the way, if you're looking for the directories that contain lots of files, this script. may help:
#!/bin/bash
# count_em - count files in all subdirectories under current directory.
echo 'echo $(ls -a "$1" | wc -l) $1' >/tmp/count_em_$$
chmod 700 /tmp/count_em_$$
find . -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n
rm -f /tmp/count_em_$$
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/3637/viewspace-625365/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/3637/viewspace-625365/
本文探讨了磁盘inode使用率达到100%的情况,即使删除大量文件后仍无法降低inode使用率的问题。文章解释了inode与文件的关系,并提供了解决方案,包括重启系统确保所有进程关闭及推荐使用脚本查找包含大量文件的目录。
729

被折叠的 条评论
为什么被折叠?



