yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] moebius83:
yes and no, the init.rc inside the boot.img is modified to stop the init process until the cm.filesystem.ready property is set to 1:

start sysinit

on property:cm.filesystem.ready=1
class_start default

where the sysinit service is the service in charge of starting all the scripts inside /etc/init.d:

# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot

and the last of this script, 99completed, only sets that property to 1 so the normal system boot can continue:

#!/system/bin/sh

sync;
setprop cm.filesystem.ready 1;

of course changing init.rc is only possible by flashing a new boot.img with init.rc modified inside the ramdisk as you said
[Desire Android Development] moebius83:
here's the View attachment init.rc.txt extracted from this init.d enabled stock htc rom: http://xdaforums.com/showthread.php?t=773997
[Desire Android Development] melethron:
Force check doesn't matter. Heres my log (mount count is always one 1 before e2fsck ... take a look at the script to see why).

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

782 inodes used (0.84%)
96 non-contiguous files (12.3%)
3 non-contiguous directories (0.4%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 764/4
38898 blocks used (10.42%)
0 bad blocks
1 large file

359 regular files
410 directories
0 character device files
0 block device files
0 fifos
0 links
4 symbolic links (4 fast symbolic links)
0 sockets
--------
773 files

I think its more because of this:

Pass 3A: Optimizing directories

I have no idea what this does .... but (EDIT: as sibere already said ;) ) its not an error. By the way the " FILESYSTEM HAS ...." message also appers on stuff like creation of the "lost+found" dir....

Man e2fsck about this:

Afaik this only applies to ext2 and 3 but im not sure about this.

Also note that included e2fsck binary is the "complete" binary and not the stripped down one that is included in the stock. (its e2fsck_rcvy i think).

... No i didnt miss that .... what i meant when i wrote "init.d support enabled" is ..... "init.d support enabled" ;) ..... But i can change that to "proper init.d support enabled through ramdisk"
[Desire Android Development] moebius83:
Oh well, my next job is trying to mount the ext partition directly at init.rc and see what happens, the only possible issue I've found so far is that it may be tricky to setup the loopback device on the init.rc script since it uses a different language
[Desire Android Development] sibere:
I don't need to , b/c I'm the one who explained first why mount count was always reporting 1 ;)

Never said that it was an error. I said that even with this, his FS was clean.

I have this 3A stage on my log even after booting a clean FS.

Never said that YOU missed something but I missed something. Pay attention when you read posts ;)
[Desire Android Development] melethron:
Ill add this with some modifications (make 1 log for alignement+e2fsck) in the next version. The log shouldnt be that large so a continued log is not a real issue. The reason i overwrote it is that i had a "tasker" script which read the file and give a notification if there was "filesystem modified" in the log. But i can change my tasker script to erase the log after the notification is closed.

About the reboot. I dont see a point in this. If e2fsck finds error it will fix it anyway (-y option). So why reboot?

Well, but what is the profit of this other than it enables you to move /data/property /data/system and /data/misc to sd-ext. Those folders are under 1 mb large and thus the internal /data has 146 mb of unused space anyway ....
[Desire Android Development] chris2busy:
Any known issues on v 0.3 ?

I was thinking of flashing tonight again my rom and thought i'd try data2whatever..if v0.3 goes final after a bit and have the test version on, can i upgrade it or do i have to flash a new wipe from new?
[Desire Android Development] melethron:
1.)... Oh i meant mount count 2 because my script mounts one time before it checks (for the filesystem check) so its one mount from the shutdown before and one from the filesystem check.

2.) I didn't mean you when i said it isn't an error. I saw that you wrote that it is "clean" (or at least has no errors). I edited the post to make that more clear.

3.) LOL, again you teach me to proper reading .... ;)
[Desire Android Development] melethron:
No known issues so far. But if all wait and none tests it can't confirm that. ;)

You need to wipe for v0.3 because it will change your sd-ext partition (at least as long your partition wasn't aligned before).
[Desire Android Development] chris2busy:
would love to help :) but i am not savvy enough to be of any help im afraid.. the test version would align my ext anyway so it'd be safe to just flash without wipe the stable 0.3 when it ships out?

edit : also, would data2whatever increase the phone speads as the data2ext script does?
[Desire Android Development] moebius83:
Well I don't know, I thought there should be some kind of reason why e2fsck distinguishes between exit code 1 (errors corrected successfully) and exit code 2 (error corrected successfully but reboot required) but now reading some documents (https://bugs.launchpad.net/ubuntu/+source/e2fsprogs/+bug/83982) it seems the reboot is required only if e2fsck fixes an already mounted root partition, which is not our case.

