yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Deathlike:
c:\Users\xxxxxxxx\adb shell

$ su

su

# busybox fuser -km /sdcard/sd/

busybox fuser -km /sdcard/sd/

# umount /sdcard/sd

umount /sdcard/sd

# busybox fuser -km /sdcard/

busybox fuser -km /sdcard/

# umount /sdcard/

umount /sdcard/

# /dbdata/oclf/parted-static /dev/block/mmcblk0

/dbdata/oclf/parted-static /dev/block/mmcblk0

GNU Parted 2.2

Using /dev/block/mmcblk0

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print

print

print

Model: MMC M8G4DD (sd/mmc)

Disk /dev/block/mmcblk0: 8221MB

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number Start End Size Type File system Flags

1 32.8kB 6208MB 6208MB primary fat32 lba

2 6208MB 8221MB 2013MB primary lba

(parted)

This is what I get and I still see 4.85gb in my internal SD, can you confirm what does your say?
[Galaxy S I9000 Android Development] RyanZA:
That's correct.

Now just run 'resize 1 32.8kB 6208MB' and then reboot your phone once it's done. :)

You can run 'check 1' as well, and it will tell you about the filesystem size mis-matching.
[Galaxy S I9000 Android Development] Deathlike:
Yeah, it worked! Thanks. :D

"Warning: Partition 1 is 6208, but the file system is 5208."

After that "Resize 1 32.8KB 6208" and the reboot I got 5.78 on my internal SD.
[Galaxy S I9000 Android Development] mat02:
I tried it on fresh JPH, with wipe/factory reset, internal sd format and still on every reboot my internal sd card is empty, so I think it's none of 1, 2 or 4th point.
[Galaxy S I9000 Android Development] RyanZA:
I'll make a new ver of the app that includes this in the uninstall operation. :) Plus, I'll adding checking for stuff like SD card not having enough free space, and script checks in the bootup to cancel out if any of the resizing or repartitioning fails. Plus the uninstall is currently missing the operation to copy your data back to RFS, so you end up with a device that has rolled back to when you installed the lagfix currently. ;)

Maybe a backup-restore option would be nice too, since the space is there.

Oh, and a slider for the size! :D

And more checking to find out what causes this data loss issue, of course.

This will hopefully all be done this time next week. Till then, feel free to keep testing the current version (or using the current version as your daily phone - it works really well if you manage to dodge all the bugs! My phone (maybe only mine?!) works perfectly with this fix! ;) )
[Galaxy S I9000 Android Development] RyanZA:
Great, thanks for testing! :)
[Galaxy S I9000 Android Development] bratfink:
Hold your horses!

I think if you have that another read RyanZa u might discover something interesting.

"with wipe/factory reset, internal sd format" Of course your internal sd is empty, you just flipping formatted it :P!
[Galaxy S I9000 Android Development] mat02:
I've formatted it after flashing JPH then I restored my data and after reboot that restored data was gone :P so internal sd wasn't empty before reboot ;)
[Galaxy S I9000 Android Development] tintagel:
Ryan,

Is your script resizing the partitions to the erase block boundaries?

This small detail is known to have a big impact on flash card's performance.
[Galaxy S I9000 Android Development] RyanZA:
It is using a straight 'parted resize' - so I'm not sure. I think parted does that automatically, but could be wrong. Could you give any links or info on how to ensure/accomplish that? :D
[Galaxy S I9000 Android Development] tintagel:
I'm not an expert either...

here's a link:

htxp://blog.aloisiojr.com/?p=28
[Galaxy S I9000 Android Development] Val3r10:
What about using the internal dd command - that is - to create a bitstream image of the whole device (/dev, I mean) or the unmounted fat32 partition ?

Just a forensic approach...

No, it doesn't. Only libparted2.2+ (kernels > 2.6.33) supports unstandard sector sizes, different from 512bytes

Btw, parted doesn't round by itself, as it could do to cyls (dunno the flash equivalence), megabytes or sectors. Or none.

As a matter of facts, performance issues could be affected by partition edge.

Not the data loss many people are experiencing, imo...
[Galaxy S I9000 Android Development] RyanZA:
Nice, thanks!

Here is my current partition table:

Number Start End Size Type File system Flags

1 32768B 5208000511B 5207967744B primary fat32 lba

3 5208276992B 6207569919B 999292928B primary ext2

2 6207569920B 8220835839B 2013265920B primary lba

