Android uses ext4
file system for read-only partitions, but in my opinion for flash read-only drives ext2
is more appropriate, because it does not have performance overhead and safe for using without write operation.
Am I right?
Why does Android use
ext4
file system for read-only partitions?
Not really an expert here and probably won't give a specific answer but, as you surely know, Android heavily leans on Linux and the choice might have been Linux-dictated.
The great work by Jonathan Levin which has lately become free and which I strongly recommend you to get familiar with states the following*:
"Android enforces no constraints as to the filesystem types, but eMMC and MMC devices presently use the Linux Ext4 filesystem (as of Gingerbread, in place of the older YAFFS system), since the storage layer exports a block device. Ext4 has become the default filesystem in Linux as of 2.6.27, and is a well tested filesystem, albeit not a necessarily flash-optimized one."
* Chapter II -> Partitioning Scheme -> File Systems
Also ext4
without using journal has better performance then ext2
:
ext2 ext4, default ext4, no journal
initial writes 13.0 MB/s 15.4 MB/s 15.7 MB/s
rewrites 13.1 MB/s 15.6 MB/s 15.9 MB/s
reads 15.2 MB/s 16.9 MB/s 17.2 MB/s
re-reads 15.3 MB/s 16.9 MB/s 17.2 MB/s
re-reads 15.3 MB/s 16.9 MB/s 17.2 MB/s