存档

文章标签 ‘ext3’

恢复ext3文件系统上被删除的文件

2009年7月22日 wgzhao 没有评论

是的,我知道ext3文件系统上,一旦文件被删除(rm -rf ),就几乎没有恢复的可能。而且从ext3文件系统的FAQ中提到的一条也能印证这点:

Q: How can I recover (undelete) deleted files from my ext3 partition?

Actually, you can’t! This is what one of the developers, Andreas Dilger, said about it:

In order to ensure that ext3 can safely resume an unlink after a crash, it actually zeros out the block pointers in the inode, whereas ext2 just marks these blocks as unused in the block bitmaps and marks the inode as “deleted” and leaves the block pointers alone.

Your only hope is to “grep” for parts of your files that have been deleted and hope for the best.

但是,但是,这不是事实的全部,被删除文件的所有信息可能都还在磁盘上,包括块指针。
阅读全文…

分类: Linux技术 标签: , ,

缩小逻辑卷中PV物理分区大小的一个例子

2008年7月17日 wgzhao 没有评论

我把硬盘上超过80%的空间都给了LVM,之后我需要从LVM中划出一个空间出来用作基本文件系统,上面的数据非常多,而且我也没有地方可以挪,之前的思路一直都是把重要数据挪走,然后重新分区,然后把数据拷贝回来。
阅读全文…

分类: Linux技术 标签: , , ,

你需要多少inodes

2008年4月13日 wgzhao 4 条评论

Johnwoolee打电话问我如何计算一个固定大小的分区的inodes个数,也就是inodes和blocksize之间的计算关系。
我记得以前我接触过这个问题,记得和一个比率参数有关系。再次参看mkfs.ext3的man手册,记忆唤起来了,同时也增加了新的认识。

mkfs.ext3缺省情况下,是根据blocksize和bytes-per-inode来计算出一个文件系统在格式化时有多少inodes的。不过,我觉得应该之和bytes-per-inode有关,因为mkfs.ext3会根据每一个bytes-per-inode大小来创建一个inode,因此刨除保留块,超级块外,一个分区剩下的大小除以这个bytes-per-inode就大约是inode的个数。
阅读全文…