Data2ext script created by ownhere
This script, combining the efficiency, stability & flexibility of EXT4 format and loopback device I/O high performance for small files, is best SD card mapping method so far, which is the similar way Desire Z and Desire HD handled with their large capacity internal partition. The only down side they have is their partition format is EXT3, resulting in low I/O performance in Quadrant.
The script automatically seek for 2nd partition on SD, if it exits and the system boots for the first time, it will force rebuild & format the partition into EXT4 and disable LOG/journal for better performance.
With the EXT4 partition built, the script will check the its total capacity, say 1GB e.g. and then creat a 200MB(1/5 of the total capacity) virtual ext2 device.
Why ext2? Cos’ it’s very simple and it’s for storing the app data generated and used by the phone. Such data is fairly small and changes frequently. But Android OS uses sqlite database, which is very tragic and in low efficiency.
To solve this issue, we could utilizes loopback device to optimize the I/O performance for small files. The idea is to merge several small files I/O requests into a large I/O request, and summit this large I/O request from the virtual EXT2 to the actual EXT4.
Now, let’s take a look at the /data directory
/data/app & /data/dalvik-cache large files, seldom change
/data/data & /data/app-private small files, scatter and messy,
/data/misc, /data/property & /data/system these sub-directories store the basic config info and some are read during the system boot.
So the below mappings are implemented by my script:
/data/app to SD EXT4
/data/dalvik-cache to internal ROM(utilizes the internal rom to voild rom waste and lower I/O burden)
/data/data, /data/app-private, /data/anr to EXT2 virtual device on SD EXT4
/data/misc, /data/property, /data/system to internal ROM, improve stability and store sys-config