[ext4]08 磁盘布局 - CheckSums
从2012年开始,Ext4和jbd2的元数据中都开始加入checksums。特性标识是metadata_csum。Checksum算法是在super_block中指定:
struct ext4_super_block {
…
__u8 s_log_groups_per_flex; /* FLEX_BG group size */
__u8 s_checksum_type; /* metadata checksum algorithm used */
…
}
但是在当前版本(3.13)中,依旧仅支持一种校验算法CRC32c。
在Ext4系统中,并不是所有的元数据校验值都是保存全部的32校验和,某些元数据因为考虑到数据结构的兼容性问题仅保存校验和的低16位数值。到那时如果开启64bit特性,所有的元数据校验值将保存全部的32位校验和。
Ext4系统中使用CRC32校验的元数据:
|
Metadata |
Length |
Ingredients |
|
Superblock |
__le32 |
The entire superblock up to the checksum field. The UUID lives inside the superblock. |
|
MMP |
__le32 |
UUID + the entire MMP block up to the checksum field. |
|
Extended Attributes |
__le32 |
UUID + the entire extended attribute block. The checksum field is set to zero. |
|
Directory Entries |
__le32 |
UUID + inode number + inode generation + the directory block up to the fake entry enclosing the checksum field. |
|
HTREE Nodes |
__le32 |
UUID + inode number + inode generation + all valid extents + HTREE tail. The checksum field is set to zero. |
|
Extents |
__le32 |
UUID + inode number + inode generation + the entire extent block up to the checksum field. |
|
Bitmaps |
__le32 or __le16 |
UUID + the entire bitmap. Checksums are stored in the group descriptor, and truncated if the group descriptor size is 32 bytes (i.e. ^64bit) |
|
Inodes |
__le32 |
UUID + inode number + inode generation + the entire inode. The checksum field is set to zero. Each inode has its own checksum. |
|
Group Descriptors |
__le16 |
If metadata_csum, then UUID + group number + the entire descriptor; else if uninit_bg, then crc16(UUID + group number + the entire descriptor). In all cases, only the lower 16 bits are stored. |
[ext4]08 磁盘布局 - CheckSums的更多相关文章
- [ext4]04 磁盘布局 - Meta Block Groups
Meta Block Groups,可以翻译为元块组集. 如果不采用Meta Block Groups特性,在每个冗余备份的超级块的后面是一个完整的(包含所有块组描述符的)块组描述符表的备份.如前所述 ...
- [ext4]07 磁盘布局 - 块/inode分配策略
Ext4系统从设计上就认为数据局部性是文件系统的文件系统的一个理想品质. 在机械硬盘上,相关联的数据存放在相近的blocks上,可以使得在访问数据时减少磁头驱动器的移动距离,从而加快IO访问. 在SS ...
- [ext4]06 磁盘布局 - 特殊inode
Ext4预留了一些inode做特殊特性使用,见下表: inode Purpose 0 不存在,Ext4中不存在inode 0. 1 存放损坏的数据块链表 2 根目录 3 User quota. 用户q ...
- [ext4]010 磁盘布局 - 如何查找inode的磁盘位置
在linux系统中,任何一个文件,都有一个inode与其对应,也就是说,在一个文件系统中,一个文件都有唯一的ino来标示他,那么在ext4系统中,ino是如何确定的哪? 当我们新创建的文件或目录时,会 ...
- [ext4]03 磁盘布局 – Flexible group分析
Flexible Block Groups (flex_bg),我称之为"弹性块组",是EXT4文件系统引入的一个feature. 所谓Flexible Block Groups, ...
- [ext4]05 磁盘布局 - 延迟块组初始化
延迟块组初始化,Ext4的新特性.如果对应的特性标识uninit_bg置位,那么inode bitmap和inode tables就不会初始化. 延迟块组初始化特性特性可以减少格式化耗时. 延迟块组初 ...
- [ext4]09 磁盘布局 - superblock备份机制
如果sparse_super特性flag被设置(即开启了sparse_super特性),那么super_block和组描述符的副本只会保存在group索引为0或3.5.7的整数幂. 如果没有设置spa ...
- [ext4]01 磁盘布局 - block分析
ext4文件系统最基本的分配单元是"block"(块). block是由一组连续的sectors来组成,其大小介于1k~4K之间,当然不可能是任意值,只能是2的整数次幂个secto ...
- [ext4]磁盘布局 - inode bitmap & table
在[磁盘布局 group部分]已经介绍过ext4的整体布局,其中存在两个与inode有关的名称:inode bitmap和inode table. Inode bitmap,用于表示inode tab ...
随机推荐
- Java 中的数组
1.声明数组String [] arr;int arr1[];String[] array=new String[5];int score[]=new int[3]; 2.初始化数组://静态初始化i ...
- 如何在container中编译dotnet的eShopOnContainers
准备的软件 问题 Image下载问题 以下就是为啥要有最后一个软件(我是使用版): SQLSever for Linux 内存需求 需要编译Image 成功搞定 参考 Welcome to t ...
- Python中的日期和时间
感觉C语言作为一门编程的入门语言还是很好的,相比较之下,Python为代表的一些语言,适合很多非计算机专业的编程入门学习. Python 日期和时间 Python 程序能用很多方式处理日期和时间,转换 ...
- (22)Properties,这不会Io流中的类,但是通常和IO流中的一些流配合使用
可以和流相关联的集合对象Properties. Map |--Hashtable |--Properties Properties:该集合不需要泛型,因为该集合中的键值对都是String类型.既然是m ...
- linux上执行 xhost unable to open display
linux下执行xhost命令报错:unable to open display,解决方法,linux 下通过xhost进入图形界面,经常会出现报错"unable to open disp ...
- cuda学习笔记——deviceQuery
main(int argc, char **argv):argc是参数个数,**argv具体的参数,第0个是程序全名 cudaError_t类型:记录cuda错误,值为cudaSuccess则正确执行 ...
- JS中有关对象的继承以及实例化、浅拷贝深拷贝的奥秘
一.属性的归属问题 JS对象中定义的属性和方法如果不是挂在原型链上的方法和属性(直接通过如类似x的方式进行定义)都只是在该对象上,对原型链上的没有影响.对于所有实例共用的方法可直接定义在原型链上这样实 ...
- webStorm在Node.js平台下服务器配置及Express配置
************************************** 本博客从此篇开始,将从零基础开始逐渐深入地向各位博友分享node.js学习经验,如有需要请通过新浪微博@牙疼格尔联系博主, ...
- SQLServer中间接实现函数索引或者Hash索引
本文出处:http://www.cnblogs.com/wy123/p/6617700.html SQLServer中没有函数索引,在某些场景下查询的时候要根据字段的某一部分做查询或者经过某种计算之后 ...
- Spring定时任务解决博客缓存数据更新问题
最近在做博客系统的时候,由于很多页面都有右边侧边栏,内容包括博客分类信息,归档日志,热门文章,标签列表等,为了不想每次访问页面都去查询数据库,因为本身这些东西相对来说是比较固定的,但是也有可能在网站后 ...