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.