In this case the if clause can be modified if everything's ok (exit code 0), errors detected but fixed (0<exit code<4) and others major errors (exit code>4).

Actually I don't really know, just messing around and curiosity, cleanliness? :)
[Desire Android Development] om8g:
what could be the problem, if I can't see my fat32 partition ?

I'm using oxygen RC3
[Desire Android Development] iinga:
Need a bit more info than that you can't see your fat32.

Where can't you see it? When did you stop being able to see it? Etc
[Desire Android Development] om8g:
sorry for the lack of information

To start with, I used oxygen RC3, without the script, and programs like the music app etc. saw the files on the fat32 partition. But now after applying the script, there is no program which can see the fat partition. I can only delete my sdcard in the settings menu, not mount.
[Desire Android Development] woti23:
you could connect usb cable and do a

adb shell fdisk -l /dev/block/mmcblk0

(-l = small L)

to see the partitions and check if fat32 is there
[Desire Android Development] sibere:
Well It shows to all of us that how some words (or the lack of) can easy lead to misinterpretation ;)
[Desire Android Development] Terepin:
But there isn't an easy way to get this working on stock ROM, eh?

(And I take asking if this works on HD ROMs is out of question...).
[Desire Android Development] Gaspedal:
today I have installed over my working system (LeeDroid + v0.2) v0.3 but after reboot, I could only see the htc logo. Even after 30 minutes is nothing happens. I have removed the battery and now my sdcard is damaged. No ext partition and I can see 4 undefined partitions in Actronis Disc Director. Before I had only EXT3,Swap and Fat32

Now I have created new ext3 with Fat32 and I'm back to v0.2

What's wrong ?
[Desire Android Development] woti23:
only for the records:

tested /data/data on JFS (journaling file system): better in DB writes but else no overall improvements over ext4. and i have no jfs_fsck jfs_mkfs jfs_tune for arm arch available, so no partitioncheck at boot time.
[Desire Android Development] melethron:
There will be no stable v0.3. i already finished v0.4 and update the OP in a min. Another change which will require wipe also.

Although v0.3 and v0.4 are test clients this is overall relative untested. I declare it stable if it is v1.0.

Flashing over it wouldn't work. As i said it will erase the ext partition. This means it wipes all of data without reinstalling it.....i thought that is clear enough ....

Also i need a logcat to tell you whats gone wrong :( .... hope you backed up all the data.

EDIT: by the way. I made all my test with leedroid 2.3b. I flashed v0.3 four times with unaligned partitions and it worked every time (i also have a swap partition). Also v0.4 worked 2 times now. But note that i did a full wipe everytime. As i said flashing over if you have an unaligned partition CAN'T work. But i'm still not sure how not wiping can affect the partition table. If you want to test again (v0.4) then make "adb logcat" while you boot. If it can cause errors on the partition table then i really need to find the issue ...
[Desire Android Development] Gaspedal:
Yes, I have all the data previously backed up :)

I will test it again with v0.4

Thanks for your great work !!! :)
[Desire Android Development] melethron:
Just reuploaded the v0.4. I had a minor typo in the code. Not enough for new release number.
[Desire Android Development] sibere:
Very good job here.

Why did you change I/O sched from noop which was supposed to be the best choice for SDcard to deadline?

Is deadline the final best choice ever or CFQ will become the new best of the best choice ever? ;)

A bit of irony there but IMHO even though noop is very good for benchmarks, I still have the feeling that CFQ brings more smoothness to my phone (in conjunction with cgroups CPU scheduler)
[Desire Android Development] hajen78:
I cant make this work on Defrost, when i boot up it just says "process system not responding" Someone got a sulution ?
[Desire Android Development] silvake:
Ok, I agree, but the problem only appeared after I flashed the 0.4 script, not before.

And just to be sure, I performed another test:

I restored the A2SD version from the nandroid backup (made before flashing 0.3 script) and then flashed 0.4 directly.

Unfortunately, same result: boot-looping with the above errors.
[Desire Android Development] SkyWalker1726:
Thanks a lot , saved me from flashing something that i didn't need , thought that i t would make my phone go way faster due to the Quadrant score

