0

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)? 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.

Is this possible?

arun
  • 41
  • 2
  • 3
  • I am not sure what you are asking for. Do you mean you want to extend size of the data blocks array from which filesystem can allocate? – ArekBulski Oct 28 '15 at 15:50

2 Answers2

1

You could build what you want using e2fslibs in e2fsprogs. 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. If not, just write over them.

BraveNewCurrency
  • 12,654
  • 2
  • 42
  • 50
  • Thanks for response! The data I'm adding should be part of the filesystem and it should go to the last 100k of blocks (which can be located without any knowledge about the filesystem). If I do it the way you suggested, the data that I add is not part of the filesystem. – arun May 03 '13 at 23:16
0

You can use e2image utility for dump or restore metadata