yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] _bryan_:
it's the same

D:\android-sdk-windows\tools>adb shell

/ # /system/xbin/busybox mount -o dirsync,noatime,nodiratime /dev/block/mmcblk0p

2 /sd

/system/xbin/busybox mount -o dirsync,noatime,nodiratime /dev/block/mmcblk0p

2 /sd

/sbin/sh: /system/xbin/busybox: Permission denied

very strange

maybe my system is broken ,i will try to reinstall the rom later,

thanks
[Desire Android Development] interqd:
hi.. so does anyone tried this successfully in miui rom ?
[Desire Android Development] AndroHero:
do you have s-off? try downloading latest busybox from the market and try again ;)
[Desire Android Development] AndroHero:
try again, the command is, /system/xbin/busybox mount, not /system/xbin/busybox or /system/xbin/mount :rolleyes:
[Desire Android Development] sibere:
Maybe the rights are not set properly somewhere in your system.

Check that the rights for busybox are OK.
[Desire Android Development] sibere:
Man , no answer means... no answer.

You may ask 10 times if nobody can answer, nobody will.

For your info, e2compr is a kernel patch, so nothing to do with this hack.

I personally use e2compr for a linux on a USB key and I had to patch my own kernel and I'm not sure that the latest patch could be ported to the android kernel out-of-the-box.

And keep in mind that APKs are already zipped files. No space to save or speed to gain here.

finally, I have not experienced a speed improvement with e2compr on my usb key.

IMHO, not worth it.
[Desire Android Development] fogbav:
Ok ... thank you very much for the answer !

Only wanted to contribute this idea ... maybe it's totally nonsense ... but maybe there are the same effects when compressing a very slow notebook-hdd when enough CPU present ... this gives a boost on the system ...

but as you tell - many files there are already compressed ...

thanks again ... have a nice day !
[Desire Android Development] blowy666:
Yes, I´ve had a ROM with DATA2EXT before, but then I´ve read thar DATA2SD will be more stable than DATA2Ext...

I think, after a few days I will be ready with installing most of my wanted Apps...so the lags are not that bad....I was only interested if this is a normal thing ;)

I think I will stay with this combination now for the next time.

Thanks for your answer! ;)
[Desire Android Development] sibere:
Yes you're right lags are not that bad with this configuration, but you know, if we can give you even better, we will :)

But I think that a lag when installing an app is acceptable. After all we don't install 10 apps per day every day.

Lags when using the phone normally would not be acceptable but fortunately it's not the case :D
[Desire Android Development] melethron:
For me its not issue atm because i prefer titanium backup anyway (i love the dropbox upload option so i have even a backup if there is an issue with the partition table of the sdcard and i do scheduled backups every weekend). Apart from that my ROM has all of the system stuff in nand so i can still do a nandroid of the ROM (without apps).

And if some people like reiserfs i could ask IEF to implement it in the kernel of the recovery.
[Desire Android Development] melethron:
They also use raw nand but i have no idea what filesystem ...

Depends what data2ext script you mean and what you mean by stable... ;)

Ext4 with journal is 10x safer than this on powerlosses. But slower....

I did benchmark the internal nand a long time before i made that statement. I get 5mb/s and i just benched sqlite and get about 60 sq db inserts. What PVT do you have, maybe they changed mtd chips (im on PVT3).

Actually if you use a normal ROM you do the same because system stuff is on internal. Having dalvik has really benefits cause if you load a system there is read request on the app and on dalvik. If both are in internal the sd card is "free" to handle write request on /data/data. I still don't use it myself because the best performance i got on a hd rom is install everything to system and system/apps to the internal /data partition. But after this there is no space left for dalvik cache :D

It still minimizes read of the sd card and thus write request on sd card will be handled faster.
[Desire Android Development] iinga:
I have a weird bug that only happens with data2fat32 (or data2ext4). If i don't set the timezone on boot before installing data2sd (so after removing apps2sd script or whatever), then the timezone settings are not stored by the roms. Each reboot it will be in the original time of the rom (eg for MIUI chinese time).

My questions:

1) how do i stop this reverting back to the old time