thanks again
[Desire Android Development] melethron:
Im also not happy the way it is now. If this could be done then a filesystem without journal would be safe enough to use. Also coutts99 is trying to implement btrfs support in his kernel wich may also better (i never tested it) and someone had the idea of using compressed file system so there still might be many improvements.

Btw: if you look at my script and compare it to the original app2sd script you'll see the there is no need to appreciate my work. I only quoted 7 lines, added 3 times the word "data" and removed it one time and thats it. I actually wonder why no one else thought about that :D .
[Desire Android Development] ghiki:
This work without bugs??
[Desire Android Development] melethron:
There are some lags if you have a slow sd card. But this is the case in every data2ext script. Also you should use ext3 or 4. But considering the force close issues that some ppl have on RCMixHD. This wont happen here. It is as safe as it can be considering file system corruption.

edit: reading the first most might help you to decide if you should use it ... by the way ....
[Desire Android Development] Dimitris19:
A class4 card is good or i need a faster one? Thanks
[Desire Android Development] ghiki:
Curently i'm using this: http://xdaforums.com/showthread.php?t=859419, it has more "divided/organized" paths, theroically to improve performance. You can make a flashable zip of this? xD
[Desire Android Development] dazzlet:
can i flash this to the rxmix hd 0.14b rom that has data2sd in the rom natively?

if so do i just flash this on top of my existing install with any wipes?
[Desire Android Development] melethron:
I testes this myself A LOT. And i think it isn't good. Read the OP! I wont rewrite ownhere's script anymore and i could only make a zip if i would ^^.
[Desire Android Development] Alex-V:
actual i test your ext2 script of data 2ext...think its very good...stable and overall speed is very good (mean zero hang of system)

http://xdaforums.com/showpost.php?p=9642504&postcount=6768

Thanks for this...will at it 2 my hd rom ;) :)

for the test i have rename and copy over the old and reboot

with kind regards...Alex
[Desire Android Development] melethron:
Quoting myself from (OP):

-RCMixHD 0.14b ("OLD FASION" only!)

To make install more clear i added these now:

"ONLY WORKS ON A FRESH INSTALL WITH FULL WIPE"

There is also a patch by me linkend in RCMixHD under "extra" wich will decrease the chance of file corruption. RCMixHD uses an older script.
[Desire Android Development] melethron:
I don't recommend to use this. Ext 2 is faster but Android has a Problem: It doesnt unmount the ext partition. This makes file corruption more likely. It is better to use this script. I made several tests with ext 2 and it was as fast as without data2ext but after 20 reboots in a row i got force closes. People that want speed (and want to risk it) can use ext 2 then. This script is if used with ext 2 is as the data2ext2 script. But people that want safety should use ext3 / 4.

Until this is solved people should use ext 3 or 4.

Also cyanogen recommends ext 3 or 4.

PS: Wenn fragen hast kannst mir auch eine PM schicken. ;) Wenn du unbedingt ext 2 verwenden willst kann ich dir ein neues schreiben dass auf dieser version basiert (sind nur 2 zeilen mehr).
[Desire Android Development] Alex-V:
Ok...thanks for answer...i understand...more over pm.... :)

with kind regards...Alex
[Desire Android Development] peterfeter:
Same here... can help me?
[Desire Android Development] melethron:
Sorry, i missed this post. Just saw it after it was quoted ...

I'm still on 0.4c and I didn't check RC2. I look into this later.
[Desire Android Development] vivmar:
hi melethron,a fast question:

Is you script updated at v3 version of ownhere work or is your personal work?

