• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[DEV][DATA2SD] More space (and more I/O) for your Desire (Updated/EXT4/Flashable ZIP)

Search This thread

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
Paris
HI all.

I know it has been already done but I didn't find any detailed tutorial for the hTc Desire so I wrote one for you :)

Howto for a HTC desire with clockworkmod recovery:
I did this with a stock HTC sense 2.2 froyo rooted rom with init.d support and my own kernel, forked from richardtrip sense kernel v5e. I don't know for other ROMs or Kernels. Your ROM must support init.d boot scripts.

What you need is:

* Fast µSD card (Class 4 or 6 recommended. Lots of issues reported with class 10 on the Desire)
* busybox (http://www.busybox.net/downloads/binaries/) on c:\
* Kernel with EXT4 support. The kernel in original ROM does not provide ext4 support!!
* Rom with init.d script support (StarBurst (Froyo) or Supernova (Gingerbread) have a native DATA2SD support)
* If you already have app2sd+ or a similar script, don't do the following hack (or at your own risks) !!
* If you still want to try it, backup your A2SD scripts and roll-back to a pre-A2SD state. Don't ask me why it's not working, I never used APPs2SD so I can't help.
* To help you with ADB, you can use the GUI

If you feel a bit lazy or you're scared to make any mistake and want to skip all the manual installation, then go straight to the bottom of this post and download the flashable script made by droidzone. Many thanks to him!! You can also flash Supernova (Stock HTC gingerbread release) and you'll be good to go within no time.

If you already have this running but you flashed another rom, have a look here. droidzone posted another script to just update the rom you just flashed to get DATA2SD work properly

[size=+1]1/Get yourself prepared[/size]

A/ backup everything (nandroid).
B/ Make sure everything is backed-up
C/ Copy the content of you SD to your computer and keep it handy for a roll-back.
D/ make a copy !!!! (I think know that you've been warned )

[size=+1]2/ Make 2 primary Mb aligned partitions on your SD[/size]

Primary partition 1 will be your usual storage, must be FAT32.
To optimize it, I really recommend to have a look here
Primary partition 2 will be your new storage (/data).
You can use gparted or fdisk (I do prefer fdisk and wrote a guide here ) to partition your SD; but it's up to you and Gparted is working great too.
Use the MB align option of gparted to align your partitions. This helps big time to get a better R/W speed.
With the latest busybox, you can do that on your phone in recovery mode.
You will need also e2fs progs. They're all attached at the bottom of this howto.

[size=+1]3/ Boot your phone in recovery and get it prepared[/size]

Connect to your phone with "adb shell"
You should get a ~# prompt now.

mount /system
mount /data
mount /sdcard
exit

if mount /sdcard fails, try mount /dev/block/mmcblk0p1 /sdcard

You should get this as a result of a "mount" command:
Code:
~ # mount
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nodev,noatime,nodiratime)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,errors=remount-ro)
/dev/block/mtdblock3 on /system type yaffs2 (rw,relatime)
/dev/block/mtdblock5 on /data type yaffs2 (rw,relatime)

Replace you old busybox exec with the new one. It's located in /system/xbin/
adb push c:\busybox-armv6l /system/xbin/busybox

Add the script to init.d folder:
adb push c:\01data.txt /system/etc/init.d/01data

Add the fstab to /system/etc/
adb push c:\fstab.txt /system/etc/fstab

Extract e2fsprogs-arm.zip to c:\

Push all e2fs progs you've extracted from the zip to /system/bin/ the same way:
adb push c:\e2fsprogs\system\bin\e2fsck /system/bin/
adb push c:\e2fsprogs\system\bin\mke2fs /system/bin/
(etc.... for all apps)

Push all e2fs libs you've extracted from the zip to /system/lib/ the same way:
adb push c:\e2fsprogs\system\lib\libext2_blkid.so /system/lib/
adb push c:\e2fsprogs\system\lib\libext2_com_err.so /system/lib/
(etc... for all libs)

adb shell
cd /system/bin
chmod 755 e2fsck
chown 0.2000 e2fsck
(Do the same for all pushed apps.)
cd /system/lib
chmod 644 libext2*

chmod 755 /system/xbin/busybox
chown 0.0 /system/xbin/busybox
chmod 755 /system/etc/init.d/01data
chown 0.0 /system/etc/init.d/01data

Finally type this:
:> /system/etc/mtab

[size=+1]4/ Instant of creation[/size]

cd /

For a non-journaled version:

/system/bin/mke2fs -T ext4 -b 4096 -E stride=64,stripe-width=64 -O ^has_journal,extent,^huge_file -m 0 -L userdata /dev/block/mmcblk0p2

