yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] cordell12:
am I close? I dont get the exact code on page one when I give the "mount" command. I also seem to stick at dd if=/dev/zero of=/sd-ext/ext2 bs=1048576. I am doing this on HTC Hero. Back to the drawing board! lol

UPDATE.............

HECK NO I AM NOT CLOSE!!! I just nandroided back and put regular SDcard in and did the df, its the same besides a little space, thats only from a bigger sd! LOL
[Desire Android Development] ahac85:
can someone please edit this script so that its i will be using ext4 instead of 2??

#!/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
[Desire Android Development] melethron:
Loop sucks. Fat sucks. Enough said ^^

quote from #project-voodoo about loop:

[02:24] <supercurio> cheat quadrant

Btw no offense. Still respecting your work.
[Desire Android Development] sibere:
:)

Go for no loop and ext4 no journaling then ;)
[Desire Android Development] ahac85:
i dont get this, ive bouught a 16gb microsd card, do i simply make 2 fat32 partitions and NO ext partitions?? is that it? then just flash rom and script update??
[Desire Android Development] Droidzone:
Well, I prefer DATA2SD right now over the others..

For one, I like to see what's happening on my system, when I change it, command by command

Second..I spent some time with your DATA2SD commands understanding it. :)

Still..Incorporation into the downloadable roms by the devs would have been nice..
[Desire Android Development] danarama:
You have to flash the rom you want to use first, then carry out all the steps in the first post

Yes, you need to FAT32 partitions
[Desire Android Development] f_padia:
can anyone explain how moving /data to ext is faster/ more efficient that running on internal memory? I thought SD is much slower than RAM?
[Desire Android Development] ahac85:
How can I make partitions, i use gparted but can only see one in windows when I created two in gparted doesn't make sense
[Desire Android Development] sibere:
It is making sense as Windows cannot see the 2nd partition on a flash/sd card.

Make sure that gparted formated the 2 partitions.

Stick your card in your phone and see if you have the 2 partitions.
[Desire Android Development] sibere:
internal NAND is the desire is not superfast.

If you SD is faster, you should get a performance increase.

The OS and you apps are not running from RAM tho but from a internal flash memory!

But people have a tendency to forget that the title of this thread is "More space...."

That is the main idea: getting more space for storage! I don't have the feeling that the internal NAND is very slow on everyday usage. So if I can have at least the same performance with more space, I'm happy :)
[Desire Android Development] woti23:
internal storage is not RAM. both internal storage and sd are NAND-based technologies.

(which is a technology for flash-memory. the other technology is NOR-based).
[Desire Android Development] sibere:
Yep.

The difference is that internal is a MTD device whereas SD is block device.
[Desire Android Development] mattiadj:
I have made a lot of try with dhd Rom and with data2ext but the lags of data2ext are impossible!!!the phone works one time on 5!!!

So I came back to leeDroid with data2sd and all is very very smooth!

Now my question is: how can I use dhd Rom and data2sd with second fat partition with size bigger than 2gb?any possibility?

sent from the future
[Desire Android Development] bluelavender:
i gotta agree with you... last week was my "flashing week" , experimenting with so many data2ext. All ended up not workable . The best combination was like you said, leedroid with sibere data2sd, although for now i'm with Z with app2sd first... since at that time i need the phone to go urgently up and cannot delay to apply data2sd script to leedroid rom.

i think i will let my phone nand to "rest" first before i go back to leedroid+data2sd :)

BL
[Desire Android Development] mattiadj:
Installed without problem on latest leeDroid but remember to replace busybox with update version!

sent from the future
[Desire Android Development] sibere:
It's obvious that my data2sd is not perfect. It has the advantages of being at least for me quite stable and still simple compared to other solutions. Even the script is really easy and straightforward.

If anyone want more safety and don't like the idea of the loop device, ext4 and formatting 2nd partition straight to ext4 has always been an option.

When I have more time, I will put that in more details in the OP.

ATM it's working fine and I want to have a deeper look into ext4 as google seems to leave yaffs2 for ext4. What I've done so far is creating a 128Kb blocks aligned 2nd (ext) partition and made a 128Kb ext4 block aligned on it, without journal.

The script ATM is very basic and no fsck is done at bootime. But as /data is unmounted nicely on hour HTC roms, I'm not really getting concerned about fsck :)
[Desire Android Development] danarama:
I agree. My phone is very stable and I don't seem to experience any lag either.

