[G1 Android Development] Kinslayer81:
Well, there was a lot of chatter today about the speed increases on cyanogen's JF-1.51 ROM today, attributed to some changes in the ramdisk (see below). Attached is a boot.img with the same modifications but for Haykuro's 6.0r1 build - go ahead and download it now or read on for more details. Note: you'll only notice a difference if you run your apps/cache from your SD card.

The Changes

The only change is to mount your SD card's ext2 partition with the 'noatime' option. This is exactly what cyanogen did in his JF build, as per his post here. I also added the 'nodiratime' option. This is merely a very minor change in the runme.sh script of the boot ramdisk. [See below for more info on the ext3 mod, added 05/27/09]

By default, ext2 maintains the last access time ('atime') of every file and directory in the filesystem. This means that every time you access (read or write to) a file, this time will be reset and you'll be writing to your SD card. Two problems: 1) SD cards are slow as it is; requiring a write every time you access a file is going slow your whole system down. 2) SD cards fail after enough writes to the same location, so you're reducing your card lifetime by not having these options.

ext3 'auto' mod

Cyanogen added this to his latest build, so again, merely making this available for Haykuro 6.0r1 users. He wrote a bit more detail here which is working reading too.

In short: No other ROMs or app2sd solutions handle a clean shutdown of the ext2 partition, and Android doesn't have fsck tools. The result is that shutting down or crashing can corrupt your ext2 partition and you can lose data. Meanwhile, ext3 is a journaling file system; it recovers gracefully from unclean shutdowns. It's also backwards compatible, you can still mount an ext3 as ext2, you just lose journaling capability.

The mod mounts the 2nd SD partition as type 'auto', which means it will read your existing partition as ext2 and in the future as ext3 if you upgrade. This is more for advanced users but I'll try post some simple instructions below. Make sure you download the boot-haykuro-6.0r1-atime-ext3.zip image.

What about hero? (added 06/06/09)

This is a modded kernel 2.6.29 with unionfs support from daproy. Besides the atime+ext3 stuff, by request I also added support to run /system/init.rc and /data/init.rc (needed by some scripts).

http://turtle.wastelands.net/dragon/...uto-initrc.zip

See also:

1) Daproy's release: http://xdaforums.com/showthread.php?p=3905574#post3905574

2) Release in this thread: http://xdaforums.com/showpost.php?p=3909682&postcount=10

Note: you also need to

1) adb remount

2) push wlan.ko /system/lib/modules

How to apply

Download and unzip the file to get your new boot.img

Option 1:

adb push boot.img /sdcard
adb shell
# cat /dev/zero > /dev/mtd/mtd2 write: No space left on device [this is ok, you can ignore]
# flash_image boot /sdcard/boot.img

(or mount your SD card, copy the image, and run the above commands in a terminal).

Option 2:

1. Boot into fastboot mode (boot with power+camera)

2. fastboot flash boot boot.img

How to check if it's working

Type 'mount' in an adb shell or your phone's terminal, and look for the 'noatime' and 'nodiratime' option on your ext2 mount point. (If you go ahead with the ext3 mod and upgrade, you'll see it will show up as ext3 in the mount list below).

$ adb shell
# mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock3 /system yaffs2 rw 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mmcblk0p2 /system/sd ext2 rw,[b]noatime,nodiratime[/b],errors=continue 0 0 <--
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8 0 0

If things go wrong

If for some reason you can't boot after trying this, you can restore your system simply by reapplying Haykuro's image (boot with power+home and alt-s). Alternatively, I'm attaching the original boot.img as well, which you could reflash with option 2 above.

How to upgrade your ext2 partition to an ext3

I found this really easy on Linux. People can write about alternative methods, but this worked great for me: (substitute /dev/sdb2 below as necessary)

1. Connect to USB and mount your SD card in Android

2. Unmount your ext2 partition from inside linux (e.g. sudo umount /dev/sdb2)

3. sudo tune2fs -j /dev/sdb2 (this adds a journal to the filesystem)

4. adb shell, reboot (or just reboot phone without tapping 'turn off USB storage')

Even though I found this really simple and didn't even bother to make a back up first, I'm really familiar with Linux and linux filesystems -- this should be considered advanced use, and I'm not responsible for you losing your entire ext3 partition.

Note - I agree with cyanogen; I don't think the journal writes is a big performance impact or will wear out your card. This is a relatively small amount of extra data on each write... very low performance/wear impact and for me very worth the benefits.

References

1. Original launch thread of cyanogen's JF 1.51 build

2. Boot Image how to referenced by cyanogen's post

I'm also attaching my compiled versions of mkbootfs and mkbootimg in case anyone wants to play around without downloading and compiling the 2.3 GB Android source.