So assuming EBS is 512KB, the beginning of my EXT2 partition is aligned (9934). If the EBS is 1MB it is also aligned. If it is 4MB it isn't aligned.

Does anybody know the EBS for the SSD? :)

The stock RFS on my 8gb is aligned at both 512, 1MB and 4MB by default, so that's good!
[Galaxy S I9000 Android Development] RyanZA:
It actually might have something to do with the data loss, now that you mention it! The stock FAT32 is sitting at XX MB to YY MB. I tell parted to resize it to XX MB to YY-1000MB. Now if the XXMB it originally is doesn't match to the XXMB that parted sets in bytes, then the entire FAT32 partition could now be offset by 1 or more bytes. Sounds like that might cause problems, although I'm not sure how.

Still, it's something to try. I'll change the scripts to specify everything in bytes, and ensure that the start bytes for the EXT2 are divisible by 4096*1024, for both performance and security reasons.

Thanks! :)

EDIT: Gotta say, I've learned a lot making these fixes! I knew almost nothing about android or linux kernels or anything like that before I started on this a couple weeks ago. Now I can sort of find my way around this stuff! :D
[Galaxy S I9000 Android Development] bratfink:
Data loss

I have just experienced different data loss to what everyone is reporting so i thought i would say what happened.

Fresh flash of JM8 on 16GB international model

I installed a few standard apps, astro, titanium backup, dropbox and just sent a few texts etc etc.

I then installed the lagfix and once done and rebooted i restored my apps from titanium. All was going well but my battery was draining quite quickly, so i thought id take the lagfix off...

When the phone booted back up it was at the point EXACTLY before i installed the lagfix, meaning all the apps i restored were gone, all the call logs and the texts recieved AFTER i installed the fix (texts from before were still there).

Hope this helps with the data loss issue, but knowing me iv prbably just made things much more complicated :P
[Galaxy S I9000 Android Development] Ibanez33:
My phone has acquired on strange quirk, not to say its connected...

If I turn it off and put it on charge it turns back on again??

Has any one else had the happen?
[Galaxy S I9000 Android Development] Ibanez33:
Correct me if I'm wrong but I think that's how it works as it leaves the rfs partition as is. So when you remove it will switch back and remove the ext 2 partition.
[Galaxy S I9000 Android Development] MAJED.y:
I updated my phone with JHJP4 and root it with busybox 1.17.1 then installed NativeEXT2.0.3.apk.

everything went good, the phone is fast but....

with every boot my internal-sd formatted!!

Quadrant score : 1641

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

edit:

next boot system stayed at "sweep glass" with black screen!.

will wait for new update.
[Galaxy S I9000 Android Development] RyanZA:
No, this is actually by design. I was testing out how it works if the EXT2 partition is just dropped and the old RFS is used again. Changing this is as simple as a 'cp -rp /data/* /dbdata/rfsdata/data/'. For anybody who wants to uninstall this fix and keep all their data, just run that in adb before using the uninstall option. :) Obviously a non-experimental version of this fix will do all this for you - but I'm still on the stage of getting this to work on everyones phones! :D

Thanks for the feedback. :)

I get the feeling the internal-sd formatted on each boot problem is probably the script breaking in some way, and would be why I can't seem to replicate it - since the script isn't breaking for me.

I'll hopefully get this sorted out when I get some free time. :)
[Galaxy S I9000 Android Development] toca79:
Any chance to see an apk or something like that?

I'm a complete noob so i don't even know where to start with this method.

Thanks for the hard work in any case.
[Galaxy S I9000 Android Development] RyanZA:
There is an APK already. Look back a page or 2. ;)

That said, it seems to be deleting all of the data on some peoples /sdcards. Might not want to use it yet! :)
[Galaxy S I9000 Android Development] ed10000:
Sorry for not updating my status for a while.

Had this running pretty weell on 16GB / JM8 without any kind of data loss. Then I decided to try out JPH. But I couldn't get into recovery with the 3 button combo anymore (I could still get into Download Mode, but not recovery. Rebooted after the Galaxy S screen every time. Weird). I did uninstall the fix from within the app first.

Anothe issue I faced which I think you're already aware of by now - Even after performing the uninstall operating and then flashing a new firmware (JPH, JM8, JM7), the internal sd space still showed a gig less. Fixed this by flashing again with re-partition checked (512 PIT).

Hope to see this turn out into a completely stable and option filled (for filesystems?) solution some day :). Donated a bit to your Paypal.
[Galaxy S I9000 Android Development] Cy4n1d3:
Was to no success to me :\

