Shell – Making an ext3 filesystem image without mkfs.ext3

ext3linuxshell-script

On ubuntu I'm using the following to create a ext3 filesystem image system.img.

dd if=/dev/zero of=./system.img bs=1000000 count=200
mkfs.ext3 ./system.img

I'm attempting to do the same on android platform. But the problem is I can't find a mkfs.ext3 binary for armv7 android. But I have mkfs.ext2 , mke2fs , tune2fs and e2fsck. So my question is, Is it possible to achieve the same result with the available binaries? If yes, how to do it?

Best Answer

Actually yes. Since ext2 and ext3 are fairly similar, with the major difference being ext3 supports journalling, you should be able to:

tune2fs -j ./system.img

Which enables journalling. The conversion process is detailed here with the usual disclaimers about important information, messing with filesystems etc.

You can actually go back to ext2 too, if needed, by removing the journal. Also note - you'll need to change any auto-mount options to ext3 to actually enable use of the journal.

Related Question