For a journaled version (safety/AOSP ROMs):

/system/bin/mke2fs -T ext4 -b 4096 -E stride=64,stripe-width=64 -O extent,^huge_file -m 0 -L userdata /dev/block/mmcblk0p2

stride and stripe-width are RAID options but they are used here to align the filesystem to the max erase block size of an SD card. In conjunction with EXT4 extents feature (not present in ext3), it gives a bit of extra performance thanks to block allocation. It's used and recommended for SSDs, so it should help our poor little cheap (SSDs) SD cards :D
I use 64 because 64x4 (4kb block size)=256Kb. 256Kb is the max erase block size per the SD standards.
Your card may have a smaller erase block size but 256K is at least compatible with every card.
If you want to change the block allocation size, change the "64" parameter.
Just change it to - say - 32 (32x4=128kb) etc ...
Tune this to your actual erase block size if you know it.

If you want journaling (better data integrity) at the cost of performance and probably sd card wear, use the journaled option when you format the ext4 partition. Journal will also use some space on your EXT partition.

Read this article or my tutorial for more details on aligning partition and file system on linux.

I'd like to mention at this stage that fortunately, HTC has implemented a nice and clean unmount of /data at shutdown. Unless you remove your phone battery while it is running or android completely crashes and the cache hasn't been flushed to the sd card, you shouldn't suffer from data loss. In that case though, I've implemented a forced check of the data partition to try to recover any errors on the ext4 partition before booting the phone. You can expect to have a fair amount of safety without journal as long as you turn off your phone with standard HTC menu on sense ROMs :)
Anyway, if you want to try DATA2SD on a AOSP ROM, you *must* use a journal!


[size=+1]5/ verbatim[/size]

type this:

mkdir /sd
/system/xbin/busybox mount -t ext4 /dev/block/mmcblk0p2 /sd
cd /data
cp -a * /sd
cd /
sync

All you data should copied now.
check with a "ls -l /sd" that you have a least the directory structure.
"df" should report the space used on the new filesystem and should be close to your /data.

/system/xbin/busybox umount /sd

[size=+1]6/ Reboot[/size]

Reboot.
Move all you apps (if you have used the Froyo AP2SD) back to the phone, which is now the SD.
Reboot to get a clean and stable phone
Make sure that you don't install any app in the future to the SD. Some apps are installed automatically to SD, move them back to the phone if it is so.

[size=+1]7/ Comments[/size]

IMHO, a readahead of 128kb could be a bit excessive and can penalise read speed when reading small amounts of data. I've reduced it on my phone to 64kb and noticed a slight improvement when for instance the phone reads data to show apps, icons and size when you open the application list in the settings/applications/manage applications menu. Some kernels have a default value of 4K. This is really bad for performance and it must be changed to get good read performance.

To change it, type this while android is running:
echo 64 > /sys/block/mmcblk0/queue/read_ahead_kb

This setting will be lost on reboot. Just add this line to the script if you want to keep it on reboot.

ownhere did a fantastic job at hacking the libsqlite.so library. I patched the original sense lib and I strongly recommend to replace it with the one attached below.
To do so, just boot into recovery mode, mount /system and backup your /system/lib/libsqlite.so file to your sdcard. Then push the patched lib to /system/lib/ and do a chmod 644 on the pushed file.

Reboot and VOILA! :D

Updates of the flashable ZIP are available here

If you're coming from previous version (2 FAT32 partitions, ext2 file and loop mount) and want to move to this new one, have a look at this post. You don't have to do everything from start and loose your data. You should get there all the needed info to backup your data and restore it to the new EXT4 partition.

ownhere posted a very interesting option to play with in this post. Apparently nodelalloc mount option is giving better score than delalloc on flash memories. I recently tested it and I had better Quadrant and TAP scores so check-it out!

If you want to impress your friends with Quadrant score, just add "noauto_da_alloc" in the mount option of the script or do this manually with adb shell : busybox mount -o remount,noauto_da_alloc /data
The effect is pretty similar on the final score than nodelalloc (at least on my phone/sdcard ;) )
To get back to normal: busybox mount -o remount,auto_da_alloc /data
(Got this setting from here).
It is simply making the system (thus Quadrant) working in cache (RAM) instead of the SD card.
I'm not sure that this settings improves that much real life usage, but at least you'll get what you're looking for: A super (fake) Quadrand I/O score :)
I may add this setting in future release of DATA2SD. I'm testing it ATM on my phone.

