squashfs文件系统索引到磁盘块映射

时间:2012-05-17 13:23:08

标签: filesystems kernel squashfs

任何人都可以告诉我们squashfs如何将磁盘块号映射到文件系统块。 基本上我在squashfs中说read_blocklist()。

谢谢, 卡皮尔

1 个答案:

答案 0 :(得分:0)

常规文件的squashfs元数据大致如下所示:

===== Header
start_block: Position of the first block in the file
file_size: Size of the file in bytes
...
===== Block list
size0: 32-bit header for the first block
size1
size2
...
=====

块头包含块的压缩大小。因此,我们可以通过将start_block和所有前面块的大小相加来计算任何给定块的位置。

使用我的纯红宝石squashfs解析器可能会有所帮助:https://github.com/vasi/squash.rb

相关问题