[Desire Android Development] melethron:
New data2ext script

I copied my post from baadnwz ROM to this thread and modified it to explain my own data2ext script.

1. Introduction

I'm not happy with ownhere's script. I made several test with it and came to the conclusion that the speed improvement (wich are REALLY tiny) doesn't in any way outweight the risk of file corruption/data loss. The mount options are risky in case of a Kernel Panic / Powerloss on linux. The difference to android now is that android DOESN'T unmount the sd-ext partition on shutdown (thats also the reason cyanogen adviced ROM cookers to recommend ext3/4 instead of 2). This means:

EVERY REBOOT/SHUDOWN IS LIKE A SYSTEM CRASH FOR THE EXT-PARTITIO.

While ownhere uses ext3/4 to prevent file corruption he reduces the safety that journalig provides by options (journal writeback for example). My first approach was to change his script for more safety (my patches). But after some testing with the loopdevice and didn't find ANY speed improvements (also on the test i made i had higher file corruption on the loopdevice - even though i don't know why this should be the case). But now i made a completly new approach and made a new script.

To do this i didn't use any of the scripts available. I took the good old app2sd script from cyanogen (that's also used in this rom) and added data/data to the stuff that is moved to sd-ext. I also added e2fsck (checking mmcblck0p2 with -yfv and logging to /sdcard/e2fsck_log.txt) for those that use ext2 (in case they don't know it or they are willing to risk it :cool:).

2. What you get:

Advantages:

-Your internal storage will never get full

-fancy numbers in quadrant :rolleyes: (1)

Disadvantage:

-Speed in specific situations (2)

-ROM update is not possible without wipe (3)

Additional Explanation:

(1) About quadrant scroe: the reason this will tell you that you your phone is faster is the write cache. So it doesn't mean your phone IS faster. It only tells you that the RAM+SD-card r/w is faster than your NAND.

(2) It's awfully slow after first boot (and 2nd also if you restored apps). After some time the phone should be almost as responsive as without data2sd. There are also cases in wich speed is improved by this, for example opening a large inboox in k9mail (even a slow class 2 sd can read fast) also message widget loads the messages faster.

(3) I didn't know that but its stated in the script of cyaonogen.

3. Who should use this ?

Use it if one of the following matches to you (no if not):

-You get the low on space message even with app2sd+

-You are someone that wants to try it without purpose

-You like to fool people (or yourself) with sick quadrant scores :rolleyes:

Known Issues

-Same as app2sd (Android not unmounting the device wich may cause corruption on ext2 so use ext3/4 except your feeling lucky :cool:)

-As stated above it needs full wipe to upgrade ROM

- (This actually isn't an Issue but maybe someone wonders)

The free space of your ext won't be shown as internal memory (unlike other data2ext scripts that mount ext directly to /data this script only symlinks the stuff that is move to sd to data - it's actually app+data/data2sd - although it looks different from the "user perspective" it does the same). The see the "free space left" use any app that shows app2sd space (titanium backup, quickinfo pro, etc). Internal memory will be almost 147MB free all time (on default nand partition size ofc - some stuff like system settings is still stored there since the system would reset them on reboot of they would be on sd - this info is also from cyanogen's script and who tends to doubt cyanogen ;) ).

Personal Remark

Im not sure if i use this myself. I'll play around with data2ext for some time and try to optomize it. I don't know if this has been tried before but maybe it's possible to make a shoutdown script so android unmounts the drive. I'll try to look into this. If it is possible to do i try this with ext2.

Installation:

(this part of the posting will be removed if robo uses this script for his ROM. If you are eager to flash it you can still do it)

WARNING: DON'T FLASH THIS FILE ON ANY DATA2EXT VERSION OF RCMixHD

1. make sure your second partition is either ext3/4 (ext2 still works but is less safe)

2. Do a FULL wipe

3. Install RCmix ("Old Fasion" ONLY! )

4. DON'T Reboot

5. If you failed at step 4 go to step 2

6. Flash the attached .zip

7. Now reboot

If you still want to use this before robocik updates his ROM:

It still "could" be flashed directly after install of the app2sd ("old fasion") Version if flashed directly after (=DONT REBOOT) flashing (full wipe required). But i would recommend to wait

@robocik: if you want to use my script you can either just replace it with the "40ap2sd" file of rename it to 40data2ext so u don't get confused by the name of the files when you cook the different versions. I didn't rename so it can be flashed over a fresh install (!) of the app2sd version.