昨晚服务器意外出现Directory not empty故障

昨晚在编写一个用于自动抓取一些域名到期信息并进行过滤整理的shell脚本时,不甚操作不当,导致出现服务器上一个目录无法删除,使用rm -rf也无效,目录中原有文件和新创建的文件均无法查看,使用ls -al也无任何显示,有点“黑洞”的感觉,明明里面有东西,却无法显示,新创建文件也看不到,想删除目录还无法删除,以前没有遇到过这样的故障,于是尝试若干办法还是未能收到效果,反倒搞得该目录的上级目录出现混乱,部分其他目录也出现了类似情况,大呼不妙,迫不得已进行远程重启,无奈重启失败,今天一早到了机房,从错误日志上一看,明白了故障所在。

这样的故障一般会出现在ports软件升级突然中断,或者有关磁盘目录创建删除等操作的程序意外中断时,而且也不是总能出现,还得有很多偶然情况发生赶巧了才能遇到。我之前的脚本在调试过程中放入了后台运行,结果意外被我中断并重新运行,结果导致了目录中.的指向错误,进而导致一个后台的fsck失败,这样日志中就看到了类似这样的错误信息
PARTIALLY TRUNCATED INODE I=316169
UNEXPECTED SOFT UPDATE INCONSISTENCY; RUN fsck MANUALLY.

于是有了解决思路,重启后 boot -s进入单用户模式,运行fsck -p ,再次重启,问题解决:)总的来说算是有惊无险!

其实过后查询文档知道如果遇到那样的目录错误,可以使用 chflags -R noschg 进行处理,实在不行再重启 fsck -p

不知道有没有高人对这样的故障有另外的指点?freebsd总是这样让我又爱又恨,听说最近Release 6.1出来了,有时间升级一下。

1 thought on “昨晚服务器意外出现Directory not empty故障”

  1. Can I simply say what a reduction to search out someone who truly knows what theyre talking about on the internet. You definitely know how you can carry a problem to light and make it important. More individuals must learn this and perceive this side of the story. I cant imagine youre not more standard since you definitely have the gift.

  2. Pingback: air jordan shoes
  3. Pingback: yeezy boost 500
  4. Pingback: nike shoes
  5. Pingback: nba jerseys
  6. Pingback: adidas stan smith
  7. Pingback: gucci belts
  8. Pingback: kobe 11
  9. Pingback: yeezy boost 350
  10. Pingback: yeezy boost 350 v2
  11. Pingback: air jordan shoes
  12. Pingback: hermes belt
  13. Pingback: nike huarache
  14. Pingback: kd shoes
  15. Pingback: bape hoodie
  16. Pingback: adidas ultra boost
  17. Pingback: nike hyperdunk
  18. My programmer is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on a
    variety of websites for about a year and am nervous about switching to another platform.
    I have heard good things about blogengine.net. Is there a way I
    can transfer all my wordpress posts into it? Any kind of help would be greatly appreciated!

  19. Right here is the perfect blog for everyone who would like to
    find out about this topic. You know so much its almost tough to argue with you (not that I actually would want to…HaHa).
    You definitely put a brand new spin on a subject that’s been written about for decades.
    Wonderful stuff, just excellent!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image