Sometimes I run into bother when flashing. It has always been fixable though

--------------------

DeFroST FAQ... http://xdaforums.com/showpost.php?p=6622965&postcount=2
[Desire Android Development] mattiadj:
I don't understand a thing: when I flash new Rom I always make all process by hand....is possible to make it automatic during Rom installation?

sent from the future
[Desire Android Development] lantex:
Dear Sibere,

Many many thanks, finally get closer to the sucess.

One more request, could you please recommand me a better kernel and teach me how to update it? (I searched the forum and got lost in the myriad posts)I will be very very appreciated.

PS: My kernel edtion:

2.6.32.15-g5d39305

htc-kernel@and18-2#1
[Desire Android Development] danarama:
All you need to do is ensure you have latest busybox in /system/xbin/busybox and put 01data in /system/etc/init.d (remove any a2sd file) then flash the rom.

You already have the ext file on SD so you dont need to do anything else.

Flashed a few roms and this is all that is needed.
[Desire Android Development] mattiadj:
I have two fat32 partition no ext...

sent from the future
[Desire Android Development] danarama:
Yes but you created a loop device and when you did the command:

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

you created an EXT2 file inside your second FAT32 partition.

Once you have that file, you dont have to create it everytime.

All you need to do is what I said above.
[Desire Android Development] Droidzone:
I have started getting a weird error at the busybox installation step.

using Leedroid 2.3 w/o A2SD+

Flashed Leedroid, did not reboot from Recovery

Trying the foll in recovery:

adb push c:\busybox-armv6l /system/xbin/busybox

Getting:

C:\Software\htc\android-sdk-windows\tools>adb push c:\busybox-armv6l /system/xbi

n/busybox

failed to copy 'c:\busybox-armv6l' to '/system/xbin/busybox': No space left on device
[Desire Android Development] qbus00:
Hello guys

I'm facing strange problem with DATA2SD. It is not connected to any kernel or SD card.

When I configure data2sd on ANY card after few ours I can find in kernel log that there were errors when reading data from mmcblk0p2 device and it automatically remounts that partition into readonly mode - I see that because almost all applications are FCs.

I tried different kernels, exts (2,3,4), types of mount (direct or through loop device), partition sizes and three SD cards (2 x class 4 and 1 x class 10).

I'm really confused why it's happening... What's more - it's not happening when using app2sd, but I assume that this is because of much less write operations.

Anyone of you had the same issue (and possible resolution)?
[Desire Android Development] dur09:
is it possible to make this work on Leedroid 2.3 (a2sd or no-a2sd)?

because when i removed 40a2sd (in a2sd) and re-zipped this rom again i wasnt able to install it
[Desire Android Development] sibere:
first of all, nope, never had that. But you can tweak ext2 to keep going even if there is errors. you may need to use tune2fs for that but for me it's by default set to "continue"

tune2fs -e continue /dev/block/mmcblk0p2

but do also a e2fsck -f -y /dev/block/mmcblk0p2
[Desire Android Development] qbus00:
Yeah, I know that I can change default onerror behaviour from remount-ro to keep going. However, I'm concerned about data loss then... and I don't want to do e2fsck every two hours or so ;).

I'm wondering if this is fault of some hardware inside my device? I noticed that this error occures only when device is in sleep mode - never when I'm doing something.
[Desire Android Development] mattiadj:
The best way is to replace burybox in before flash in the Rom package.before that I have got a lot of problem with busybox.

sent from the future
[Desire Android Development] sibere:
If it only happens to the ext partition I would be surprised if it was the internal HW.
[Desire Android Development] mattiadj:
Ok I'll try.its possible to try with any other Rom that fit only in the nand?

sent from the future
[Desire Android Development] ayato kamina:
hey mattiadj, is this tutorial still up to date or have any steps changed/improved since? I'm thinking of trying it soon.

Also, I already have an ext4 1 gig partition created via Amon Ra Recovery. Does that meet the partitioning requirement as you've outlined?

thanks a bunch!
[Desire Android Development] hajen78:
Would this work with data2sd on Defrost ?
[Desire Android Development] mattiadj:
I use this just yesterday with latest leeDroid and all is perfect!

I suggest to use data2sd file of OP.may be more update than one in my post.

An important thing is to convert your ext4 to fat32 before do all.

Bye!

sent from the future
[Desire Android Development] mattiadj:
I think yes but I never use it with defrost, ask to sibere!