Many thanks to ownhere and melethron for all their thinkings at bringing issues, help and updates to get to this new version.
Many thanks to too droidzone for his great work on a flashable ZIP and integrating DATA2SD in his ROM to make your life easier you flash maniacs ;)


I hope that I didn't forget something. It's working for me so it should work for you.
Read the thread before asking a question !
 

Attachments

  • fstab.txt
    80 bytes · Views: 1,532
  • e2fsprogs-arm.zip
    711.6 KB · Views: 1,853
  • libsqlite-patched.zip
    232.5 KB · Views: 1,231
  • 01data.txt
    279 bytes · Views: 1,722
  • busybox.zip
    589.7 KB · Views: 1,756
Last edited:

fogbav

Senior Member
Jun 19, 2010
250
31
This sounds really great ... 2 things :

1. your links are broken
2. Can't we generate the file for /data on the first fat32 partition ... would be a lot easier to format the sdcard with only one partition ...

thank you very much for this great information ...
 

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
Paris
This sounds really great ... 2 things :

1. your links are broken
2. Can't we generate the file for /data on the first fat32 partition ... would be a lot easier to format the sdcard with only one partition ...

thank you very much for this great information ...

No because you won't be able to use your SD as an external drive when connected to USB.

Just checked the links and they're OK
 

bluelavender

Senior Member
Sep 2, 2010
619
41
i vouch for sibere's script... i'm one of first "live testers" for his script and it works great and very, very stable :)

and from what have been tested by several testers , it can work in these roms :

without a2sd+ :
- rooted stock
- leedroid no-a2sd

with a2sd+ :
- auraxtsense
- defrost
- leedroid
- alex-v

Sibere, allow me to add notes from AndroHero on using the script with a2sd+ rom :
- remove the data2sd (or in auraxt, stuff2sd) from system/etc/init.d in the rom zipfile, or if you have install the rom, just remove from system/etc/init.d
- do the sibere script

Regards
BL
 

mattiadj

Senior Member
May 22, 2010
4,089
1,779
Francavilla al mare
I have follow this easyest tutorial and i'm ok.
All credits to AndroHero for tutorial and to sibere for the hack! I'm only copy and paste from the previous thread!
This tutorial is for all app2sd sense rom so you can follow this tutorial not onfly for lee droid.
As attachment the file that tutorial need.
I have made a 2gb partition for data and is an awesome to see 1.80gb internal memory at first boot!!!!
WOOOOW

Now let's start with tutorial!

------TUTORIAL BEGIN-------

WHAT YOU NEED:
1)Root
2)Android SDK
3)15minutes of time

ALWAYS MAKE A NANDROID BACKUP AND SD BACKUP!!!


LET'S START NOW!

1) download leedroid 2.2f (apps2sd version)

2) unzip the .zip file, open the folder, open the system folder, and then inside that open the folder called etc, you will see a folder called init.d, open that and delete the file called 40a2sd, now just navigate back to the root of the rom and re-zip it.

3) now you need to partition your sd card, use gparted to make 2 fat partitions, a large primary partition and a secondary one about 1gb in size.

4) once you have done that copy the leedroid.zip to the sd card, boot into recovery, do all your wipes and flash the rom, one fashed boot it up and set it up as normal.

5) once set up, hold the power button and choose the option to reboot into recovery.

6) once in recovery connect your phone to your pc, open a command prompt and navigate to the tools folder inside the android SDK.

7) now in the command prompt type the following one at a time:

adb shell
mount /system
mount /data
mount /sdcard
exit

8) now leave the command prompt open and download the file at the bottom of the screen, (i have had to zip it, just open the .zip and the 01data file is inside) and copy it to the root of the c:\ drive on your pc.

9) in the command prompt type (one at a time and always wait for the # to appear again before entering a new command)

adb push c:\01data /system/etc/init.d
adb shell
chmod 755 /system/etc/init.d/01data
cd /
mount /dev/block/mmcblk0p2 /sd-ext
dd if=/dev/zero of=/sd-ext/ext2 bs=1048576
/system/xbin/busybox mke2fs -F -L userdata /sd-ext/ext2

mkdir /sd
/system/xbin/busybox mount -o loop /sd-ext/ext2 /sd
cd /data
cp -a * /sd
cd /
/system/xbin/busybox umount /sd

exit
adb reboot

10) your phone will now reboot with a much bigger /data/ partition.

------TUTORIAL END-------

I suggest to activate the boost!

type in adb shell window with android running:

busybox mount -o remount,noatime,nodiratime /mnt/asec/ext/ext2 /data
 

Attachments

  • data.zip
    282 bytes · Views: 1,490
Last edited:

