Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to generate several ext2 images. The obvious way to do that is to create an image, mount it & copy the content. But it requires root permissions twice (to chown the files and to mount the image). Also I found two tools for generating images: e2fsimage & genext2fs.

  • genext2fs places the image in RAM while generating but size of one of my images is ~30GiB.

  • e2fsimage crashes with some values of image size.

So how can I generate my images? It would be nice if the tool will calculate the image size itself.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Figured out why e2fsimage crashes. It is caused by int32 overflow when image size is greater than 4GiB. So the solution is to count required blocks & inodes, create loop file (truncate & mke2fs) and then use e2fsimage with -n argument (so it will not create the loopfile but use already created one)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.