thx
[Desire Android Development] peterfeter:
same issuse with RC1 :-(
[Desire Android Development] melethron:
It's a simple modification of cyanogens app2sd script. Ownhere's v3 is a really nice solution for speed and safety, for now. I think I remove my zip and only provide the script for devs as a quick approach while better scripts are made and play around with his script.
[Desire Android Development] melethron:
Try to flash the Rom without my script and see if it works. If it does

then provide me with more info pls.

Are you sure you have a second partition on your sd-card? If yes what size?

Did you change the partition of nand?

Can you make an adb logcat of the boot.

Adb shell df would also help.
[Desire Android Development] peterfeter:
Yes im sure 2nd part. Without Script works this rom good.

currently @work no adb here ;/
[Desire Android Development] melethron:
I'll make a completly new script. There is quite some good news.

1. If ext mounted directly to /data it gets unmounted nice. So there is no need for a third journaled partition as ownhere's currently approuch. Sibere sorted this out.

2. The lags that happened on both version from sibere and ownhere are caused by the way there is data written to an loopdevice. This one is sorted out by ownhere.

==> Putting these together means that an ext 4 partion without journal directly mounted to data will be the best solution considering speed. Also since it is unmounted right removing the journal is quite safe.

Data2ext without lag is coming soon.

So wait for a new script.

EDIT: I really wondern why this is the case for you so i flashed the ROM and it's working for me. The script is doing what it is intended to do. Without some "logcat" and "df" i can't help you atm.
[Desire Android Development] Orka82:
Leedroid v2.3b

Wiped all.

Flashed Leedroid again.

Flashed data2whatever 0.4.

Restored with TitaniumBackup.

ext4 / 1.5GB

Works as it should! :)
[Desire Android Development] hajen78:
I made a ext4 on 1,5gb and i have tryed to use v0.2e and v0.3 and i have tryed them both3 times and have wiped everything first.

PPs data2sd works fine ;)
[Desire Android Development] radiohitec:
0.4 don't works with a backup from nandroid with Lee 3.2, I read @ 0.4 dalvik cache is now left at internal, that's not the same as with the Lee 3.2b this is set to external and give's problem when you flash the 0.4, that's why version 0.3 works, there is set the dalvik cache to external!
[Desire Android Development] silvake:
As far as I could see, when flashing Data2whatever, any a2sd script included in the ROM will be replaced with the new scripts from here, so I think your observation regarding the scripts included in LeeDroid rom doesn't make any sense here.

Besides, I also tried wiping cache/dalvik-cache and either way, it should be recreated at boot time, don't you think?
[Desire Android Development] woti23:
no, at one time dalvik-cache is a symlink

from /data/dalvik-cache

to

/system/sd/dalvik-cache (extern sdcard)

or to

/system/data_internal/dalvik-cache (data nand)

if the content of the directory is wiped, as recovery sees where the dir of dalvik-cache is,

it gets just deleted,

but if the symlink goes to a non-existent directory you get those error messages
[Desire Android Development] Orka82:
So dalvik -> Internal now with 0.4?

/dev/block/mtdblock5 147.6M 129.7M 18.0M 88% /system/data_internal

18M free. Is that ok?

I used one Sense HD-rom with Data2ext and the space for dalvik-cache ran out...
[Desire Android Development] woti23:
no that won't be enough, but then there should be more space free in /system/data_internal because almost everything but property, system, misc and dalvik-cache should be already moved with data2whatever away from /dev/block/mtdblock5

look into /system/data_internal for directories, there should only be 4

(misc, dalvik-cache, system,properties)

this is the code where it happens

in short: it says when there is no symlink for system,dalvik-cache, misc .. in /data (which is extern)

remove the directory in /data with the same name and create a symlink to

/system/data_internal (nand)

for i in property misc system dalvik-cache;

do

if [ ! -h /data/$i ];

then

echo " +++ Creating symlink for $i"

busybox rm -rf /data/$i;

busybox ln -s /system/data_internal/$i /data/$i;

fi;

done;

i hope i read that right, melethron?
[Desire Android Development] Orka82:
Yes.

I have misc, dalvik-cache, system and properties.
[Desire Android Development] Gaspedal:
tested the v0.4

Now LeeDroid (2.3b) is very very slow. With 0.2e was LeeDroid faster. I'm again back to 0.2e

Can someone confirm this too ?
[Desire Android Development] Orka82:
0.4 gives me higher score in quadrant compared to 0.2e with latest leedroid.

Need a fix for the free internal space. Soon i will run out of space for dalvik-cache.. (i think?).
[Desire Android Development] melethron:
Deadline is for compatibility with more sd-cards. The difference between deadline and noop is only small. Noop just lets every i/o request through. Deadline does the same but sets a (timed) "deadline" for io request in the queue. The reason i changed to deadline is that in certain situation the i/o requests could be "to much" for the controller and thus a request gets lost. This is also what IEF from alpharev and Unhelpful from voodoolagfix recommended to use. The reason this wasnt in the script is that not every kernel supports it. The script now checks if deadline is available and sets it then if it is. If not it still sets noop.

About group scheduler. Grouping tty is senseless if there arent any ttys. And even if it would work ... i dont do "make -j64" on the phone .... i dont do "make" at all on the phone ^^ ....http://ck-hack.blogspot.com/2010/11/create-task-groups-by-tty-comment.html