sent from the future
[Desire Android Development] ayato kamina:
Good stuff, those were the answers I was looking for! Thanks a lot!

Will give this baby a shot when I have time.
[Desire Android Development] danarama:
Should work on all
[Desire Android Development] qbus00:
I was curious about data loss in "continue" mode. I switched filesystem using tune2fs, then check at least 3 times if it's set to continue for sure (it was).

And you know what? Even though after first partition access error the filesystem was remounted into RO mode :(.

This is so strange for me....
[Desire Android Development] Droidzone:
I tried that too. But the busybox version I used for flashing was old. Tried adb push to update it with the newer one. By the way, if I rename busybox-armv6l to busybox, put it in a zip and upload, maybe that would that work?
[Desire Android Development] sibere:
Could you copy here is details the way you try to insert the updated busybox to /system?

how much space left do you have on system? (df -h) Is system mounted RW ? (mount) What recovery are you using? Mine is clockworkmod 2.5.0.7
[Desire Android Development] mattiadj:
Yes replace busybox BEFORE flash directly in Rom

sent from the future
[Desire Android Development] hajen78:
Wich is best ext2 data2sd, or an ext4 loop device with no sync
[Desire Android Development] sibere:
Even if EXT4 has journal, as long as it hasn't been written to the SD, it's unsafe.

Many dev will NOT recommend loop, furthermore without sync.

It's up to you, if you want to trade safety for speed :)

I use loop + sync so I have an average mix of safety (considering that /data is unmounted safely by the system at shutdown) and speed (a bit of cache with loop)
[Desire Android Development] Zeljko1234:
But if you just remove battery or push phone to turn on with few % of battery... ;)
[Desire Android Development] hajen78:
I wont what is most safe and stable ;)

And that would be ext2 with sync right ?
[Desire Android Development] sibere:
Why would you do that? Like to play with fire? ;)

When batt is almost dead, is the phone just dying or turning itself OFF properly?
[Desire Android Development] sibere:
safer? Well, ext4 and sync and no loop. But I'm pretty sure that you'll get bad performances, probably worse that the NAND :D
[Desire Android Development] Zeljko1234:
I don't know why :) For example if you drop phone and battery just jump out...

Just to let everyone don't remove battery before shutdown!!!!

I think that depends of the battery level. Phone will shutdown properly if can. If someone try to turn it on again, then OS will not have enough time to boot and shutdown.
[Desire Android Development] hajen78:
Never mind ;)
[Desire Android Development] sibere:
Well that's probably the price to pay for the extra space and performance :)
[Desire Android Development] danarama:
I have had to battery pulls from time to time. Often its alright. Sometimes not, but restore from Clockworkmod (SD-EXT only) works fine. Then all fixed.
[Desire Android Development] dur09:
after

cd /

mount /dev/block/mmcblk0p2 /sd-ext

it says

mount: mounting /dev/block/mmcblk0p2 on /sd-ext failed: No such file or director

any help?
[Desire Android Development] ownhere:
in Recovery mode?

some Recovery forgot create '/sd-ext', You need to create it own
[Desire Android Development] dur09:
and could somebody tell me how can i do this?

FIXED: i've used amonra recovery
[Desire Android Development] sibere:
Just in case, to make a new dir like sd-ext type

mkdir /sd-ext

There is an example on how to make a dir in the OP too :)
[Desire Android Development] Droidzone:
Facing a lot of boot loops recently. I have both sync off and no swap. Could one of these be the issue. Using Stock rooted rom with init.d support
[Desire Android Development] Droidzone:
I understand the copying and chmod part.

Didnt get this "and root.shell UID".

Could you explain, Sibere?

I want to add init.d support to my own stock rooted rom. I'm guessing this is all that is needed to add d2sd support?
[Desire Android Development] Droidzone:
I'm trying to make a script which will remove the A2SD+ script of all ROMs to make it easier to get DATA2SD

Can anyone give me the names of the a2sd+ scripts of Roms that you have?

I know that Aurax uses /system/etc/init.d/03stuff2sd

Leedroid drives me crazy

The a2sd version has 859 files, while the non sd versio has 999 files.

I thought a single script only needed to be changed to make it compatible for Data2sd? What's with the remaining files?
[Desire Android Development] iinga:
The two that my scripts remove are:

40a2sd (defrost and i'm sure the one from leedroid)

10apps2sd
[Desire Android Development] bolek76:
hi linga i'm trying to run your script but i can't make it works.after set up rom and reboot in recovery again the script dont run.sorry for my english
[Desire Android Development] Droidzone:
Thanks.I'd noted that in your batch file, iinga, but wasn't sure which rom each one was for.do you know why leedroid a2sd rom is much bigger than the non a2sd version?
[Desire Android Development] iinga:
I'll have a look into it. The 40a2sd file is all that needs removing, because I know people that have used my batch to set up data2sd.

And btw, the 10apps2sd script is (or was) the Oxygen one. it might have been changed.
[Desire Android Development] Droidzone:
Thanks again. :)

I've noted that once DATA2SD is successfully setup on any ROM, it works perfectly, esp with sync on.

But it's erratic how it cannot be setup on some roms.

For Eg.. Neo's Aurax 7.9 A2SD+ minus the 30a2sd->Perfectly works

ReflexTsenseHD A2SD+ minus 30a2sd->Doesnt work at all (at least for me)

I couldnt get it to work on Leedroid Non A2SD version yet.

@Sibere

One more quick qn..

If I want to try out various Roms, with some being incompatible with others..The usual procedure one used to so was to wipe everything and flash the rom zip.

With DATA2SD created on one Rom, if I'm flashing another Rom, what do you suggest I do?

Can I wipe the whole Nand? I'm noted that I often need to reformat the ext and redo the whole proc if I do that.. Is there something simpler? What steps should I do in Clockwork?
[Desire Android Development] Droidzone:
@Sibere..

Any plans on creating a good custom Rom? .. :)

Suppose I were to cook a Rom with Builtin DATA2SD with dsixda's kitchen, I know how to include the files used by DATA2SD into the kitchen, But how would I run all the commands that we run from adb shell while setting up DATA2SD, so that it runs once before booting? In short, where should I put a script with these shell commands so that it runs once and sets up the ext file for DATA2SD?

@Iinga

Please consider adding this line to your batch script (It's for converting the Aurax A2SD+)

adb shell rm /system/etc/init.d/03stuff2sd

Also, I think adding more breaks (pause) commands, and echoing the activity of the batch file would be nice.

Would make it easier for us to debug if something goes wrong

Here's a mod of your batch file that I'm using. It's the same, except for some annotations.. and I put the three files in the same folder as the script
[Desire Android Development] Zeljko1234:
Is it too much to ask you about using multi quote and make your sig smaller?
[Desire Android Development] sibere:
Well I don't even have time to provide support for DATA2SD and to work a little bit on my kernel, so don't exepect any ROM from me :(

But you are free to use DATA2SD if you decide to kook one, as long as you link this thread and don't forget to mention me in you greetings ;)
[Desire Android Development] sibere:
chown root.shell filetochange

You have all the needed stuff in the OP.

Don't hesitate to read it again in details if you're not shure about something.

I've based my work on HTC sense 2.2 ROM. If your ROM behaves differently, I may not be able to help on some issues. For instance, some ROMs do not unmount /data on shutdown.
[Desire Android Development] sibere:
I never tried this procedure so I can only make a guess.

Reboot in recovery, wipe NAND as usual but not the ext2 file on 2nd partition.

Flash your rom, make sure before booting that a2sd+ is disable by deleting any script in init.d directory. Install data2sd one.

Boot on the new rom, let it stabilize. reboot if needed.

If this doesn't work.

Wipe, flash, reboot in recovery, mount 2nd partition to /sd-ext and mount loop ext2 to /sd (see howto in OP for this procedure), reformat it in ext2 (but you obviously loose any data or application installed). Delete any A2SD script in init.d. Unmount ext2 with a /system/xbin/busybox umount -d /sd (or wherever you've mounted the ext2 file on the loop device)

Boot now your phone and let it stabilise. Then restart in recovery, mount ext2 loop again and do the /data copy procedure to the ext2 file. unmount ext2 and install DATA2SD script. Reboot.

You will find all the needed commands to do this in OP.

good luck ;)
[Desire Android Development] iinga:
Just a quick question: Would:

system/xbin/busybox mount -o loop /sd-ext/ext4 /data

mean that you can flash a rom and it will flash to /data on the SD?

Oh and btw. If anyone is using an ext4 loopback, I made a reinstall zip for that http://www.iinga.net/desire/data2sd
[Desire Android Development] sibere:
Once ext2/3/4 is mounted on /data in recovery anything done to /data will go to SD as long as you don't leave recovery.

This should work indeed.

add a sync maybe to your loop mount ;) ( -o loop,sync)
[Desire Android Development] iinga:
Ok thanks :)
[Desire Android Development] Droidzone:
Thanks again, Sibere..Very helpful..