2) where is the file containing to original timezone of the rom kept (the one it keeps reverting to)
[Desire Android Development] melethron:
This is a bug when /data/property is moved to sd (timezone,skins for HD Roms, etc) are stored there. I didn't find a way to fix it other then moving /data/property back to internal. I changed the script of my ROM to leave /data/misc /data/property and /data/system on the internal (like cyanogen does with app2sd) and symlink it to the sd. I didn't update my data2ext script yet, but you can do this yourself if you know how to make symlinks and mount the internal data in your startup script.
[Desire Android Development] melethron:
This is a bug when /data/property is moved to sd (timezone,skins for HD Roms, etc) are stored there. I didn't find a way to fix it other then moving /data/property back to internal. I changed the script of my ROM to leave /data/misc /data/property and /data/system on the internal (like cyanogen does with app2sd) and symlink it to the sd. I didn't update my data2ext4 script yet, but you can do this yourself if you know how to make symlinks and mount the internal data in your startup script.
[Desire Android Development] ayato kamina:
So I'm finally giving this mod a shot, but am having trouble getting past this stage. Whenever I try to flash a modified LeeDroid rom (re-zipped without 40a2sd), I get a message saying the 40a2sd file is missing. I've tried doing a search for the solution and I know I'm not the only one who ran into this problem, but I either missed the solution or it was never addressed.

Could someone let me know what I'm doing wrong? Thanks a bunch!
[Desire Android Development] danarama:
Are you rezipping and resigning? If you use Winrar you don't even need to extract to delete. Just open, delete and close.

Try that
[Desire Android Development] ayato kamina:
Roger that. I was re-zipping, but not re-signing <----I wasn't aware of this step, but I will try Winrar and report back.

Thanks!
[Desire Android Development] ayato kamina:
Crud, same problem.

E:Missing file: system/etc/init.d/402sd
[Desire Android Development] iinga:
Just disable signature verification :)

or if you have adb skills, flash the rom then go into adb shell and type the following:

mount system

rm /system/etc/init.d/{nameofapps2sdscript}

FYI:

Oxygen uses 10apps2sd

Defrost/Leedroid uses 40a2sd

MIUI uses 04apps2sd

Aurax uses 03stuff2sd

I think they are all the ones that I have found.

I have also found out why Leedroid A2SD has so many more files. I'm pretty sure it uses the DT apps2sd version which has loads of files flashed all over the place. Not sure if this has been mentioned before, but I know someone was wondering. The only file required to remove it though is the init.d script. However, its much easier to just use the NoA2sd version. This is also the version with defrost.

Thanks melethron. My skills aren't that good yet, but i'll work on it :)
[Desire Android Development] retaliate:
sorry to ask this stupid question but i really wish to know:

- the difference between A2SD+ & DATA2SD??

if want to 'fix' this in custom rom, is better we used for NON-A2SD+ custom Rom?
[Desire Android Development] iinga:
This is answered in the OP i think, but for a tldr :P

A2SD + moves apps to the ext partitions

Data2SD moves the whole /data/ partition to ext, giving you more internal space and giving better I/O, with better SD cards.
[Desire Android Development] ayato kamina:
Thanks iinga, I will give that a try. I would hesitate to call myself "skillful", but I do know how to enter adb commands, so I'll try your advice!

Out of curiosity, would simply using the Root Explorer app, then navigating into the the init.d folder and deleting the appropriate script do the trick as well? If yes, then that's soooo much easier, if no, then nevermind! :D
[Desire Android Development] iinga:
No...Its not a good idea to boot your phone and allow the init.d script to run :) All this should be done pre-boot :)
[Desire Android Development] ayato kamina:
Just visited your Data2SD options page and am thinking the easier route would be just to flash one of your two options. With the second option (i.e. flashing your data2ext4 script), would I still need to remove the 40a2sd file prior to flashing? I'm using Leedroid 2.3b with the recommended ext3 partition. I imagine I'll have to upgrade that to ext4.

Thanks!
[Desire Android Development] iinga:
Probably a good idea to upgrade to ext4, but ext3 works. the second option is melethron's script. Its pretty simple. technically you can just flash that immediately after flashing the rom, and it should work.
[Desire Android Development] ayato kamina:
Sweet. I'm actually already in the process of giving sibere's manual instructions a try again, but if I fail (which I probably will), I will do that next.