Kept eating my sd-cards files. 8 gb phone.

€dit: some more information:

-quadrant before 997, after 1640

-running jph with cl's modified root-kernel
[Galaxy S I9000 Android Development] imagoX86:
same here, on every boot all my data from sd card is being removed, 8gb i9000, lag fix version 2.0.5
[Galaxy S I9000 Android Development] thaysean:
SGS i9000 8gb

Running JPH, CF- Root v.1.1, Native EXT2 v. 2.0.5

Super Fast!! Super Smooth!!

Quadrant 1547

Linpack 13.57

Problems:

1) Wiped internal data on install

2) Wipes internal data on every boot
[Galaxy S I9000 Android Development] alerems:
Is this project still alive? Very good lagfix, but with "funny" problem - wiping internal sd. :(
[Galaxy S I9000 Android Development] r27p:
Also interested to know if further progress is being made with this as it looks very promising.
[Galaxy S I9000 Android Development] hardcore:
@RyanZA: Since the problems seem to be caused by trying to trick the kernel into reading a modified MBR/partition table every reboot, why not release a modified version of this that uses the External SD card instead (that way, no need to trick the kernel into re-reading the Internal SD MBR and thus avoiding the data loss scenario).

This way this fix is actually very similar to Apps2SD or mimocan's lagfix, but the difference is that you are able to make it a 1-click app.

P.S. Some feedback since I was running a similar fix but with External SD:

On every reboot I try to do an fsck on the ext2 parition, and on every boot it reports that the partition is dirty - which means that the ext2 partition is not being cleanly unmounted on reboot/shutdown. Not sure if this is fixable or not, but I think an fsck on boot is definitely required, otherwise we'll start to have ever-growing filesystem corruption on the ext2 partition. Maybe we can do a similar hack on the shutdown animation to run some sort of shutdown script.
[Galaxy S I9000 Android Development] RyanZA:
Progress is still being made - I just had some nasty flu so wasn't able to work on it recently. I'll fix up the bugs (hopefully, there are no theoretical bugs, just practical ones) when I get some time!

External SD has a lot of problems... a lot of the SDs on the market are really bad quality and will just slow your phone down. Also, the external SD can't go into sleep mode if /data is on it, which (may?) eat up battery. Plus if you pulled out the external SD, the phone would crash.

Can't see any reason not to make it an option when I get the time though.

As far as the shutdown script... I don't think it's that easy. If anybody knows more..?
[Galaxy S I9000 Android Development] moonstruxx:
Hi RyanZA! i want to try to make a new initrd to support this fix in jpk. Have you already tried this? I want to alter the boot order... or do you think thats the wrong way?

Cheers
[Galaxy S I9000 Android Development] kanemari:
@RyanZA

mate, love your work.

i need your help though :) ive run into some problems with this mod and my phone locks up after about 30 seconds of booting to the lock screen.

is there any way that i can undo the lagfix through a script in adb shell? i can access all the files on the nand because adb shell still responds, but the phone UI freezes. ive tried to wipe it in recovery mode but it doesnt wipe the right /data or /apps partition since it doesnt use the modified partition when it boots into recovery. so im stuck not being able to wipe it and i dont want to reflash just yet in case i lose my internal sd.

any suggestions as to how i revert my partition info? i dont care if i lose /data i just want my internal sd contents and the original partitions back in place.

and yes i did back it up... its just around 8-10gb and i really cant be bothered restoring it unless i REALLY have to.

thanks.
[Galaxy S I9000 Android Development] RyanZA:
It _should_ already work on JPK, but ... yeah.

I should actually get back to fixing this up! :D

Your partition info should be reverted as soon as the device boots up. As for undoing the lagfix, it's really easy. Just go into recovery, and use adb shell

and then 'rm /dbdata/lagfix_installed'

It should remove the lagfix on next boot up, and then reboot and be working again. :)

I'd like to know why it isn't working though, and if possible could you 'cat /dbdata/log' before you remove it so I could see what's causing the issue? Thanks! :D

I'm gonna try work on this more when I get some free time. :)
[Galaxy S I9000 Android Development] kanemari:
thanks for this. phone is now reset and partitions restored. all my data still on internalsd so happy about that.

i should note in all fairness that it was my fault this happened. I read about fscking the partitions to get rid of errors and did this from recovery, but i copied and pasted a command and forgot to replace fsck_msdos with e2fsck and i think this scanned and force fixed the ext2 partition with a fat scanner. after this it started lagging and eventually died. it was working perfectly until this.

