免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1958 | 回复: 2
打印 上一主题 下一主题

卸载ext2 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-27 21:30 |只看该作者 |倒序浏览
ext2在每个块组中都保存了super block和block group descriptor的副本。但卸载ext2时,在sys_umount > do_umount > fsync_dev > sync_supers中,只把缓冲区的内容冲刷到第一个块组的super block中,这样岂不是要造成第一个super block副本和
其他副本内容不一致?

另外,当挂载ext2时,e2fsck是从哪些方面对super block的一致性进行检查的呢?我猜测是把各个块组描述结构(ext2_group_desc)
的bg_free_blocks_count成员加起来,若其和等于ext2_super_block结构的s_free_blocks_count,就是一致的;否则不一致。
不知我想得对不对?

[ 本帖最后由 gta 于 2007-10-27 21:33 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-10-28 12:56 |只看该作者
第一个问题搞懂了,ulk3有讲到
As you can see from Figure 18-1, both the superblock and the group descriptors are duplicated in each block group. Only the superblock and the group descriptors included in block group 0 are used by the kernel, while the remaining superblocks and group descriptors are left unchanged; in fact, the kernel doesn't even look at them. When the e2fsck program executes a consistency check on the filesystem status, it refers to the superblock and the group descriptors stored in block group 0, and then copies them into all other block groups. If data corruption occurs and the main superblock or the main group descriptors in block group 0 become invalid, the system administrator can instruct e2fsck to refer to the old copies of the superblock and the group descriptors stored in a block groups other than the first. Usually, the redundant copies store enough information to allow e2fsck to bring the Ext2 partition back to a consistent state.

第二个问题还是没解决

论坛徽章:
0
3 [报告]
发表于 2007-10-29 08:52 |只看该作者
呵呵,看看e2fsck的源码不就知道e2fsck到底干了什么了吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP