[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 ...
随机推荐
- python + selenium <一>
python 安装 python 下载地址: http://python.org/getit/ ez_setup.py 下载地址: https://pypi.python.org/packages/s ...
- ps-色彩饱和度的设计
1- 图层区—复制背景图层 防止原图修改失败后无法还原 2- 选项区——选择—色彩范围 以色彩为标准来对图片进行选区 3- 点击图片上 ...
- 【转】如何成为一位优秀的创业CEO
编者按:本文来自 Ryan Allis,是一位来自旧金山的创业者和投资人.在 2003 年创立了 iContact,并任 CEO. 做创业公司的 CEO 可以说是世界上最有挑战性的事情之一.你得让客户 ...
- session的使用
一.什么是session? Session:在计算机中,尤其是在网络应用中,称为“会话控制”.Session 对象存储特定用户会话所需的属性及配置信息.这样,当用户在应用程序的 Web 页之间跳转时, ...
- CCNA网络工程师学习进程(10)NAT的配置
NAT(Network Address Translation,网络地址转换)是将IP 数据包头中的IP 地址转换为另一个IP 地址的过程. (1)NAT简介: 在实际应用中,NAT ...
- For循环及例题
For循环 (1)循环操作某一个功能(执行某段代码) (2)四要素 循环初始值 循环条件 ...
- 【Java基础 】Java7 NIO Files,Path 操作文件
从Java1.0到1.3,我们在开发需要I/O支持的应用时,要面临以下问题: 没有数据缓冲区或通道的概念,开发人员要编程处理很多底层细节 I/O操作会被阻塞,扩展能力有限 所支持的字符集编码有限,需要 ...
- python 、mmap 实现内存数据共享
import mmap mmap_file = None ##从内存中读取信息, def read_mmap_info(): global mmap_file mmap_file.seek(0) ## ...
- jemeter正则表达式
- as3 操作图片,获取,设置实际像素,扣除透明区域
private var a:Loader = new Loader(); private function test():void { a.load(new URLRequest("asse ...