yes,... not only recovery wipe dalvik-cache is meaning less but also the script doesnt delete any present symlinks and only directories.

# data/dalvik-cache to internal if on sd
if [ ! -d /system/data_internal/dalvik-cache ];
then
busybox mkdir /system/data_internal/dalvik-cache;
fi;
busybox chown 0.0 /system/data_internal/dalvik-cache;
busybox chmod 771 /system/data_internal/dalvik-cache;

if [ -d /data/dalvik-cache ] && [ ! -h /data/dalvik-cache ];
then
echo " +++ /data/dalvik-cache found on sd -> Moving to internal";
busybox cp -a /data/dalvik-cache/* /system/data_internal/dalvik-cache/;
busybox rm -rf /data/dalvik-cache/*;
fi;

And also only symlinks when there is no symlink yet

for i in property misc system dalvik-cache;
do
if [ ! -h /data/$i ];
then
echo " +++ Creating symlink for $i"
busybox rm -rf /data/$i;
busybox ln -s /system/data_internal/$i /data/$i;
fi;
done;

So the issue from a previous run app2sd script/or v0.3 that linked /data/dalvik-cache to a non existend dir.

Shortest way to fix it recovery -> "adb shell mount /data" "adb shell rm -rf /data/dalvik-cache".

I didnt care about upgrade compatibilty yet. But ill add stuff like this later. On first boot of the script ill erase any symlinks that could interfere with present symlinks.

As long there is space free it is ok ... but i think it causes problems for more than ~300 mb of apps. I never had issues with a full dalvik on internal and only with full space from /data/data.

Ill change this in the next release so that "data@app" dex files will be on external and "system@ ..." will be on internal and symlinked to data.
[Desire Android Development] Gaspedal:
Ahhh I see. After flashing with 0.4, my EXT Partition is damaged again. (Full Wipe, reflashed rom)
[Desire Android Development] melethron:
"adb logcat" or the log from /sdcard/data2whatever.txt would help me to find the issue. I cant reproduce that .... :(
[Desire Android Development] bootwala:
anyone tell me if this steps will work completely withot any problems on nexus one?
[Desire Android Development] najar360:
can this use with ginger rom?
[Desire Android Development] iinga:
2nd OP says Oxygen Gingerbread and Ginger Villain work
[Desire Android Development] chris2busy:
Hey guys..i tried 0.4 and 0.3 last night and phone was massively slow..i cannot make anything out of the log, so here it is, maybe someone has some advice for me.
[Desire Android Development] woti23:
if you formated or recreated partitions between those two logs, then this shows nothing but the creation of lost+found, which is quite normal.

nothing to see here.
[Desire Android Development] moebius83:
it's not that hard to reflash a new boot.img with init.d support, if you have a stock htc rom you can extract the boot.img from here: http://xdaforums.com/showthread.php?t=773997

I can give you some help if you need.
[Desire Android Development] chris2busy:
well i flashed rom (wiped before flashing) then flashed data2whatever and booted..saw the lag, then tried the 0.3 instead (doing a wipe too) and got lag again..so pretty much i didnt do anything besides wiping the ext partition which the script redoes anyway..
[Desire Android Development] sibere:
A bit off topic:

Ha hem a bit of confusion there, sorry about that.

I'm not talking about the new patch with Auto group scheduler (called Automatic process group scheduling in the kernel menuconfig), but the cgroups scheduler (called Group CPU scheduler).

I don't know why kernel builders don't use it for HTC phones even though HTC is building the all cgroups file system on boot to use this feature. I'm not talking about ttys and stuff. Cgroups doesn't require ttys but a filesystem.

Did you ever wonder why there is this bit of code in init.rc?

# Create cgroup mount point for cpu accounting
mkdir /acct
mount cgroup none /acct cpuacct
mkdir /acct/uid

It's simply because HTC designed the all thing with cgroups scheduler in mind, not CFS or BFS.

I've built 3 kernels, one with CFS, one with BFS and the last one with Cgroups, and the smoothest was Cgroups!
[Desire Android Development] Alex-V:
maybe you can share the Cgroups kernel for a test..?

thanks..with kind regards..Alex
[Desire Android Development] theodm:
Exact same problem for me. Gets no further than the busybox terminated with 0.4 on Oxygen RC4.
[Desire Android Development] K900:
Same here.

Sent from a piece of ginger bread