Apr 152007
 

今天状态十分差,什么都没做好,还净干傻事。

刚才在调试自己的FreebBSD box来玩ZFS的时候,因为7-Current的一个配置文件路径的变更,/etc/zfs被挪到了/boot/zfs下。我本意是要删除/etc/zfs的,结果不知怎么在敲到rm -rf /etc的时候就按下了回车,当回过神来的时候,就对着那个“#”欲哭无泪…..

还好只是自己玩的系统,不然损失就大了,即使是这样,也要想办法尽可能的挽回。简单想了一下,目前对于这个box上etc下面我并没有作太大的修改,几乎自己改过的配置应该都还记得是哪些文件,所以问题的焦点就在于:怎么把原始的/etc文件弄回来。

其实这本也应该不是什么困难的事情,只需要从安装CD中恢复一份原始copy即可,可我这个box是没光驱的!即使是ISO,我也没有7-Current的!而在现在/etc整个消失的情况下,可以说是几乎所有的网络工具都瘫痪-_-

再仔细想了一下,刚好前两天刚做过make world,而/usr/src下面的东西还没删除,就从这里入手了!第一个想到的就是mergemaster,运行失败,提示找不到root用户-_-…..ah……出歪招了,touch /etc/passwd /etc/master.passwd /etc/group,然后mergemaster -p,提示cvs id更新,一阵窃喜,一路i下去,这样最重要的用户和组结构就恢复了,立刻passwd root改密码,接下来就是mergemaster -U,满屏的create,i按到手软,终于创建完了,哈哈。

剩下的就是清理工作了,该改配置的改配置。

  3 Responses to “超低级失误–误删除/etc”

  1. Nearly all of whatever you state is supprisingly appropriate and that makes me ponder why I had not looked at this in this light previously. Your article really did turn the light on for me personally as far as this particular subject goes. Nevertheless there is actually one point I am not really too comfortable with and whilst I make an effort to reconcile that with the actual central theme of your issue, permit me observe exactly what all the rest of your subscribers have to say.Nicely done.

  2. I have read so many content about the blogger lovers however this paragraph is genuinely a nice post, keep it up.

  3. If you are going for most excellent contents like me,
    just go to see this site every day since it offers quality contents, thanks

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>