grzegorzborowiak / populatefs

Tool for replacing genext2fs when creating ext4 images
GNU Lesser General Public License v2.1
5 stars 6 forks source link

Offset for disk image #4

Closed vpeter4 closed 4 years ago

vpeter4 commented 8 years ago

I'm evaluating populatefs to create disk image with two partitions. Because of this I extract ext4 partition from disk image, use populatefs on it and then merge back to disk image. But I'm wondering if would be possible to add offset to populatefs to indicate where in disk image required partition starts. Similar to what mtools does (i'm using this also).

Regards, Peter

oskarirauta commented 8 years ago

populatefs used debugfs - therefore, if debugfs has this feature, this should be possible.

On 8.2.2016, at 11:24, Peter V. notifications@github.com wrote:

I'm evaluating populatefs to create disk image with two partitions Because of this I extract ext4 partition from disk image, use populatefs on it and then merge back to disk image But I'm wondering if would be possible to add offset to populatefs to indicate where in disk image required partition starts Similar to what mtools does (i'm using this also)

Regards, Peter

— Reply to this email directly or view it on GitHub https://github.com/oskarirauta/populatefs/issues/4.

vpeter4 commented 8 years ago

Seems even if populatefs would support offset in disk image I still need to format partition with one program (like mke2fs). And this kind of programs doesn't support this feature either. So extracting, manipulating and merging back is only option I see right now.

oskarirauta commented 8 years ago

You might be right. I haven’t been with this project in ages and currently I cannot help you as I am struggling with other issues in completely different language and world..

On 8.2.2016, at 18:00, Peter V. notifications@github.com wrote:

Seems even if populatefs would support offset in disk image I still need to format partition with one program (like mke2fs). And this kind of programs doesn't support this feature either. So extracting, manipulating and merging back is only option I see right now.

— Reply to this email directly or view it on GitHub https://github.com/oskarirauta/populatefs/issues/4#issuecomment-181419225.

vpeter4 commented 8 years ago

Just for fun I decided to make one shared library and hook open/close/seek/... system calls. Using LD_PRELOAD with mke2fs, tune2fs and e2fsck works as expected. I can use those programs directly on one big disk image to modify only part where partition reside.

fawrap - A preload shared library to limit file access to only some portion of the file. Usable for creating disk images and accessing partitions inside them.