yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] sibere:
That's an other option but everybody's not S-OFF (I'm not ;) )

Yes indeed. The 2nd (ext) partition is now ext4 instead of FAT + file + loop.

And this is better for nandroid backup too !

What you can do is to backup you actual ext file to a tar file and then restore it to the new EXT4. let me explain:

In recovery

mount /sd-ext

/system/xbin/busybox mount -o loop,sync /sd-ext/ext2 /data

mount /sdcard

cd /data

tar czvf /sdcard/ext2.tgz * (this will create a compressed backup in your 1st FAT partition)

when the backup is done,

cd /

/system/xbin/busybox umount -d /data

umount /sd-ext

format your 2nd partition to EXT4 and mount it:

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

/system/xbin/busybox mount -t ext4 /dev/block/mmcblk0p2 /data

cd /data

tar xzvf /sdcard/ext2.tgz

cd /

umount /data

You're goo to go :)
[Desire Android Development] sibere:
I don't mind at all. Maybe you can post it here and I'll update the OP accordingly, without forgetting to give you full credits for it :D

Is it the script you posted a few posts ago?

Looks like everything's there :)
[Desire Android Development] Droidzone:
Not that one..

This one runs all your commands and even creates the file system during the flashing..

Just need to flash this after a full reboot of any Rom with init.d support..
[Desire Android Development] sibere:
Wow very good job then!

Feel free to choose between creating a new thread or posting it in this one.
[Desire Android Development] Droidzone:
Dont need the new thread...That wouldnt be appropriate...Could never do the level of work that you did to create Data2sd for us..I've added the file in the previous post..

By the way, I do need your permission to use this for a Rom I'm releasing :D
[Desire Android Development] sibere:
Perfect! I'll update the OP with this great script ! Thanks mate!

Do you? ;)

No problem, there is no really copyright it's done for the XDA community :)
[Desire Android Development] Droidzone:
Dont thank me.. :D

By the way, do test it a bit..

It does work for me..Creates everything after a complete wipe..Still, it's just been made.. :)
[Desire Android Development] danarama:
What? Really?

So in essence, all I need to do is backup my ext2 to .tar as suggested by sibere, (or titanium back up), reformat my second partition as ext 4, flash Rom then your script?

If so, that's immense!!!
[Desire Android Development] Droidzone:
Yup..That's it...

A lot of credits go to Firerat, who taught me most of everything I know about the scripting.. :)

By the way, flash rom, then reboot to recovery to apply my script..
[Desire Android Development] sibere:
I just had a quick look. Seem fine so far. I've update the OP and uploaded the script.

Did you try the patched sqlite lib as well? (only for sense rom I guess but there is AOSP versions available too)
[Desire Android Development] danarama:
Wicked work. Building on all siberes amazing work.

I may convert my current Rom using this then see if getting rid of loop helps with the new gingervillain

Edit, always flash manually from recovery anyway :)
[Desire Android Development] Droidzone:
I did try it.

I will add it too..It did improve my performance a lot..Didnt add it b/c I was on HD rom when I tried the script
[Desire Android Development] danarama:
If you add it, will you be making an AOSP version too?
[Desire Android Development] Droidzone:
I can if I can get the patched file...By the way, is there any difference in installing Data2sd on AOSP that I need to be aware of..My experience with Aosp is limited..Though I've tried it on Miui..I did get stuck once on plain Cyanogen
[Desire Android Development] danarama:
Contrarily, no real experience with sense. From what I can tell its the same though. Everything you change on a sense Rom for data2sd normally is in android itself, so everything should be the sane
[Desire Android Development] sibere:
The thing is with AOSP is that I'm not sure that they unmount /data nicely on shutdown.

You can check that by shutting down the phone, start it in recovery , mount /system and do a /system/bin/tune2fs -l /dev/block/mmcblk0p2

If the Filesystem state is "clean" then that's fine.

If not, then remove the ^has_journal from the format line because in this case a journal is strongly recommended to avoid data corruption.
[Desire Android Development] danarama:
Can I just have journal anyway?

On ext2 only ever had data loss using reboot options with sync off. Since sync on and only using power off option, never had problem
[Desire Android Development] danarama:
OK on my ext2 loopfile,

/system/bin/tune2fs -l /dev/block/mmcblk0p2
tune2fs 1.41.10 (10-Feb-2009)
/system/bin/tune2fs: Bad magic number in super-block while trying to open /dev/b
lock/mmcblk0p2
Couldn't find valid filesystem superblock.

Not sure if that helps. Maybe not since I'm oldschool ;)