sibere

Retired Recognized Developer
May 14, 2006
2,055
375
Paris
i vouch for sibere's script... i'm one of first "live testers" for his script and it works great and very, very stable :)

and from what have been tested by several testers , it can work in these roms :

without a2sd+ :
- rooted stock
- leedroid no-a2sd

with a2sd+ :
- auraxtsense
- defrost
- leedroid
- alex-v

Sibere, allow me to add notes from AndroHero on using the script with a2sd+ rom :
- remove the data2sd (or in auraxt, stuff2sd) from system/etc/init.d in the rom zipfile, or if you have install the rom, just remove from system/etc/init.d
- do the sibere script

Regards
BL

Year sure, you're free to add notes mate :)
 

lpachuong

Senior Member
Jul 30, 2009
733
52
Does this really increase IO speed? Can anyone who managed to set this up please post ur Quadrant benchmark.
 

bluelavender

Senior Member
Sep 2, 2010
619
41
only one question:

is it better than using a2sd+?

what is the difference?

i had a lot of memory issues with a2sd+ (internal memory decrease very quickly compared to a2sd storage until i get the 'low memory' error message), does this solve my problem?

thanks

bye
Alessandro

Yes, it will solve the problem :)

The reason why internal memory still decreases with a2sd+ is because not every part of the apps are moved to sd-card . Some of the data parts are still in the internal memory.

This script moves entire data folder to sd card, so nothing in internal memory get decreased :)

It can be any size you want. So far, the maximum tested size is 2 gb :) i think was tested by mattiadj & androhero.

BL
 

coutts99

Senior Member
Nov 1, 2010
1,406
261
Sunderland
Does this preserve the data on the card? Or do you have to copy everything back on?

Of course I'll have backups, but just asking :)
 

mattiadj

Senior Member
May 22, 2010
4,089
1,779
Francavilla al mare
This is what is on clean flash of leedroid and after this hack!
I have made a 2gb partition....

Image talks alone....one word: THANKS!
 

Attachments

  • snap20101126_164152.jpg
    snap20101126_164152.jpg
    34.1 KB · Views: 2,453
Last edited:

quad2012

Senior Member
Oct 9, 2010
77
1
Any improvements are welcome but beside the space can you feel the I/O at some points or is it just a number?
 

Pavelol

Senior Member
Mar 7, 2010
172
206
33
Dude you are legen........ wait for it........... DeRY =D
hope to find a little time to test this awesome tutorial =]
 

diggedy

Senior Member
Feb 1, 2009
382
71
Durham
what would happen if the SD card failed? does this render the phone unuseable until a new rom is flashed?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 26
    HI all.

    I know it has been already done but I didn't find any detailed tutorial for the hTc Desire so I wrote one for you :)

    Howto for a HTC desire with clockworkmod recovery:
    I did this with a stock HTC sense 2.2 froyo rooted rom with init.d support and my own kernel, forked from richardtrip sense kernel v5e. I don't know for other ROMs or Kernels. Your ROM must support init.d boot scripts.

    What you need is:

    * Fast µSD card (Class 4 or 6 recommended. Lots of issues reported with class 10 on the Desire)
    * busybox (http://www.busybox.net/downloads/binaries/) on c:\
    * Kernel with EXT4 support. The kernel in original ROM does not provide ext4 support!!
    * Rom with init.d script support (StarBurst (Froyo) or Supernova (Gingerbread) have a native DATA2SD support)
    * If you already have app2sd+ or a similar script, don't do the following hack (or at your own risks) !!
    * If you still want to try it, backup your A2SD scripts and roll-back to a pre-A2SD state. Don't ask me why it's not working, I never used APPs2SD so I can't help.
    * To help you with ADB, you can use the GUI

    If you feel a bit lazy or you're scared to make any mistake and want to skip all the manual installation, then go straight to the bottom of this post and download the flashable script made by droidzone. Many thanks to him!! You can also flash Supernova (Stock HTC gingerbread release) and you'll be good to go within no time.

    If you already have this running but you flashed another rom, have a look here. droidzone posted another script to just update the rom you just flashed to get DATA2SD work properly

    [size=+1]1/Get yourself prepared[/size]

    A/ backup everything (nandroid).
    B/ Make sure everything is backed-up
    C/ Copy the content of you SD to your computer and keep it handy for a roll-back.
    D/ make a copy !!!! (I think know that you've been warned )

    [size=+1]2/ Make 2 primary Mb aligned partitions on your SD[/size]

    Primary partition 1 will be your usual storage, must be FAT32.
    To optimize it, I really recommend to have a look here
    Primary partition 2 will be your new storage (/data).
    You can use gparted or fdisk (I do prefer fdisk and wrote a guide here ) to partition your SD; but it's up to you and Gparted is working great too.
    Use the MB align option of gparted to align your partitions. This helps big time to get a better R/W speed.
    With the latest busybox, you can do that on your phone in recovery mode.
    You will need also e2fs progs. They're all attached at the bottom of this howto.

    [size=+1]3/ Boot your phone in recovery and get it prepared[/size]

    Connect to your phone with "adb shell"
    You should get a ~# prompt now.

    mount /system
    mount /data
    mount /sdcard
    exit

    if mount /sdcard fails, try mount /dev/block/mmcblk0p1 /sdcard

    You should get this as a result of a "mount" command:
    Code:
    ~ # mount
    mount
    rootfs on / type rootfs (rw)
    tmpfs on /dev type tmpfs (rw,relatime,mode=755)
    devpts on /dev/pts type devpts (rw,relatime,mode=600)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    /dev/block/mtdblock4 on /cache type yaffs2 (rw,nodev,noatime,nodiratime)
    /dev/block/mmcblk0p1 on /sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,s
    hortname=mixed,errors=remount-ro)
    /dev/block/mtdblock3 on /system type yaffs2 (rw,relatime)
    /dev/block/mtdblock5 on /data type yaffs2 (rw,relatime)

    Replace you old busybox exec with the new one. It's located in /system/xbin/
    adb push c:\busybox-armv6l /system/xbin/busybox

    Add the script to init.d folder:
    adb push c:\01data.txt /system/etc/init.d/01data

    Add the fstab to /system/etc/
    adb push c:\fstab.txt /system/etc/fstab

    Extract e2fsprogs-arm.zip to c:\

    Push all e2fs progs you've extracted from the zip to /system/bin/ the same way:
    adb push c:\e2fsprogs\system\bin\e2fsck /system/bin/
    adb push c:\e2fsprogs\system\bin\mke2fs /system/bin/
    (etc.... for all apps)

    Push all e2fs libs you've extracted from the zip to /system/lib/ the same way:
    adb push c:\e2fsprogs\system\lib\libext2_blkid.so /system/lib/
    adb push c:\e2fsprogs\system\lib\libext2_com_err.so /system/lib/
    (etc... for all libs)

    adb shell
    cd /system/bin
    chmod 755 e2fsck
    chown 0.2000 e2fsck
    (Do the same for all pushed apps.)
    cd /system/lib
    chmod 644 libext2*

    chmod 755 /system/xbin/busybox
    chown 0.0 /system/xbin/busybox
    chmod 755 /system/etc/init.d/01data
    chown 0.0 /system/etc/init.d/01data

    Finally type this:
    :> /system/etc/mtab

    [size=+1]4/ Instant of creation[/size]

    cd /

    For a non-journaled version:

    /system/bin/mke2fs -T ext4 -b 4096 -E stride=64,stripe-width=64 -O ^has_journal,extent,^huge_file -m 0 -L userdata /dev/block/mmcblk0p2

    For a journaled version (safety/AOSP ROMs):

    /system/bin/mke2fs -T ext4 -b 4096 -E stride=64,stripe-width=64 -O extent,^huge_file -m 0 -L userdata /dev/block/mmcblk0p2

    stride and stripe-width are RAID options but they are used here to align the filesystem to the max erase block size of an SD card. In conjunction with EXT4 extents feature (not present in ext3), it gives a bit of extra performance thanks to block allocation. It's used and recommended for SSDs, so it should help our poor little cheap (SSDs) SD cards :D
    I use 64 because 64x4 (4kb block size)=256Kb. 256Kb is the max erase block size per the SD standards.
    Your card may have a smaller erase block size but 256K is at least compatible with every card.
    If you want to change the block allocation size, change the "64" parameter.
    Just change it to - say - 32 (32x4=128kb) etc ...
    Tune this to your actual erase block size if you know it.

    If you want journaling (better data integrity) at the cost of performance and probably sd card wear, use the journaled option when you format the ext4 partition. Journal will also use some space on your EXT partition.

    Read this article or my tutorial for more details on aligning partition and file system on linux.

    I'd like to mention at this stage that fortunately, HTC has implemented a nice and clean unmount of /data at shutdown. Unless you remove your phone battery while it is running or android completely crashes and the cache hasn't been flushed to the sd card, you shouldn't suffer from data loss. In that case though, I've implemented a forced check of the data partition to try to recover any errors on the ext4 partition before booting the phone. You can expect to have a fair amount of safety without journal as long as you turn off your phone with standard HTC menu on sense ROMs :)
    Anyway, if you want to try DATA2SD on a AOSP ROM, you *must* use a journal!


    [size=+1]5/ verbatim[/size]

    type this:

    mkdir /sd
    /system/xbin/busybox mount -t ext4 /dev/block/mmcblk0p2 /sd
    cd /data
    cp -a * /sd
    cd /
    sync

    All you data should copied now.
    check with a "ls -l /sd" that you have a least the directory structure.
    "df" should report the space used on the new filesystem and should be close to your /data.

    /system/xbin/busybox umount /sd

    [size=+1]6/ Reboot[/size]

    Reboot.
    Move all you apps (if you have used the Froyo AP2SD) back to the phone, which is now the SD.
    Reboot to get a clean and stable phone
    Make sure that you don't install any app in the future to the SD. Some apps are installed automatically to SD, move them back to the phone if it is so.

    [size=+1]7/ Comments[/size]

    IMHO, a readahead of 128kb could be a bit excessive and can penalise read speed when reading small amounts of data. I've reduced it on my phone to 64kb and noticed a slight improvement when for instance the phone reads data to show apps, icons and size when you open the application list in the settings/applications/manage applications menu. Some kernels have a default value of 4K. This is really bad for performance and it must be changed to get good read performance.

    To change it, type this while android is running:
    echo 64 > /sys/block/mmcblk0/queue/read_ahead_kb

    This setting will be lost on reboot. Just add this line to the script if you want to keep it on reboot.

    ownhere did a fantastic job at hacking the libsqlite.so library. I patched the original sense lib and I strongly recommend to replace it with the one attached below.
    To do so, just boot into recovery mode, mount /system and backup your /system/lib/libsqlite.so file to your sdcard. Then push the patched lib to /system/lib/ and do a chmod 644 on the pushed file.

    Reboot and VOILA! :D

    Updates of the flashable ZIP are available here

    If you're coming from previous version (2 FAT32 partitions, ext2 file and loop mount) and want to move to this new one, have a look at this post. You don't have to do everything from start and loose your data. You should get there all the needed info to backup your data and restore it to the new EXT4 partition.

    ownhere posted a very interesting option to play with in this post. Apparently nodelalloc mount option is giving better score than delalloc on flash memories. I recently tested it and I had better Quadrant and TAP scores so check-it out!

    If you want to impress your friends with Quadrant score, just add "noauto_da_alloc" in the mount option of the script or do this manually with adb shell : busybox mount -o remount,noauto_da_alloc /data
    The effect is pretty similar on the final score than nodelalloc (at least on my phone/sdcard ;) )
    To get back to normal: busybox mount -o remount,auto_da_alloc /data
    (Got this setting from here).
    It is simply making the system (thus Quadrant) working in cache (RAM) instead of the SD card.
    I'm not sure that this settings improves that much real life usage, but at least you'll get what you're looking for: A super (fake) Quadrand I/O score :)
    I may add this setting in future release of DATA2SD. I'm testing it ATM on my phone.

    Many thanks to ownhere and melethron for all their thinkings at bringing issues, help and updates to get to this new version.
    Many thanks to too droidzone for his great work on a flashable ZIP and integrating DATA2SD in his ROM to make your life easier you flash maniacs ;)


    I hope that I didn't forget something. It's working for me so it should work for you.
    Read the thread before asking a question !
    17
    [DATA2SD] Flashable zips for converting any Rom to Data2SD

    Ahem...First, a small recommendation. ;) If you want a Stock Rooted ROM with most features of every other ROM out there, but with full Data2SD support, and best stability,

    Checkout SuperNova ROM! for GingerBread

    or

    StarBurst ROM!
    for Froyo

    Now, to get on to Data2SD installation for the rest of the ROMs..

    If you havent read Sibere's entire OP, I urge you to read it completely before embarking on Data2SD installation. This is not a shortcut to the code. This is just a method of making it easier.


    Once again, to recapitulate,
    A rooted Rom with Busybox and init.d support, and which has a kernel supporting ext4 is an absolute requirement for using Data2SD. Note also that by default the stock rooted rom neither has Busybox, init.d or kernel support for ext4. If your Rom doesnt satisfy any of these conditions, you can't use the following zips/the code method.

    Updated Instructions and Zips (14/Mar/2011)

    Warning: The flashable zips will fail on the new Gingerbread Sense Roms (leaked Roms). They need manual modification, which I'm too busy to do atm.. The manual command line scripts should work.. However you need a kernel with ext4 support!

    I've streamlined the installation procedure so as to make it more generic and compatible with the newer StarBurst zips.

    Basic Installation Steps for Data2SD

    1. Install your ROM
    2. Install the A2SD Killer (specific for your ROM)
    3. Next step differs depending on whether you're reflashing your Rom on an existing install, or whether you are installing for the first time.
      • If you're installing the ROM for the first time:
        1. Reboot once after running the A2SD Killer
        2. Setup the timezone, language etc (But not your Google Account/Market)
        3. Reboot to recovery once again and install the Data2SD Installer
      • If you're reflashing the ROM (after having installed Data2SD once previously)
        1. Do not reboot after running the A2SD Killer
        2. Install the Data2SD Re-Installer right away
        3. Now reboot.
    If you're interested in the StarBurst Data2SD versions (Sibere's beta and the latest updates, visit the StarBurst site.

    Impressed? Of course it is so much easier to install Data2SD on StarBurst since it is integrated with Data2SD and most compatible with it. But of course, StarBurst is our Rom and I might as well be praising it too much! ;) )



    Download Links (Newer version)





    Older Instructions (For versions prior to "EverythingData2SD version 11")

    Current Version of the Data2SD Flashable zips for Sibere's Data2SD: v5

    Differences in this version:

    Fully supports Cyanogen
    Fully supports Clockworkmod3.0+ (Edified)

    I wanted to consolidate all the flashable zips for Data2SD into one place, so that I will find it easy to update the links as I modify the scripts, and to also help Sibere to point his link to this post from OP, so that he doesnt need to reupload each file as they are modified.


    Once again, I must assert that Data2SD is totally Sibere's work with other devs who've developed Data2SD code of their own. In my opinion, however, this is the best! :)

    My contribution is conversion of his excellent code into flashable scripts which may be installed via Recovery. So you dont have to type out the code. :D

    The flashable zip is packed as a package of zip files. Each zip file within the package is seperate flashable zip

    There are the following files:

    Installer and Reinstaller files for Sense Roms


    • Data2SDInstaller_Sense.zip
    • data2sd-reinstall-_Sense.zip

    Installer and Reinstaller files for AOSP Roms and CM7 nightlies (excluding Cyanogen 6 and MIUI, but including Cyanogen 7 nightlies)


    • Data2SDInstaller_aosp.zip
    • data2sd-Reinstall_aosp.zip
    Installer and Reinstaller files for Cyanogen 6 and MIUI (Not for CM7 nightlies)


    • Data2SDInstaller_cyanogen.zip
    • data2sd-Reinstall_cyanogen.zip

    A2SD Script Remover (Common for Sense or AOSP Roms with built in A2SD)


    • A2SDKillerV5.zip

    Whether you are trying this method for Sense or AOSP Roms, the installation procedure is same. Only the file is different.




    How to Install Sibere's Data2SD using simple flashable zips:

    1. Data2SD Installer (Installation script)



    Scenario: Installing Data2SD for the first time

    Instructions:

    1. Complete wipe
    2. Install any Rom (which satisfies the requirements of Data2SD listed in the OP and recapitulated above) through recovery
    3. Once the Rom installation finishes, without leaving Recovery, immediately flash the A2SD Killer flashable zip.If flashed on a non-A2SD Rom, the flash wont do any harm. :)
    4. Now reboot once into Android desktop. (If the system fails to boot at this point, it means that some exotic A2SD script is lurking beneath.). Do NOT, I repeat, DO NOT install any applications on first install. Do not even enter the Android Market!
    5. Once you confirm that the Rom boots fine, Reboot into Recovery once again
    6. Now flash the Data2SD Installer zip. After it finishes installing, boot into Android and enjoy Data2SD


    2. Data2SD Re-Installer (Installation script)

    This is done if you have already run the Data2SD installation procedure once and have not wiped/formatted your system after that. In case you reflashed your Rom at any point, the Data2SD libararies in your system would be lost and Data2SD lost. In this case if you boot after a simple reflash of the Rom, it most likely will go into a bootloop. So follow the procedure below:



    1. Do not wipe unless you purposefully want to erase your data :) (If you wipe, you will have to use the previous method and Data2SD INstaller not REinstaller)
    2. Install the previous Rom through recovery (You shouldnt install another Rom over the previous Rom without a wipe unless absolutely sure that it is fully compatible with the previous Rom.)
    3. Without leaving Recovery (Without rebooting), immediately flash the A2SD Killer flashable zip.If flashed on a non-A2SD Rom, the flash wont do any harm. :)
    4. Without leaving Recovery (Without rebooting), flash the Data2SD Re-Installer zip. After it finishes installing, boot into Android and enjoy Data2SD




    Roms which have been tested to support Data2SD flashable zips:

    • StarBurst (Comes with Sibere's Data2SD support out of the box)
    • Aurax T Sense
    • Leedroid-both versions
    • Oxygen-Gingerbread and Froyo
    • Cyanogen-All versions upto 7
    • Cyanogen Nightlies 7 -extremely compatible. But you have to use the aosp version, not the CM6 version
    • Defrost
    • Stock HTC Rom like teppic74's if a kernel with ext4 support is added (Also see all basic requirements)
    • Baadnews HD
    • Coolexe HD and Z
    Probably a lot of other Roms do support it. These are the ones I've personally tested with my zips.

    If you use it on aosp, be forewarned. Accoording to Sibere, these dont cleanly unmount the fs, so there might be an increased chance of DataCorruption..


    Note that most HD Roms (with the exception of Badnewz and Coolexe Roms) that use A2SD for splitting the /system partition will break when A2SD Killer is applied, and in most instances Data2SD cannot be easily installed on these Roms. It is possible to manually modify the Rom zip to add Data2sd, but it depends on the fervour shown by the Rom dev to add Data2SD :)
    5
    Last days with my Desire ...

    Hi guys.

    Well, after so much time and so much fun with my Desire, It's time to say good bye.
    I just ordered today a Samsung Galaxy Note.
    My Desire won't be that far though, It's going into my girlfriend's hands to replace her weak Wildfire. I'll keep a benevolent eye on it ;)

    I'm sure that she will enjoy using it with the huge storage and the fast and stable Supernova ROM cooked with love by Droidzone.

    As a consequence, I won't update or provide support here anymore.

    I'm now leaving this world behind for a new bigger (5.3" 1280x800) horizon and hope that you will still enjoy your DATA2SD rom!
    3
    I have follow this easyest tutorial and i'm ok.
    All credits to AndroHero for tutorial and to sibere for the hack! I'm only copy and paste from the previous thread!
    This tutorial is for all app2sd sense rom so you can follow this tutorial not onfly for lee droid.
    As attachment the file that tutorial need.
    I have made a 2gb partition for data and is an awesome to see 1.80gb internal memory at first boot!!!!
    WOOOOW

    Now let's start with tutorial!

    ------TUTORIAL BEGIN-------

    WHAT YOU NEED:
    1)Root
    2)Android SDK
    3)15minutes of time

    ALWAYS MAKE A NANDROID BACKUP AND SD BACKUP!!!


    LET'S START NOW!

    1) download leedroid 2.2f (apps2sd version)

    2) unzip the .zip file, open the folder, open the system folder, and then inside that open the folder called etc, you will see a folder called init.d, open that and delete the file called 40a2sd, now just navigate back to the root of the rom and re-zip it.

    3) now you need to partition your sd card, use gparted to make 2 fat partitions, a large primary partition and a secondary one about 1gb in size.

    4) once you have done that copy the leedroid.zip to the sd card, boot into recovery, do all your wipes and flash the rom, one fashed boot it up and set it up as normal.

    5) once set up, hold the power button and choose the option to reboot into recovery.

    6) once in recovery connect your phone to your pc, open a command prompt and navigate to the tools folder inside the android SDK.

    7) now in the command prompt type the following one at a time:

    adb shell
    mount /system
    mount /data
    mount /sdcard
    exit

    8) now leave the command prompt open and download the file at the bottom of the screen, (i have had to zip it, just open the .zip and the 01data file is inside) and copy it to the root of the c:\ drive on your pc.

    9) in the command prompt type (one at a time and always wait for the # to appear again before entering a new command)

    adb push c:\01data /system/etc/init.d
    adb shell
    chmod 755 /system/etc/init.d/01data
    cd /
    mount /dev/block/mmcblk0p2 /sd-ext
    dd if=/dev/zero of=/sd-ext/ext2 bs=1048576
    /system/xbin/busybox mke2fs -F -L userdata /sd-ext/ext2

    mkdir /sd
    /system/xbin/busybox mount -o loop /sd-ext/ext2 /sd
    cd /data
    cp -a * /sd
    cd /
    /system/xbin/busybox umount /sd

    exit
    adb reboot

    10) your phone will now reboot with a much bigger /data/ partition.

    ------TUTORIAL END-------

    I suggest to activate the boost!

    type in adb shell window with android running:

    busybox mount -o remount,noatime,nodiratime /mnt/asec/ext/ext2 /data
    2
    Direct installation of Data2sd by flashing zip through recovery

    Please see this post. Will update the links there.