And..Just an update..

DATA2SD is working perfectly well with the just release Aurax 8.2.

In fact, flashing over the DATA2SD based Leedroid with all the user apps and data intact worked fine. On first reboot, there was a android.process.acore FC, but that was fixed by Rom Manager's Fix Permissions.

I had just a lot of bootloops and crashes with Neo's built in DATA2EXT. Converting to DATA2SD on Neo's A2SD+ fixed all that. Quadrant is only 1500, but that would be b/c of my Class 2 Sandisk and Sync on. But I see no perceptible delay in normal use. :)
[Desire Android Development] bolek76:
Hi mate can you help me again;My sd-ext is ext4 how can i make it ext2 without loose my data2sd;ext2 has better performance or its the same;thank you
[Desire Android Development] iinga:
You won't be able to do that easily. And i don't think ext2 has better performance. I get similar quadrant scores. But i gain the benefits of ext4.
[Desire Android Development] th3:
Benchmark the internal NAND properly... it "sucks" even more :P

Like 0.6MB/s 4KB writes. It's archaic. Nearly every R/W it carries out is heavily buffered to mask the high cell program latency.

DATA2SD is a nice experimental option for users. There's good and bad for every Dev option around.

------------------------------

- Sent via HTC Desire -
[Desire Android Development] bluelavender:
+1

i found , after few hundreds flashing, data2sd is still the nicest i've ever tried. It's stable with several roms and fast... when i mean fast, i mean no lag. i personally do not care much about quadrant. i care more about how does it perform . when i swype, i expect it to .. swype immediately. Of course normal app2sd+ works even faster, but data2sd is really nice intermediate option between performance and space :)

BL
[Desire Android Development] sibere:
Don't bother too much with Quadrant. It's not real life experience.

EXT4 is safer but adds more wear to the SD. That's all you have to keep in mind :)
[Desire Android Development] iinga:
Yeah i know, I just use quadrant to help me gauge roughly where I am speedwise.

EXT4 adds more wear, yes, but with SD cards being so cheap, I don't mind running on EXT4.
[Desire Android Development] bolek76:
Thanks guys,but I need a little help.I having activate the boost and I want to make nand+ext buckup is it safe;Because i've tryit 2h before and stuck at the boot screen
[Desire Android Development] Alex-V:
If i am right if i say...:

" I can not use data2sd if i would use a hd rom which install the system app´s to data (sd-ext)..?

If i use ext3 i get bootloop and if i use fat32 i get a error during the flash (because of data goes to sd-ext)

with kind regards...Alex
[Desire Android Development] bolek76:
I have to activate the boost every time my is reboot;Because i made a nand+ext buckup and i think it doesnt work any more.Thank you
[Desire Android Development] sibere:
Sorry I don't get your issue. Could you give more details in a fair good english pls? Thanks
[Desire Android Development] bolek76:
Sorry for my english man, every time my devise rebooting the trick in the first page (activate the boost) doesnt work.i must enter the comand again in terminal
[Desire Android Development] sibere:
That is normal. If you want it at boot, remove the "sync" option in the 01data script.
[Desire Android Development] bolek76:
Ok mate thank you.
[Desire Android Development] sibere:
Let me know If you can't get it working.

instead of /system/xbin/busybox mount -o loop,sync,noatime,nodiratime,nosuid,nodev /mnt/asec/ext/ext2 /data

you should get /system/xbin/busybox mount -o loop,noatime,nodiratime,nosuid,nodev /mnt/asec/ext/ext2 /data
[Desire Android Development] redecs:
From some reason this does not seem to work on my device (Rooted stock Froyo with a kernel from richardtrip - v5f). A checked everything... files, permisions. It seems ok.

When i try to run this

/system/xbin/busybox mount -o dirsync,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/asec/ext

as root on the phone i get "mount: /no/etc/mtab"

Any ideeas?

Thank you!
[Desire Android Development] melethron:
I didnt say anything against data2sd. I said something against FAT and i said something against a loop device. Fat ... is a over 30 years old filesystem and as some might have noticed there have been some improvements in computer development since DOS. And Loop messes with data integrity and apart from that messes up the partition alignement to the nand blocks of the sd.