作者:Carlo Wood
时间:2008年4月
作者网站:http://code.google.com/p/ext3grep/
翻译者:www_xylove(网络ID)
时间:2013年1月27日
说明:翻译这个软件的功能主要是想证明一下自己的英文水平,顺便推广一下Carlo Wood写的这个ext3grep工具,当然,这个工具很可能很多人都已经知道了,因为毕竟是作者2008年写的,但是还可能有些读者不知道这个工具,所以,顺便推广一下罢了,其实这个工具实在是太重要了,在这个工具之前,rm -rf 删除了文件,是不可能恢复的,这个连ext3文件系统的开发者Andreas Diger都承认,但Carlo Wood不这么认为,作者认为rm文件后是可以恢复的,所以就有了ext3grep这个工具。自己翻译下来,自己的英文水平着实还有待有提高,该篇译文算是自己的练兵这作罢了.由于自己的翻译水平连自己都不屑一顾了,至于发在博客的原因,想比是自己喜欢写博客而已,没有任何原因了.强烈建议读者朋友还是读原作,请看上面的链接.
[@more@]超级块
超级块不是真正的块,它的尺寸总是1024 bytes,并且第一个超级块开始从1024偏移.如果块尺寸是1024,然后超级块是块1,但是如果这个块尺寸是2048,或者4096,那么超级块是块0.有多个超级块在磁盘的别处备份.这个ext3grep假定第一个超级块没有损坏,并且不会查找或读取备份.
读取第一个超级块使用下面dd命令.
$ dd if=$IMAGE bs=1024 skip=1 count=1 of=superblock |
在超级块结构里面,每个字节的含义(略):
Table 1. The Superblock | ||
Bytes | type | Description |
0 .. 3 | __le32 | Inodes count |
4 .. 7 | __le32 | Blocks count |
8 .. 11 | __le32 | Reserved blocks count |
12 .. 15 | __le32 | Free blocks count |
16 .. 19 | __le32 | Free inodes count |
20 .. 23 | __le32 | First data block |
24 .. 27 | __le32 | Block size |
28 .. 31 | __le32 | Fragment size |
32 .. 35 | __le32 | Number of blocks per group |
36 .. 39 | __le32 | Number of fragments per group |
40 .. 43 | __le32 | Number of inodes per group |
44 .. 47 | __le32 | Mount time |
48 .. 51 | __le32 | Write time |
52 .. 53 | __le16 | Mount count |
54 .. 55 | __le16 | Maximal mount count |
56 .. 57 | __le16 | Magic signature |
58 .. 59 | __le16 | File system state |
60 .. 61 | __le16 | Behaviour when detecting errors |
62 .. 63 | __le16 | minor revision level |
64 .. 67 | __le32 | Time of last check |
68 .. 71 | __le32 | Max. time between checks |
72 .. 75 | __le32 | OS |
这超级块C-struct的头文件位于/usr/include/ext3_fs.h.查看table 1的显示.
无符号整数的数据在磁盘上是以Little Endian format(低字节循序).在一个
类似inter X86 Little Endian CPU中,意味着事实上__le32 ,an uint32_t and __le16 等于uint16_t.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28227905/viewspace-1060170/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28227905/viewspace-1060170/