EDIT> @ droidzone, flashed your installer with ext4 partition and full wipe with GV 0.7. Must report it was successful :)
[Desire Android Development] sibere:
For your loop file:

mount /sd-ext

tune2fs -l /sd-ext/ext2
[Desire Android Development] danarama:
Im on ext 4 now, but will check in a bit :)
[Desire Android Development] danarama:
~ # /system/bin/tune2fs -l /dev/block/mmcblk0p2
/system/bin/tune2fs -l /dev/block/mmcblk0p2
tune2fs 1.41.3 (12-Oct-2008)
Filesystem volume name: userdata
Last mounted on: /data
Filesystem UUID: 42474e14-46f7-47bc-900e-a9cf00b1dd22
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: ext_attr resize_inode dir_index filetype extent flex_b
g sparse_super large_file uninit_bg dir_nlink extra_isize
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: [SIZE="3"] [B]not clean[/B][/SIZE]
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 67104
Block count: 268288
Reserved block count: 0
Free blocks: 216029
Free inodes: 63817
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 65
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 7456
Inode blocks per group: 466
RAID stride: 64
RAID stripe width: 64
Flex block group size: 16
Filesystem created: Sat Jan 15 19:30:01 2011
Last mount time: Sat Jan 15 20:08:51 2011
Last write time: Sat Jan 15 20:21:52 2011
Mount count: 1
Maximum mount count: 37
Last checked: Sat Jan 15 20:08:51 2011
Check interval: 15552000 (6 months)
Next check after: Thu Jul 14 20:08:51 2011
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Default directory hash: half_md4
Directory Hash Seed: e4b055e8-98f9-4751-b650-78bd5de61104
~ #

Where can I locate the ^has_journal to remove please?
[Desire Android Development] peterme58:
Sibere I was wondering wether with your updated script is it possible to flash something in recovery like fonts, or circle battery, and not having boot loop, after enabling data2sd? In the pervious one if I flashed fonts for the font changer the phone started boot loop until I reverted the flash! I didn't try it yet, is it the same? In melethron data2whatever there was'nt any issue.
[Desire Android Development] ownhere:
@sibere: I strongly recommend that you try EXT4 with nodelalloc option. Usually everyone thinks EXT4 faster than EXT3/EXT4-nodelalloc, because Delay-Allocate is a new feature from EXT4. But DA is slower than noDA on SSD/FlashMemory.

I ever post my benchmark at this subforum, but it been moved to general section. hehe.

And ,With enabled journaling, EXT3 get the best score on my Phone:

my Kernel:sense 2.6.32.28, OC to 1113Mhz, BFS363, SIO scheduler, ondemand cpu power scheduler:

EDIT: enable journaling on /data/data, ordered, sense HDROM.
[Desire Android Development] melethron:
I had no difference with no_da_alloc but others also have. Sd-cards are strange :)

I think also that sio is a good scheduler. Better merging than noop and no starvation of io requests (because of deadlines). And in comparsion to deadline there is no sorting by seek time but FIFO. Only thing it is experimental. Here are 2 good publications about scheduling:

http://xdaforums.com/showpost.php?p=10626961&postcount=541

I really wonder if there some really flash optimized schedulers out there....Noop and deadline are rather simple and there is much room for improvement.

Best Bench i got this far was with jfs + 1113oc + deadline

Its strange that on jfs every other scheduler than deadline performs worse (also sio and v(r) ). I had similiar results with noop and deadline on all filesystems but on jfs deadline is a lot faster. I think this can be related to cpu usage. Also jfs is completly stable so far. 20 (unclean) reboots and no corruption.
[Desire Android Development] ownhere:
JFS get the best IO score, but I can not accpet lots of FC after power loss or adb reboot. So I introduce JFS only, not real use it.

this is another good page for max performance in linux:https://wiki.archlinux.org/index.php/Maximizing_Performance
[Desire Android Development] sibere:
is it reporting not clean after a normal shutdown (not reboot) and you type the tune2fs command in recovery on an unmounted FS?

If you don't have journal and want to add one, just type in recovery mode on an unmounted FS

/system/bin/tune2fs -O has_journal /dev/block/mmcblk0p2

/system/bin/e2fsck -yf /dev/block/mmcblk0p2
[Desire Android Development] sibere:
I'd say if everything is flashed into /system, there should be no problem.

If it's flashed into /data then you mush mount the ext4 partition to /data before flashing.