Thanks again for your help and will report back once I (hopefully) get it working.

:D
[Desire Android Development] moebius83:
well definitely disabling sync resolved almost all lags and spikes! Now I want to try to loop mount the partition and see the differences.

Let us know if you have the chance to test ext4, I'm really curious to see if it brings any improvement!
[Desire Android Development] blowy666:
Could this also be the reason why my "only GSM"-setting will not stay after a reboot?

Cause after I reboot, it is set to "GSM/WDMA automatically" again...
[Desire Android Development] op8867555:
Ask a question about do a backup :

Could I use cpio instead of tar ? (the busybox version tar isn't support the -p option )
[Desire Android Development] moebius83:
shouldn't we take care of the /system/etc/vold.fstab like how it's done in the app2sd script? i.e.:

/system/xbin/busybox sed -i 's/dev_mount sdcard \/mnt\/sdcard auto /dev_mount sdcard \/mnt\/sdcard 1 /' /system/etc/vold.fstab

otherwise when using the USB disk mode all the partitions on the SD card will be mounted on the connected computer possibly causing data loss
[Desire Android Development] iinga:
I edited your ROM's script and seems to work fine :) thanks.
[Desire Android Development] sibere:
Let me explain:

At boot, init.rc is mounting mtdblock5 (nand /data) and some services starts to use it BEFORE the sd /data is mounted. If there is nothing stored there, you won't have your settings at boot time. Unfortunately and AFAIK there is nothing to do except modify the init.rc in the ramdisk which is in the boot partition.... real pain in the neck!

But there is a solution:

After flashing a new rom, boot normally, without data2sd.

Do all the settings like language, time zone ,etc etc.

Then do the entire data2sd installation.

If you already have installed your rom:

In recovery mode, disable the 01data script (move it temporarily to another directory like /system). Reboot your phone. You won't get data2sd and all the apps you've installed but it's ok. Set the timezone and other settings you loose at bootime. Reboot into recovery mode and move 01data back to /system/etc/init.d/. Reboot and everything should hopefully be kept this time.
[Desire Android Development] sibere:
Nope. Only the 1st partition is unmounted from the phone and mounted on the computer. You keep all you apps available.

It's not the case when you use froyo A2SD b/c all apps moved to the SD have to be unmounted before unmounting /sdcard and giving access to it via USB.

So actually, it's another "plus" offered by data2sd :)
[Desire Android Development] sibere:
Hum... I'd say yes. I have the same behaviour here. But I never realised b/c I set my phone to gsm only before doing the data2sd thing and the setting is kept on the nand.
[Desire Android Development] moebius83:
That's what I thought, but before changing that bit I was able to see both partitions on my Mac, even if only the first actually mounted because the second one is ext2 in my case and isn't supported by the Os

(via Tapatalk)
[Desire Android Development] melethron:
The better I/O is actually fake from caching. There is actually a decrease in I/O thats why data2sd causes lags on slow ROMS like desire HD roms. The main difference between app2sd and data2sd is that /data/data is moved to sd (other folders also moved don't matter - apart from the settings bug). I measured the sqlite inserts and even the fastest data2sd solution is about 20% slower than the nand (i have a class 2 sd but from what i saw a better sd card doesn't make a difference in sqlite inserts).

But it only works on ROMs that use the 40a2sd script. Im rewriting my script atm to make it compatible with more ROMs (by removing the app2sd files with the update script). But it'll take more time because i want to change more stuff and post my benchmark results.

Yep, this is also stored in /data/property

Thanks for the explanation of the bug. I didn't know that but i thought it has something to do with services using /data/property before the init.d i called.

The better solution than your workaround is to leave "misc","property" and "system" on internal. They don't really need space (and to have 145mb of free nand space beeing unused isn't a gain in any way ;) ) . I already fixed that in my ROM by leaving them on internal and symlink to /data.

Time to update my normal script.

BTW: Do you know if recovery gives an error if there is a "remove" in the update-script of a file that is not there ?
[Desire Android Development] danarama:
Has anyone managed to successfully migrate to a new SD card once data2sd has been implemented?

I've been trying but just cannot get it to work.
[Desire Android Development] iinga:
yes please update your script :) i failed miserably :( - market won't install :(

But no, recovery doesn't give an error. Just prints that its deleting a file.
[Desire Android Development] sibere:
That's right but then you have to link those dirs to the NAND. You need some "skills" to do so ;) My workaround is simpler for low-skilled users.

I'll update the 01data script later when I've got time to do that automatically with bind mounts instead of symlinks.

This the updated script I'm gonna test on my phone:

#!/system/bin/sh
#
echo "Starting DATA2SD";
/system/xbin/busybox mkdir /mnt/asec/ext
/system/xbin/busybox mkdir /mnt/asec/nand
/system/xbin/busybox mount -o dirsync,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/asec/ext
/system/bin/e2fsck -y -f /mnt/asec/ext/ext2
/system/xbin/busybox mount -o loop,sync,noatime,nodiratime,nosuid,nodev /mnt/asec/ext/ext2 /data
#/system/xbin/busybox swapon /mnt/asec/ext/swap
chown 1000.1000 /data
chmod 771 /data
/system/xbin/busybox mount -o noatime,nodiratime /dev/block/mtdblock5 /mnt/asec/nand
/system/xbin/busybox mount -o bind /mnt/asec/nand/property /data/property
/system/xbin/busybox mount -o bind /mnt/asec/nand/misc /data/misc
/system/xbin/busybox mount -o bind /mnt/asec/nand/system /data/system
exit

Edit: Hum not very good... with the bind mounts, the /data reports being unmounted uncleanly by the system :( (Fortunately with no errors this time ;) )

I'm gonna try with symlinks then but I don't have much spare time today :(

Edit2: Symlinks at least allow /data to be unmounted cleanly by the system at shutdown!
[Desire Android Development] iinga:
I have migrated hajen to a new sd card.

1) Perform backup with the current setup.

2) Partition the new sd-card and run the command (after mounting it etc in recovery):

dd if=/dev/zero of=/sd-ext/ext2 bs=1048576

(you might need the /system/xbin/busybox mke2fs -m 0 -F -L userdata /sd-ext/ext2 i can't remember)

3) Transfer backup to new SD card

4) Restore backup
[Desire Android Development] danarama:
Yep thats exactly what I did. I restore ext successfully, but android doesn't see it. Its like after a data wipe and only showing 148MB internal memory

Got the ext file on SD for definite. Tried all sorts of combinations and wipes, but to no avail.

Think I need to reformat partition when I get home...
[Desire Android Development] melethron:
Thanks for the info. I make a script atm with all fixes included (property etc) and that also removes those files (i name it 01data2whatever so it will run before those app2sd scripts). Script should be finished soon. I update my thread then and post a link in this thread.
[Desire Android Development] iinga:
Edit; market works fine now...must've been an error earlier. I just played with your custom rom script, and its working.
[Desire Android Development] melethron:
Done

But i didnt test it yet on any ROM. The script of next release of my ROM is almost the same and it works there so it should work. But i dont wanna download every ROM and test it so thats up to the users. In the case it doesnt work on a particular ROM ill do some testing/fixing then.

Mount is not a good idea indeed: "Device or resource busy" on unmount ;)

Also symlinks are persistent (until format) and can be checked in recovery if there are issues.
[Desire Android Development] iinga:
I'll get testing it on MIUI...if there are other scripts named 01xxxx do they need renaming?
[Desire Android Development] danarama:
OK SD card upgraded. My formatting was out so I had to start from scratch there.

Since I was starting from scratch and had titanium backups, rather than restoring ext via clockwork, I did the whole process end-to-end and titanium restored.

EDIT>

Struggling to push a new 01data with sync on.

Text I'm pushing in the file is:

#!/system/bin/sh
#
/system/xbin/busybox mkdir /mnt/asec/ext
/system/xbin/busybox mount -o dirsync,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/asec/ext
/system/bin/e2fsck_recvy -y -v -f /mnt/asec/ext/ext2
/system/xbin/busybox mount -o loop,sync,noatime,nodiratime,nosuid,nodev /mnt/asec/ext/ext2 /data
#/system/xbin/busybox swapon /mnt/asec/ext/swap
chown 1000.1000 /data
chmod 771 /data
exit

Thats right isn't it?