im just going to run clockwork and reinstall the lagfix. ive attached the logfile but it doesnt show any errors, and so it shouldnt since it wasnt your script that caused this.
[Galaxy S I9000 Android Development] clubtech:
So is this compatible with JPK?

The first post states that it is not compatible to the latest froyo builds however a few posts above mine Ryan is saying it should be working on JPK?

A little confused :)
[Galaxy S I9000 Android Development] kanemari:
ok so for completeness' sake i decided to try and replicate this.

i find that if i run fsck on the rfs partitions while the native ext2 is active, on the next boot it locks up. i dont touch the ext2 partitions but it seems to have this effect. the screen is blank with only the glass lock screen showing. tried leaving it for a few mins just in case it was something running in the background but it ends up locking up completely after a while.

reboot into recovery, remove the lagfix_installed file, and it reboots into its last known state ok.

tried reenabling the lagfix again straight away with no further fscks and it did it again. ended up having to remove the lagfix, restore a backup, then apply the lagfix again to get it working.

strange stuff. im using the oc120 kernel with voodoo support (voodoo being disabled of course).
[Galaxy S I9000 Android Development] RyanZA:
So it basically sounds like the kernel is not properly re-reading the partition table, yeah? Or it could be something else entirely... useful information though, thanks! :)

I think somehow the boundaries aren't being kept properly.. but it seems strange, because if you look at it once booted into linux, everything looks okay. At least on my phone... which might be the issue.

If possible and you have time, could you try this out again, but this time inspect the partition table before doing the disk check, and see if the boundaries are correct? (mmcblkp1 not overlapping mmcblkp3 or anything like that) - Thanks! :)
[Galaxy S I9000 Android Development] kanemari:
it ended up going strange on me. i couldnt get the lagfix to work at all even after reinstalling it fresh after a while. it would just lock up constantly. then it started force closing with the lag fix off so i reflashed JM8 and got an error about the cache partition /dev/block/stl11 not being able to mount. tried to fsck it and that wouldnt work either so i figured that some partition info had been messed up.

reflashed with repartitioning on back to my stock kernel which i knew had a cache.rfs in it and that fixed everything. then back to JM8, root, oc120 kernel... and after all that reinstalled the lagfix fresh with no apps on the phone.

im getting really interesting behaviour now. its very reliable and reproduceable as well. every second reboot the phone works fine, and every other reboot the phone plays the samsung logo sound but the screen stays blank, and keeps staying blank. responds to adb though and doesnt lag in shell, and reboots to a functional phone the next time around.

