首页 | 公司简介 | 数据恢复 | 成功案例 | 技术中心 | 客户服务 | 服务报价 | 联系我们 | 技术论坛  
 
  北京总部: 4006-505-808
  上 海 部: 021-58358765
  深 圳 部: 0755-83692929
  浙 江 部: 13666673722
  广 州 部: 020-83821091
  重 庆 部: 023-86870422
  福 建 部: 0591-83300680
  哈尔滨部: 13946167430
  其它地区: 4006-505-808

中国石油管理局-Oracle数据库恢
工商银行山东分行-AIX删除LV数
濮阳市地方税务局-CHKDSK后数据
台湾HD公司-FreeBSD Nas无法启
promise乔鼎硬盘阵列数据恢复成
IBM EXP300 磁盘阵列数据恢复成
NAS 8100无法挂载数据卷
Liteon-Dell 2850服务器数据恢

RAID损坏后 对数据的完整备份
LINUX FSCK数据出错灾难应急方
误删除、误格式化数据灾难应急
误GHOST、误一键恢复灾难应急方
磁盘未被格式化,是否格式化数据
raid磁盘阵列OFFLINE后的应急方
硬盘出现异响应急处理
您当前的位置:首页 >> 技术中心 >> 软件数据恢复文栏 >> 正文

The structure of the Reiser file system

For our example partition, part of the S+ tree looks like this (think of the key as a large 128-bit number for now):

The reiserfs S+-tree

Block headers

Each disk block that belongs to an internal or leaf node starts with a block header. Only unformatted blocks don't have a block header. A block header is always 24 bytes long and contains the following information:

The block header structure
Name Size Description
Level 2 level of the block in the tree
Nr. of items 2 number of items in the block
Free space 2 free space left in the block
Reserved 2  
Right key 16 right delimiting key for the block

The right delimiting key was originally used for leaf nodes but is now only kept for compatibility.

Example:

The following is the block header of block 8416, the leftmost leaf node in the tree.

00000000 01 00 06 00 e4 04 00 00 00 00 00 00 00 00 00 00  ....ä...........
00000010 00 00 00 00 00 00 00 00
Example of a block header

Level: 1
Items: 6
Free space: 1252 bytes

Keys

Keys are used in the Reiser file system to uniquely identify items, but also to locate them in the tree and achieve local groupings of items that belong together. A key consists of four objects: the directory id, the object id, the offset within the object, and a type. Note that the actual object identifier is only one part of the key. The directory id is present so that files that belong into the same directory are grouped together and for the most part are located in the same subtree(s). The offset is present because an indirect item can at most contain (blocksize-48)/4 pointers to unformatted blocks (see indirect items below). For a block size of 4096 bytes this would result in a maximum file size of 4048KB. To be able to handle larger files, multiple keys are used to reference the file. All fields of the key are the same, except for the offset, which denotes the offset in bytes of the file, which a particular key references. I do not know why the type of an object is part of the actual key.

In reiserfs up until version 3.5 the offset and the type fields were both 4 byte values. This meant, that the maximum file size was limited to roughly 2^32 bytes, or 4GB (2^32 bytes plus the data of one more indirect item plus the tail, actually). To increase the maximum file size in the file system, in version 3.6, the offset field was increased to 60 bits, and the type field shrunk to 4 bits. This now allows for a theoretical maximum file size of 2^60 bytes, but since there can be only 2^32 blocks with a maximum of 2^16 bytes per block, the file system itself only supports 2^48 bytes.

In order not to be incompatible to older versions of the file system, there are now to different versions of keys around, which can be very confusing as the key itself doesn't carry a version number. To make up for this, the formerly reserved last 16 bits of the item header now contain a version number, so if necessary, the key's version number can be obtained from there. This makes it fairly straightforward for keys contained in leaf nodes, but if one really wanted to determine the version of a key inside an internal node, one would have to follow the tree down to the leaf, first. The code in the reiserfs library actually uses this ugly hack to determine the key format:

本新闻共13页,当前在第03页  
01  02  03  04  05  06  07  08  09  10  
11  12  13  

上一篇:Solaris硬盘分区结构
下一篇:各类unix和linux管理员密码丢失解决方法
返回首页 | 联系我们 | 关于我们 | 招聘信息 | 友情链接 | 网站地图 | 合作伙伴

版权所有 北京北亚数据恢复中心
24小时免费咨询电话:4006-505-808 或 800-810-5880
中关村部:北京市海淀区中关村大街11号E世界A座832B室
皂君庙部:北京市海淀区学院南路68号吉安大厦C座(汇智楼)528室
京ICP备07502730