Keep ending up losing my data2sd space.
[Desire Android Development] ayato kamina:
Welp, I wasn't able to get sibere's Data2SD to work, obviously I'm doing something wrong, but I did get your Data2Ext4 zip flash to work, however, it made my phone very VERY sluggish so I will try again after completely wiping, formating, repartitioning, etc. and hopefully that will do the trick. Most likely I will keep plugging away with Sibere's fix until it works though as I've been hearing good things based on what I've read.

Boy, was it ever nice to see so much free space on my internal memory though!
[Desire Android Development] iinga:
Only thing I can think of: did you make a looped ext2 partition or ext4?
[Desire Android Development] danarama:
Looped ext2
[Desire Android Development] iinga:
Mmm only other thing that comes to mind: did you push e2fsck_recvy?
[Desire Android Development] danarama:
Nope. And I never have

I can run the command manually and sync works.... until reboot
[Desire Android Development] ownhere:
Very good idea!

For HDROM port, add a swap partition is Necessary, DHD include 768M ram+2.3G nand rom, so DHD don't need swap, but Desire need it.

But almost all kernel on xda had disabled CONFIG_SWAP, so swapon is no effect.:)

I compile a kernel with CONFIG_SWAP=y, then mkswap/swapon, my DHD port is so smooth after open many webpages or run large app.

Why active swap parition speed up phone? I think the answer is:

DHD's apps is larger than Desire's, so open and deal with apk need to consume a large amount of memory, if we do not open the swap, then, Desire's physical memory is too small, the system frequently to kill the old process to accommodate new, If active swap, we can significantly reduce the process of opening and handling.
[Desire Android Development] danarama:
Hmm, but on the Baadnwz HD rom I put on a friends desire, its running really well.

He only has the class 2 card supplied though so SWAP wouldn't be worth it for him.
[Desire Android Development] danarama:
Sorted. Mounted init.d as R/W and manually typed sync into the 01data file, rebooted. Several Quadrant's later, Not getting over 2100 so queitly confident Sync is now ON!

YAY
[Desire Android Development] melethron:
You can try the data2whatever script. It has siberes loop device as an optional addon. Also partition the sd-ext with gparted instead of recovery could make a HUGDE difference. The lags were much better after i made it aligned (gparted makes that as default).

I never thought that swap was disabled in most kernels ..... lol ... i thought it is another issue.....

It's really a nice idea. The only issue i see there is that swap may prevent unmount of /data if it is on the external partition (device or resource busy).

How large did you make the swap file?

Btw i made some sqlite benches and reiserFS was the best so far in sqlite inserts. On my sd it was even more improvement than the bench of phoronix:
[Desire Android Development] ownhere:
My benchmark on my sandisk C2 16G TF has different result:

___________ext4_______reiserfs____ext3

sqlite insert_31.31/s_____25.69/s____25.69/s

filewrite____3.02M/s_____4.69M/s___1.90M/s

fileread_____10.49M/s___6.84M/s____10.06M/s

Maybe my test was wrong?:)

From my result, EXT4 is best choice for my SD card, quick sqlite insert, quick read (In most cases, "read" request much more than "write")

About swap, I extract .config from popular kernel on xda(vorkKernel,couttstech), they all disable CONFIG_SWAP. And HTC Stock kernel is disable it,too.

Swap can speed up phone which use DHD port, Slow card will also benefit.

Because:

step1. When load a app from disk, system need follow step: open-apk, open-odex/dalvik-cache, extract-apk resources, dalvikvm/jit-classess. This is need a lot of CPU usage.

step2. If free memory is low, system will kill app. Whenever system need a app reload, repeat step1.

After active swap, the RAM is enlarged, so the 'kill' action been replaced with 'swap-out' action, 'swap-out/swap-in' takes less CPU time than the 'kill/reload', and less disk IO.
[Desire Android Development] ownhere:
BTW:You make a good script data2whatever, well done! :)

You should check my script v4, many problem I'v already resolve in it. such as 'why mount to /mnt/asec (don't require s-off)', 'why symlink /data/property to mtd', :D

And I make a script V6, use swap, loop device, journal, really smooth, really safe. hehe.
[Desire Android Development] danarama:
Ok so anyone got any use for all the spare nand space we have now?

;)