You can use the command line from the script.
[Desire Android Development] sibere:
Strangely enough I have about the same score with my EXT4 CFQ and noauto_da_alloc (this is my mount options: -o barrier=0,noatime,nodiratime,nosuid,nodev,nobh,nouser_xattr,noauto_da_alloc,commit=20). Any other setting gives me worse score. Looks like every SD behaves differently and there is no universal better option. So far it has been said that usually noauto_da_alloc gives a good improvement. Same for delayed allocation. nodelalloc makes my IO score dropping by 1000pts. But that's Quadrant, not real life tho :)
[Desire Android Development] melethron:
I made my 20 reboot Stress test (reboot directly after boot). Journal relayed 100% fine. I lost data 1 time. This is the same as I get for ordered (!!!) data on ext4.

As long data is written while system just goes off this data is either lost or corrupted. Data writeback is corrupt data then. Data ordered lost data.

I had one fcs on ext4 data ordered as well while doing reboot stress test. Maybe you just had bad luck what data was written on shutdown.
[Desire Android Development] ownhere:
I think the function of noauto_da_alloc and nodelalloc is the opposite.

noauto_da_alloc:force kernel always use EXT4 Delayed Allocate feature.Did NOT detect data truncate issue.

nodelalloc:force kernel always disable DA feature.

relate page:http://rawhidewatch.wordpress.com/2009/04/13/ext4-on-intel-x25-m-ssd-needs-nodelalloc/

Yes. this must be SD different.

I found DesireHD use EXT3 for his internal emmc, I tried replace /data/ with EXT4, the score is worse.

So I try EXT3 with my Desire, then get the best IO score. My SD is sandisk UltraMobile C4 16G.

Maybe good SD need nodelalloc, bad SD need noauto_da_alloc.
[Desire Android Development] ownhere:
will try it again.

FC may be due to loop, which for speedup sqlite3 one month ago. didn't need loop now.:)

EDIT:tried already. result: (JFS mount with:noquota,errors=continue,noatime,nodiratime,nosuid,nodev; EXT3 mount with:data=ordered,commit=5,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev)

JFS QD IO Score:37xx

EXT3 QD IO Score:40xx

JFS TAP:26xx

EXT3 TAP:30xx

seems that EXT3 is the best fit for my SD card.

and another tip for @sibere, use tune2fs -E hash_alg=tea for EXTx maybe speedup IO.
[Desire Android Development] melethron:
I never liked loop. I didn't and still don't use it. :)
[Desire Android Development] melethron:
Hmm. I test nodelalloc. My card is low class but has a good controller.
[Desire Android Development] ownhere:
I've tried JFS, this is result: (JFS mount with:noquota,errors=continue,noatime,nodiratime,no suid,nodev; EXT3 mount with:data=ordered,commit=5,barrier=1,nouser_xattr, errors=continue,noatime,nodiratime,nosuid,nodev)

JFS QD IO Score:37xx

EXT3 QD IO Score:40xx

JFS TAP:26xx

EXT3 TAP:30xx

seems that EXT3 is the best fit for my SD card.

and another tip for @sibere, use tune2fs -E hash_alg=tea for EXTx maybe speedup IO.
[Desire Android Development] Droidzone:
Sibere,

Can you recommend a stable kernel with ext4 support for Stock Sense 2.2? I was porting 2.29.405, and importing Leedroid (snq) kernel is causing problems with the Wifi..
[Desire Android Development] melethron:
I also tested ext3 vs jfs. On cfq/bfq/si/vr/noop i get a higher overall scrore than jfs. But with deadline scheduler the score from jfs and ext3 are the same. But jfs is a faster on sqlite and a bit slower on read. Since writes are the bottle neck i tend to prefer it. If daily use feels same as reiserfs or better i use jfs then. Also because it has lowest cpu usage of all fs.

If you use another kernel make sure you also replace the system/lib/modules. I had wifi issue with a kernel because i forgot to replace the "bcm4329.ko" module.

Also coutts svs kernel is very stable and has snq fixes and siberes batfix included.
[Desire Android Development] Droidzone:
Edit: Thanks a lot! That fixed it!
[Desire Android Development] kluzik1:
Hi, I was wondering if there is a chance to install data2sd with baadnwz 1.8 if yes could you send me a link or tell me the steps which I have to do during flashing the rom. I'm using now leedroid with a2sd and its brilliant but I preffer having hd rom. Thank you for your help
[Desire Android Development] Droidzone:
Yes indeed.

Wipe everything

Install Badnewz rom after removing 40a2sd script from /system/etc/init.d/

Remove the update-script from the rom and replace by this

Flash the rom

Boot into Android once

Reboot into Recovery

Install my flasher