is there any e2fsck on boot that could be preventing the screen from going on? i thought the samsung logo video was on a non-ext2 partition though so it wouldnt explain it going blank that early. is there any way i can tell what is going on?
[Galaxy S I9000 Android Development] RyanZA:
You can check out the logs it makes in /dbdata/log and /dbdata/logs/*
[Galaxy S I9000 Android Development] kanemari:
could it be related to this?

http://xdaforums.com/show...2&postcount=16

your script overwrites the MBR With the saved MBR file that is generated when the script is first run, so is it possible that when the stock init overwrites the partition and doesnt find rfs it writes something and it messes up the partition?

like i mentioned, when i reboot into recovery all the partitions show up as rfs so perhaps rebooting into recovery is what is causing the problem?
[Galaxy S I9000 Android Development] GantengX:
Hang

Hi RyanZA,

I've applied this patch (stock kernel, DXJG4 firmware) and my phone occasionally freezes (sometimes I can't unlock the screen, it's really stuck until I have to restart my phone), otherwise performance was great though :D

So in the end I reverted back to OCLF 2 :(
[Galaxy S I9000 Android Development] Ticiano:
Guys, I think I made something very stupid here and killed my phone using this app.

I was just trying to undo the changes it makes in the phone so I could try to install Doc's ROM after that.

I don't know exactly, but I think I runned the "Undo somethingthatidontrememberTEST" option... so the phone restarted and now I just get that white Samsung logo in loop...

could I fix it or my phone is really dead?

Thank you very much for any help. I sorry if this kind of post must be made in another sub forum, but I'm just desparate.

I can enter the recovery mode... 3E Recovery... and I cant enter Download Mode. But I dont know if I could solve this problem just flashing a ROM as this process evolves chances in particions...
[Galaxy S I9000 Android Development] Ticiano:
Ok Ok I just stoped crying and used Odin to get back to the original Eclair ROM. The only thing strange now it that I just can't install nothing from the market. This problem has anything to do with the EXT2 or something else is causing it?

Anyway... Is nice to get my i9000 live again. I'd really apreciate if you guys help me to solve this market problem. I can make the downloads from the Market but after the download it will never install the apps.

Where can I see a guide to completely revert any changes that this Native EXT2 tool made in my phone?

Thank you guys. I'll be more carefull next time.
[Galaxy S I9000 Android Development] RyanZA:
Don't use this - too flakey. Use z4mod.
[Galaxy S I9000 Android Development] Ticiano:
Thank you RyanZA!

I'm back to JPO Froyo and now the Market is working again.

Just a little thing: that option "Undo Testwrapping" or something like this eleminated and changes this Native EXT2 solution made in my system?

I'm just worried about some changes reamaining in the partitions. I'm not so familiar with this details.

Thank you very much!
[Galaxy S I9000 Android Development] Ticiano:
I think everything is fine now. I'm using Z4Mod and now I have Froyo working smoothly here!

Thank you very much!
[Galaxy S I9000 Android Development] sio4:
i wonder status of this great work!

Dear RyanZA,

what's going on? do you means did you stopped working on it?

I think, this is the best method of lagfix for Galaxy-S.

(especially for ordinary users.)

anyway, can i find it's repository (or branch) on the web?
[Galaxy S I9000 Android Development] ed10000:
Awesome! :) I seem to be getting a terrible battery life on Voodoo, so I'll give this one a shot. Heading to college now, will try it out in the evening. Thanks Ryan! :)
[Galaxy S I9000 Android Development] JaGuR:
If this means not having to alter the kernel, this can only be good :)
[Galaxy S I9000 Android Development] OrionTC:
very nice work, what are the differences between EXT2 and EXT4 in real world performance terms?
[Galaxy S I9000 Android Development] lijgame:
Cool!

Cool!

Thank you, RyanZA!
[Galaxy S I9000 Android Development] phoenixdigital:
And more importantly what happens if the phone unexpectedly reboots due to crash or careless removal of battery?

Is one filesystem more robust than the other?

For those of us without 3 button recovery having a phone that will not boot means we cannot use adb to reflash and we and up with a brick.

Can someone shed light as to which lagfix is safer for us with 'neutered' phones?
[Galaxy S I9000 Android Development] hardcore:
Thanks RyanZA! Knew we could count on you. I'm gonna try it out on mine (16GB version running JPC).

Questions though:

- Is the data in Internal SD preserved? I guess so?

- How do we revert / uninstall the fix?
[Galaxy S I9000 Android Development] g00ndu:
bro hardcore, i know you will appear sooner or later. :D Can you help to upload the 16gb mbr file after you have done so? it is gonna help many people here. :D
[Galaxy S I9000 Android Development] anilkuj:
i tried creating the mbr for 16GB several times

while doing resize and mkpart

even though it completed the changes it said i had to reboot for the changes to be reflected , but even after reboot the changes are not there.
[Galaxy S I9000 Android Development] RyanZA:
Yep, it's a bit tricky. :D

If you check inside the test.sh / userinit.sh, you will see how it handles the MBR stuff.

Anyway, even though it says that you need a reboot for changes to be reflected, the actual MBR will be written to disk. So you can pull it out using dd, even if it says that it isn't reflected yet.

Then the boot script will handle the rest. :)

As far as data safety goes, I'm not sure yet. Data loss can occur no matter what filesystem you are using though. Lots of people have been running EXT2 for a long time so far, without issue, so it probably isn't much of a practical concern, given the speed of the flash memory, and the flash memory likely having it's own capacitors.

EXT4 is possible by loading the correct kernel modules at boot time, but I haven't tried this yet.
[Galaxy S I9000 Android Development] hardcore:
Yup I understand how you're doing it. Will upload my 16G MBR file after I try it.

I also have some ideas how to auto-kill the GPS process and perhaps also do a while loop to detect if the block device /dev/block/mmcblk0p3 is created yet, so you don't have to do a "sleep 20".

Indeed you're right, it should be possible to load ext4 support through a module, but that's for the next step I guess!

First, to try the current steps. :)
[Galaxy S I9000 Android Development] anilkuj:
the problem is i get that message when i run resize command , and if i ignore that message and try to do mkpart , it says cant create overlapping partitions

i tried that even after reboot still the same issue.