Sunday, February 22, 2009

/var: create/symlink failed, no inodes free

还没有见过这样的问题:
/var: create/symlink failed, no inodes free

没有空间了吗?使用df -h 怎么看都还有空间!细看才体会到这里提的inodes的意义!

google了一把,才知道df命令有一个参数是显示partition的inodes的

[jessinio@demo2 /var/db/portsnap]$ df -hi
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/ad0s1a 496M 288M 168M 63% 3912 61878 6% /
devfs 1.0K 1.0K 0B 100% 0 0 100% /dev
/dev/ad0s2d 79G 38G 35G 52% 931619 9808091 9% /data0
/dev/ad0s1e 496M 15M 441M 3% 1146 64644 2% /tmp
/dev/ad0s1f 24G 19G 3.3G 85% 936629 2360649 28% /usr
/dev/ad0s1d 1.9G 1.3G 431M 76% 262862 19760 93% /var
/usr/ports 24G 19G 3.3G 85% 936629 2360649 28% /data0/jails/trac10/usr/ports
/usr/src 24G 19G 3.3G 85% 936629 2360649 28% /data0/trac11/usr/src
/usr/ports 24G 19G 3.3G 85% 936629 2360649 28% /data0/trac11/usr/ports
devfs 1.0K 1.0K 0B 100% 0 0 100% /data0/jails/trac10/dev


在/var目录下发现/var/db/portsnap/files有20000左右个文件:
ls /var/db/portsnap/files|wc -l

使用脚本去删除之:

opendir DIR,"/var/db/portsnap/files";
for (readdir DIR){
system "rm", "/var/db/portsnap/files/" . $_;
}
close DIR;

* BTW: 不知道当时为什么不使用rmdir去删除, SB了!!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.