Done
[Desire Android Development] kluzik1:
wow, that was quick could you tell me where is this update script in rom?
[Desire Android Development] Droidzone:
\META-INF\com\google\android
[Desire Android Development] Nitin985:
@droidzone how so I install your zip on leedroid 2.3d a2sd thanks in advance
[Desire Android Development] Droidzone:
Try the same method..

Check init.d for the name of the script

Dont use the same update-script though..you will have to manually edit out the entries referring to a2sd
[Desire Android Development] Nitin985:
I had a look through but I don't know how to remove them I'm not very good this kind of stuff
[Desire Android Development] Droidzone:
Better to install the Leedroid non A2SD version then.
[Desire Android Development] Nitin985:
Ok thanks :)
[Desire Android Development] melethron:
Add a line to remove the script after extraction of system. Makes step 2 obsolete. A bit easier for unexperienced users that way ....
[Desire Android Development] Droidzone:
Wouldnt that throw an error if the script isnt found? Would it?

Btw, I asked a qn in your data2whatever flasher thread..Would be happy if you could help out..
[Desire Android Development] Droidzone:
The problem is that my script is supposed to be flashed after a full boot of the system after rom install..If flashed along with rom install script, it seems to be failing..
[Desire Android Development] melethron:
No errors. Data2whatever remove many different scripts. It like if you do a "rm" in a shell script. It reports that nothing is there but still continues. (and you wont see the messages in recovery so it scares no one ;) )

I take a look at your scripts another day. Want to release next version of my rom today maybe (or at least tomorrow) and dont have much time.

You can try to compare it to my script and ownheres script. To check if my script is working while i made it i used adb shell and see if everthing is copied to where it should be and proberly mounted.
[Desire Android Development] Droidzone:
No probs.. I know how tough it is to release roms..Been having problems all day..

Just released mine today...Also my first thread in [dev] section :)
[Desire Android Development] sibere:
Richatdtrip kernel is fine for me
[Desire Android Development] Moe5508:
Gives an error at step about missing 40a2sd script...
[Desire Android Development] melethron:
Works fine with updater-script. I didnt test with update-script.
[Desire Android Development] Droidzone:
Did you use the modified update-script I posted?

If not, use search to find any references to 40a2sd in the script and remove it before flashing..
[Desire Android Development] Moe5508:
Hmmm, where is the updated script?
[Desire Android Development] Droidzone:
It's in my post which you quoted. :)
[Desire Android Development] Moe5508:
Sadly, hasn't worked for me. Still gives the 40a2sd error...

Melethron mentioned the updater-script. Where is this?
[Desire Android Development] Droidzone:
Weird..I posted that b/c I've been using that myself on Badnewz..

There is no updater-script on Badnewz..Leedroid has it though
[Desire Android Development] Droidzone:
Just remove the foll line from update-script:

set_perm 0 2000 0755 SYSTEM:etc/init.d/40a2sd

And remove the script itself from init.d
[Desire Android Development] Moe5508:
My bad. I've got the whole thing in perspective now and have edited the update-script by removing reference to the a2sd and then the actual file itself. Should be good to go now. Been away from the forum for a looong while over the festive holidays! Thanks a lot!
[Desire Android Development] josdehaes:
Hello,

sorry for jumping in. This is the first time I try DATA2SD. I installed StarBurst, and with that ROM I notice the following:

When choosing 'disk drive' as USB mode, it mounts the SDCARD partition, but ALSO the SDEXT partition (on my linux system). The /data partition stays mounted in android. Probably not a big problem as long as you don't touch the mount point in linux, but annoying nevertheless.
[Desire Android Development] sibere:
Yep. That's the same for macOS users. As long as you don't delete anything on the /data partition, you should be fine :)
[Desire Android Development] moebius83:
having a double mounted filesystem, even if you don't touch it on your linux system is definitely a danger that will 99% of the times lead to corruption.

Luckily it's kinda easy to fix, just run:

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

and either restart "vold" or reboot the phone

NOTE: unless your desire is S-OFF you'll need to issue this command in recovery mode.

@sibere

consider adding the attached script to the update zip and running it inside the update-script, credit goes to teppic74

View attachment fixfstab.zip
[Desire Android Development] sibere:
Thanks!

Actually all the credits for the scripts goes to droidzone, he is the man for the script! :)

Fortunately I never had issues with that b/c I'm mounting my phone on windows OS.
[Desire Android Development] melethron:
Just wanted to answer to that but you was faster. For those without adb or terminal. It can also be done "by hand" (if you are s-off and have an app like root explorer). Edit the /system/etc/vold.fstab from:

dev_mount sdcard /mnt/sdcard auto ....

to

dev_mount sdcard /mnt/sdcard 1 ...
[Desire Android Development] josdehaes:
thx, worked for me.
[Desire Android Development] sibere:
do we have to be S-OFF to edit this file? Rooted in recovery mode is not enough?
[Desire Android Development] moebius83:
recovery is just fine because you have /system read/write access, I was saying S-OFF is needed if you want to edit that file while android is regularly running
[Desire Android Development] Droidzone:
Does it need to be run every time the system starts?

Modifying the file as part of script might be a bit of a problem...Running a command is ok to add..
[Desire Android Development] moebius83:
just once, the setting will stick through reboots
[Desire Android Development] Droidzone:
To confirm, running the following command once, is all that is necessary to fix the issue?

busybox sed -i 's/dev_mount sdcard \/mnt\/sdcard auto /dev_mount sdcard \/mnt\/sdcard 1 /' /system/etc/vold.fstab
[Desire Android Development] moebius83:
yes, maybe the full path to busybox is better, most custom roms already have this this fix but it won't hurt, because if the file is already patched, nothing will happen.
[Desire Android Development] Droidzone:
I have a problem on my Data2sd based rom, with Adfree

It will not download the hosts..

I asked Leedroid who had the same problem with his Rom, and told me that:

His updater script shows:

I tried that, but that didnt fix it. Is it something to do with data2sd, and can it be fixed?
[Desire Android Development] Droidzone:
Edited out
[Desire Android Development] chris2busy:
Hey guys..i have read the first page fully , but just to be thorough i want to make a recap and u could tell me if im missing something :)

I plan to use data2sd on Defrost with a fat32 and a ext4 partition..so :

1)remove a2sd scripts from rom zip

2)flash the zip , having already wiped

3)flash the data2sd installer

4)done

Should i proceed this way? or am i missing something?
[Desire Android Development] Droidzone:
That's it..

By the way, you need to reboot after step2

Reboot into recovery once more and proceed to step3
[Desire Android Development] chris2busy:
Thanks mate...you're golden!
[Desire Android Development] Droidzone:
Sibere, I've been experimenting with the snq reboot menus..

And I have to say, the Hot Reboot option doesnt seem to be causing any problems with the new script..
[Desire Android Development] melethron:
@sibere:

Hey, i read a bit through stride.... i think it will least sure that i wont hurt to use it. I tested it and there was 0 improvement (unlike on partition alignment).
[Desire Android Development] chris2busy:
Anyone, by any chance know what the name of the script for a2sd file could be? i am going to try on Defrost but i really dunno which is the script to be deleted..
[Desire Android Development] Droidzone:
Flasher zip to remove A2SD scripts -Prerelease

Try my new flash for automatically removing A2SD scripts. Needs to be directly flashed after the rom install, even before booting..

This is pre-release. It wont do any harm, but still, there may be scripts missed by this. If it doesnt work for you, and you find other A2SD scripts not removed by this script, do tell me, so that I can update..

(Calling it a day now.. )
[Desire Android Development] chris2busy:
worked! ty yet again man!
[Desire Android Development] sibere:
it is working for me.

Symlink is used from /system/etc/hosts to /data/data/hosts with 644 root.root
[Desire Android Development] sibere:
Coo! I'll update the OP with a link to your V2 :)
[Desire Android Development] Droidzone:
Yup. I had tried that later and fixed it.. :)
[Desire Android Development] sibere:
Stride is from what I got from manuals more for the journal at mke2fs stage but strip-width is making sure that each block of data is starting a the beginning of a 256k block (with 4096b blocks and stripe witdth 64)
[Desire Android Development] melethron:
For those that want a zip to align the partition (like gparted) can use the ext 4 zip:

http://files.c0urier.net/melethron/index.php?dir=Avaritia_HD/alignment/

It formats in recovery while the zip is flashed and uses fdisk to make a 1024k alignment.

You still need to remove journal on ext4 with tune2fs
[Desire Android Development] sibere:
Thanks!

Partition alignment is of a great help to improve performances and I strongly recommend to use whether Gparted or this automatic script.
[Desire Android Development] Droidzone:
Suppose this were to be automatically run during the initial Data2sd setup, at what point should it be run? And it will not touch the Fat32 partition, will it?
[Desire Android Development] docnasef:
Sorry but where do we get this tune2fs??

the OP of this thread had an e2fsprogs-arm, that it?
[Desire Android Development] Droidzone:
It is there in the new binaries pushed to bin