简体   繁体   English

从ext4文件系统直接从原始分区读取数据,而无需挂载文件系统

[英]read data from ext4 filesystem directly from the raw partition without mounting the file system

Is it possible to add data of fixed size to an ext4 image such that its available at the last block of the partition (or say last 100KB)? 是否可以将固定大小的数据添加到ext4映像中,以使其在分区的最后一块可用(或者说最后100KB)? I want to be able to to add data to the ext4 image such that I can read the data from the corresponding raw partition without any knowledge of the filesystem. 我希望能够将数据添加到ext4映像中,这样就可以在不了解文件系统的情况下从相应的原始分区读取数据。

Is this possible? 这可能吗?

You could build what you want using e2fslibs in e2fsprogs . 您可以在e2fsprogs中使用e2fslibs构建所需的内容。 That library gives you low-level access to reading the filesystem metadata. 该库使您可以低级访问文件系统元数据。

First pass, you could dump all the metadata about "blocks in use" to see if those last 100K of blocks are in use or not. 第一步,您可以转储有关“正在使用的块”的所有元数据,以查看是否最后100K个块正在使用。 If not, just write over them. 如果不是,则将其覆盖。

您可以使用e2image实用程序来转储或还原元数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM