Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,414 Members 53,675 Now Online
XDA Developers Android and Mobile Development Forum

[PRJ] [DATA2SD] Flashable zips for converting any Rom to Data2SD, For N1

Tip us?
(Last edited by jayfallen; 7th April 2011 at 05:36 PM.) Reason: update
jayfallen's Avatar
Senior Member - OP
Thanks Meter 11
Posts: 114
Join Date: Feb 2010
Post [PRJ] [DATA2SD] Flashable zips for converting any Rom to Data2SD, For N1

Updated April 7th, 2011

All credit to sibere and droidzone and other devs who've developed the Data2SD codes.

Before you do anything with your phone, Pls nanodroid fisrt!!! And flash your phone at YOUR OWN RISK

It's been a while since this post last updated.

In fact, developers of HTC Desire have already create a stable method to implement Data2sd or whatever you call it, which gives you full use of EXT space to install APPs while improving I/O speed at the same time.

The theory is explained here, in case you want to take a further look at it
[DEV][DATA2SD] More space (and more I/O) for your Desire (Updated/EXT4/Flashable ZIP)

And thanks to sibere and droidzone 's great work, now we could make any ROM we like run with Data2sd. here they provide us Flashable ZIP files to make it done
[DATA2SD] Flashable zips for converting any Rom to Data2SD

Updated Instructions and Zips (14/Mar/2011)

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:
· Reboot once after running the A2SD Killer
· Setup the timezone, language etc (But not your Google Account/Market)
·Reboot to recovery once again and install the Data2SD Installer
If you're reflashing the ROM (after having installed Data2SD once previously)
·Do not reboot after running the A2SD Killer
·Install the Data2SD Re-Installer right away
·Now reboot.
Download Link:

Important Notes from droidzone
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.

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:

Killer, Installer and Reinstaller files for Sense Roms

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

Installer and Reinstaller files for Cyanogen 6 and MIUI 2.2 (Not for CM7 nightlies or MIUI 2.3.3), which are Older Version

Whether you are trying this method for Sense or AOSP Roms, the installation procedure is same. Only the file is different.
Following droidzone's instruction, I tried these flashable ZIPs with MIUI 1.4.1(Gingerbread 2.3.3)

And it's working just fine. No random reboots, no data or APP lost or system crash after reboot. It's stable and fast!

One more note, you can ignore the previous information below...

—————————————————————————————————————————————————— ——————————————————
updata from
melethron's post, and his update package included.
you can buy melethron a beer if you want. All credits to melethron!

I test the script with new install MIUI N1 12.24,
so far no reboot issues, or data corruption.

[DATA2whatever] Flashable All-in-one-Solution for Data2sd (HUGE update (dec 23th))

data2whatever v0.2


- Supports: Ext2, Ext3, Ext4 (and if kernel supports it: ) btrfs, ReiserFS
- Supports loop device as optional addon (as siberes data2sd)
- Flashable zip for many app2sd ROMs (no long setup required)
- It does a e2fsck (disk check) on every boot and creates a logfile on the sdcard (/sdcard/e2fscklog.txt)
- looks nice if you do a logcat on boot
- no "settings lost on reboot" bug like in my old or siberes script
- changes the scheduler for the sd-card and internal to noop for better performance on sd.
- Nandroid Backup of EXT2/3/4 external with AmonRa or any clockwork recovery.
- Removes the common app2sd scripts on its own


- A second partition (same as app2sd - Min 512 mb - 1024mb is highly recommended - max 2048 MB or there will be issues with market) in any format (as long as the kernel supports - ext2/3/4 support is default in most kernels - Ext4 or ReiserFS is recommended).
- An app2sd or non app2sd ROM (data2sd versions wont work) (this SHOULD work with most or at least many ROMs . Roms that are confirmed to work can be found in the post below. Please report to me it it works or not so i can update this thread. If it doesn't work i try to make it compatible asap. )


1.) Full wipe (at least needed on first installation)
2.) Flash the app2sd Version of the ROM of your choice
4.) If you rebooted then start over at 1.)
5.) flash the attached ""
6.) now reboot

ADDITIONAL INFO: Even without "life on the edge" you should watch the first 4 "don't"s of "life on the edge". The normal script use the same disk safety methods as NTFS on Windows or EXT4 on linux. But as you know you shouldnt just switch off the computer because there can still be issues in very rare cases. Reboots with tools like "snqs power menu" is the same as a batterypull (or pulling the ac plug on PC) and this isn't good in general (and this also applies for using it with app2sd). If you want to go to recovery just make a normal shutdown and switch the phone on with "volume down" button pressed.

Optional life-on-the-edge add on
you can find this add on in melethron's original post, and try it on your own risk

This patch has the same effect as sibere's and ownhere's script (loop device - the way ownhere does in v4 doesnt work though). Other than those scripts it this addon doesnt need any repartitioning or other setup (like FAT or a third partition) and can simply be installed or removed with a flashable zip. All you need for this is a normal ext 2/3/4 partition (as above ^^). Ext4 is recommended for this (as above) since it is the fastest of those 3. This patch is more risky than normal ext3/4 considering the possibility of data loss. If you want to use this add-on you should watch the following (this also applys to ownheres and sibere script and is NOT more risky than their scripts):

- DON'T use the reboot of snq's powermenu (or any other reboot app)
- DON'T use anything in the "ROM Manager" that makes it reboot.
- DON'T do adb reboot / abd reboot recovery / adb reboot bootloader
- DON'T pull the battery while the phone is on (this should be obvious)
- DON'T remove the "sync" mount options for the Quadrant "boost" (this is a fake boost anyway)

All of this is like a powerloss for the sd-card and has a high change of data corruption.

From my test with this i give you an estimate what can happen if a powerloss occurs or any of the 5 points above happen:

- 50% general chance of corruption that will be autofixed on boot (not a problem)
- 10% chance of forcecloses after reboot of some apps (this can be fixed by deleting the app data or restoring it with titanium (or other) backup)
- REALLY tiny chance (didnt happen for me in over 40 "simulated" powerlosses) that partition gets corrupted (needs complete repartitioning of the microSD so all data on it will be gone then)

As long as you watch the 5 points above and as long as you don't drop the phone and the battery jumps out this will be safe.

Installation of the addon:

- Flash the "" any time after you installed "data2whatever".

Installation of the addon:

- Flash the "" any time after you installed "data2whatever" and the addon. (this will revert back to the normal script)

Personal remark: While this is a improvement over normal ext4 it is not the "holy-grale" of a data2sd lag fix. I'm not using this myself and use a ReiserFS as second partition instead which is more safe and completly feels the same as a "loop" device considering performance.


__________________________________________________ ________________________________
Dec14 info update:

I uploaded A mod script for CM6.1 stable by Carrol

Carrol changes the script to create a ext4 loop device on EXT4 partition.

Select Code
	$BUSYBOX mkdir /mnt/asec/extdata
	if [ ! -e /data/data2sd.ext.finish ]; 
		echo "+++Need create ext4 loopback device for data, please wait... this is 1/5 size of your ext partition"
		extsize=`$BUSYBOX df /dev/block/mmcblk0p2|$BUSYBOX grep mmcblk0p2|$BUSYBOX awk '{print $2}'`
		datasize=`$BUSYBOX expr $extsize / 5 / 1024`
		$BUSYBOX dd if=/dev/zero of=/data/ext4 bs=1048576 count=$datasize
		/system/xbin/mkfs.ext4 -b 4096 -m 0 -F -L userdata /data/ext4
		/system/bin/tune2fs -o journal_data_writeback /data/ext4
		/system/bin/e2fsck /data/ext4
		#/system/bin/tune2fs -O ^has_journal /data/ext4
		#$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
		$BUSYBOX mount -o loop,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
		$BUSYBOX chown 1000.1000 /mnt/asec/extdata
		$BUSYBOX chmod 771 /mnt/asec/extdata
		$BUSYBOX cp -a /data/data /mnt/asec/extdata/
		sleep 1
		$BUSYBOX umount /mnt/asec/extdata
		sleep 1
		$BUSYBOX touch /data/data2sd.ext.finish
	/system/bin/e2fsck -y -v -f /data/ext4
	#$BUSYBOX mount -o loop,sync,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
	#$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
	$BUSYBOX mount -o loop,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
	$BUSYBOX chown 1000.1000 /mnt/asec/extdata
	$BUSYBOX chmod 771 /mnt/asec/extdata
Note that this script is for CM6.1 stable only, only ONE EXT partition needed on your SDCard, and it will be formated into EXT4, do nanodroid before you try

Also a CM6.1 ROM with Data2Ext by Carrol can be found here
CM6.1 ROM with Data2Ext by Carrol
__________________________________________________ ______
ownhere Data2Ext script V4

2010/12/12 update V4 script:
/data/:ext4, disable journaling
/data/data:ext4 loopfile on ext4 device, enable journaling on ext4 device, disable journaling on ext4 loopfile, for fast and stable sqlite3 access.
really smooth this time
There's a version for Desire, which is here [DATA2EXT] [11/Dec] FULL BENCHMARK, V4, Improve the efficiency of IO
While improving IO efficiency, it moves all userdata to EXT so to avoid insufficient ROM space, cos the whole EXT is recognized as the internal ROM.

with ownhere's v4 script, I got my miui rom working, no data lost or crash after reboot/battery-removed:

1. miui rom 12.03 clean installation(a2sd+ script removed), then flash of v4 script. working. applying 12.03 to 12.10 and 12.10 to 12.11 ota packages, working.

2. miui rom 12.11 clean installation, flash v4, working.

3. miui rom 12.11 with a2sd+ running, 38 apps installed and /data/data moved to ext. The v4 can still do the job.

However, one problem is that Root explorer couldnot display Chinese filenames of APK , showing only ???. and if install those apks via root explorer, it just reports errors...

Another thing i am not sure of is not knowing how much v4 script could improve when there is only 1 ext partition. According to ownhere, 2 ext partitions are needed to make the best out of his v4 script...

I attached the v4 - ,in case you might wanna try:
1. BEFORE you try this package, you need to remove the app2ext script(file like 04apps2sd or 01 apps2sd) from /system/etc/init.d, or you would only get bootloop going on and on
2. And of course, Nanodroid...
3. disable signature checking in recovery...
__________________________________________________ ____________________________________________
I tried merging those files into MIUI N1 ROM.
When N1 boots for the 1st time, everything's working just fine.

Now we know the previous script is faking the Quadrant score...
Quadrant bechmark really rocks with I/O scoring 8000+ and a total score @ 3000+

But after reboot, there came some issues:
System config could not be saved;
Home button wouldn't work;
Flight mode and Quiet mode missing in the reboot menu...

Could someone pls help to rewrite the script to fit in N1 ROM?

I think people using N1 would interested in such a script or rom that brings N1 more I/O performance and more space for Apps.

But I have no knowledge of coding, don't know how to fix the issues above.

So I add download link of the script CREATED by ownhere, not by me, hoping someone could make a N1 MOD... is not a flashable package

The Following 2 Users Say Thank You to jayfallen For This Useful Post: [ Click to Expand ]
jayfallen's Avatar
Senior Member - OP
Thanks Meter 11
Posts: 114
Join Date: Feb 2010
Originally Posted by mattrb View Post
This goes in Q and A.

Also the answer is darktremor. A simple search of the the Nexus One Android Development gets that answer.
Sorry, but I don't think Darktremor Apps2SD script could do the job.

Since there is difference between Apps2SD and Data2Ext:
Apps2SD moves
/data/app, /data/app-private and /data/dalvik-cache to EXT
And with some commands /data/data could also be moved to EXT

But Data2Ext moves
/data/app to EXT4
/data/data to a virtual EXT2 device on EXT4, which is the trick to improve IO efficiency working at peak level...

SO I don't know if there is a answer fort this in Q&A...
Senior Member
Thanks Meter 45
Posts: 712
Join Date: Feb 2010
this comes up after searching

G1 data2sd instruction works for the N1 i suppose ?

**There is NO booting into recovery and wiping of the phone!**

My bad for not being clear on the wipe instructions!
1) (optional) If you are to wipe it (your choice it is not required), then press menu->settings->SD card & phone storage->scroll to bottom of screen and select "Factory data reset". This will wipe the /data partition only removing all apps and settings. BACKUP YOUR /data dir to sd, First or you will need to down load all your apps again to include paid apps!!
2) place data2sd.img in root of SDcard (fat32)
3) terminal in or adb shell in.
4) cp /sdcard/ to /data/local/bin - to copy the script to your user-space
5) chmod 0750 /data/local/bin/ - to make it executable
6) /data/local/bin/ or may work to run the script

7) once the install is done it should tell you to reboot. If you had the ddms debugger running, you can observer the log as it is working.

8) done. It may boot a little longer if you clean-slate installed and then restored your apps by copying them back into /data/app and /data/app-private which has the affect of reinstalling everything, and thus the boot will take a while if you have alot of apps like I do. Again you can observe this as the Android boots if you have the debugger running.
(Last edited by TheDeadCPU; 10th December 2010 at 10:27 PM.)
KAwAtA's Avatar
Senior Member
Thanks Meter 99
Posts: 923
Join Date: Jan 2010
I'm also confused, how does darktremor move all of that to ext? Please explain. I thought darktremor moves apps to ext. If you fail, then you sir are an idiot and gtfo.

A "simple" reread (If that's even enough, maybe 100x more for you) would've told you want he wanted.

Sorry for invading your post jayfallen!!

I for one, am glad you posted this and would like to try it once you get it going.
(Last edited by overground; 10th December 2010 at 09:51 PM.)
overground's Avatar
Moderator & Developer Committee / Recognized Developer - xxxda-developers Founder
Thanks Meter 1167
Posts: 5,235
Join Date: Apr 2009
Location: Oxnard, CA Likes: Los Angeles Lakers Dislikes: Heavy petting zoos
Try this:
I recommend only moving the data of non-essential apps and those apps which DO NOT contain security sensitive data (games, Google Earth, etc. should be fine).
T-mobile SDA, T-mobile G1 (bronze) Rooted, Nexus One Rooted 4.0.4, T-mobile G2x Rooted, Viewsonic G-tab 10.1", HTC OneX (SOLD), Kindle Fire Rooted, T-mobile SGS3 rooted, Note 10.1 rooted / GDE=360°s of fun!! /
Originally Posted by dumfuq View Post
That is correct. Or you cold use the escape sequence instead of quotes.
sh /system/sd/ Double\ post -d -u -m -f -u -q knockeduphooker9.1.1Full10-26-09
Buy me some meds
jayfallen's Avatar
Senior Member - OP
Thanks Meter 11
Posts: 114
Join Date: Feb 2010
I edited the thread title, and added download link of the script created by ownhere.

someone might wanna take a look, if you're interested in bring your N1 more I/O performance and more space for Apps.

Thanks for everyone replying this thread. I will try your suggestions.
Junior Member
Thanks Meter 0
Posts: 21
Join Date: Aug 2010
Unhappy eVil's hd rom~

it's not work on the evil's hd sense?i try that last night~ but it's very hard!!!
Senior Member
Thanks Meter 45
Posts: 712
Join Date: Feb 2010
i m abt to try this

wish me luck
jayfallen's Avatar
Senior Member - OP
Thanks Meter 11
Posts: 114
Join Date: Feb 2010
the thread @ was posted by me earlier...

that rom is just experimental, if you don't reboot, everything works fine.
once rebooted, config lost and homebutton lost...

I don't know how to fix, that's why I start this thread @ xda, hoping someone could make it work for N1...
ahronzombi's Avatar
Senior Member
Thanks Meter 15
Posts: 415
Join Date: Jul 2007
Location: buffalo
Wow this I want
Phone: Nexus One ($375 via Buffalo's Craigslist) & Samsung Vibrant(FREE)
Second Phone:G1 still alive and kicking with CM6
Rom: Cyanogen Nightly
Kernel: IntersectRaven
Recovery: ClockworkMOD

data2ext n1, data2sd
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes