[UTIL][OUTDATED] One Click Lag Fix 2.0

Status
Not open for further replies.
Search This thread

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
[size=+2]This version is now deprecated in favor of the 2.0 APK version. Please see this link: http://xdaforums.com/showthread.php?t=784691[/size]

This version is not recommended for use any longer.

Details about what this fix does:

Creates a VIRTUAL EXT2 filesystem inside the stock RFS filesystem on the internal SD card, with a 4KB block size. This means that this lag fix creates a buffer between the real filesystem and the android system. This buffer should reduce the amount of disk I/O required for all operations by utilizing EXT2 buffering, as well as not writing file access times to disk, etc.

Folders that are currently supported:

/data/data
/data/system
/data/dalvik-cache
/data/app
/data/app-private as a symlink to /data/app/app-private

/dbdata/databases is not supported. It appears to be ROM backed, and can cause problems if overwritten.

Benefits over version 1

1.5GB of application data available, with no data loss.
e2fsck of the EXT2 partition on each boot.
Correct busybox version included! YES!
/app and /app-private directory included in the fix for faster application installs.
/dbdata/databases included in the fix, expected to give a big performance boost for apps that use it.
Mounts instead of symlinks for extra performance as OS does less work (about 100 or so more quadrant).

Benefits over other lag fixes

Open source, with full comments and ease of editing.
Works on any and all firmware versions, including any yet unreleased froyo versions (that don't change file structure).

Credits
Big thanks to mimocan for putting us all on the right track in how to sort out lag problems!
Big thanks to ykk_five for showing us all how well loopback filesystem mounting works!
Big thanks to cyanogen mod for e2fsck

Requirements for One Click Lag Fix 2.0

Rooted phone - http://www.addictivetips.com/mobile...t-samsung-galaxy-s-i9000-with-a-single-click/
Windows computer with SGS Drivers (Samsung Kies), or the ability to read through the batch file and run it yourself.
(Beta Release) The ability to reflash your device if something goes wrong.
No other lag fix installed. If you installed One Click Lag Fix 1.0, then use the uninstall function which came with that lag fix before running this lag fix. (Untested but assumed to be working, please help out here.)
1.5GB of freespace on Internal SD Card for swap files while the fix is working (/sdcard).
"Internal phone storage" in Settings->SD Card must read greater than 500mb (0.5GB) of free space.

How to run One Click Lag Fix 2.0

Place your phone into USB debugging mode: Settings->Applications->Development
Attach your device to your computer. :rolleyes: Do not mount the drives.
Download the attached ZIP file.
Unzip to a folder of your choice.
Double click "lagfixme.bat".
Don't double click "unlagfixme.bat". :rolleyes:
Wait for it to complete.
You will need your phone to be unlocked when it runs the script, so that you can accept the permissions request that will appear on your device.

How to remove One Click Lag Fix 2.0

Double click "unlagfixme.bat"
Wait for it to complete.

Known Issues For All Versions

Some custom firmwares use up all available space in /system. This fix requires some libraries to be placed in /system/lib. These libraries are used to create the filesystem properly, and to check it for errors on every boot.
If your firmware does not have the available space (around 1mb) in /system, do not use this fix! Your phone will not boot and will have to be restored from backup / reflashed.
Current known firmwares with this issue: None yet. Please provide the firmware version+mods if you encounter this issue. It will show up as an out of space error in the log, under 'Copying libraries'.

Known Issues 2-1, 2-2

Paid apps from the market have issues.
Google maps and other pre-installed ROM-backed applications have issues.

2-3 Changes from 2-2

/dbdata has been removed. This fixes maps issues.
/app-private is now a symlink to /app/app-private. This fixes paid apps issues.

Alternate installation methods for similar fixes

Tayutama has made an update.zip version that is easy to install - http://xdaforums.com/showpost.php?p=7632258&postcount=208
Chainfire has a .NET version of this fix with some nice features - http://xdaforums.com/showthread.php?t=751513
 
Last edited:
  • Like
Reactions: jerilmg

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
Frequently Asked Questions

Q: My apps are force closing while this fix is running, and I can't use my phone!
A: By design. The script has backed up/copied your apps over to the internal SD card (remember the requirement about 1.5GB of free space on the SD card?). It is now overwriting them with a 1.5GB file. As the file overwrites an app that is trying to do something, it will probably force close. This is normal.
Closing all running apps, and removing widgets before running this fix can make the process much smoother, though.

Q: The script can't transfer files to my phone / The script can't run / Help help I'm dieing!
A: Read the first post again.

Q: My paid apps from the market don't show up.
A: I will hopefully have a fix for this sooner or later. Hold tight! It's in the known issues. I don't have access to paid apps, so I can't test this.

Q: Does this need busybox?
A: No, busybox is included.

Q: I only have 200mb of free space now! What gives?
A: The lag fix has made a 1.5GB file, and is storing all of the data inside there. The side effect is that the free space meter is now incorrect. Sorry, this can't be helped. :(
You can check real free space by using ADB like this:
Code:
adb shell
su
busybox df -h

Q: When I use a backup tool, the backup is now 1.5GB big! It's taking forever!
A: The backup tool isn't designed to work with this fix. It will work, it just won't work well. Hopefully this fix will be short lived, and either Samsung will give us a new update, or someone will give us a good custom firmware that can natively mount what we need, where we need it. Or someone might come out with a better backup manager. Until then, we suffer. :(

Q: Will a reflash wipe this fix?
A: Yes, a reflash will wipe everything this fix did.

Q: Can this brick my phone?
A: If you know how to get to the download mode from power off (hint: volumedown+home+power), then almost nothing short of throwing your phone off a tall building can actually brick it. If you can't do this though, or don't know someone who can, then you're better off waiting for samsung to release a fix. Anything that moves files around on your device has the potential to break things, and this fix has no QA department. :D

Q: Why is /dbdata not included in your fix, but other people have included it?
A: Other people have included it in the same way my 2-2 fix includes it. However, /dbdata is ROM backed. This means that the real files are on ROM, and only the changes appear in the /dbdata folder. When copying or moving files from this folder, you would need to specify each folder by exact name to ensure that it was copied across, and each firmware can have their own names. (This is because RFS wildcard will not catch an unused ROM backed file.) In some cases, you can get lucky and have this work perfectly because you have already used all the files in /dbdata. There is no fail safe method to do this though, and /dbdata does not make a big difference to performance. (It is already on NAND flash.) If you want to try your luck, v2-2 is still available.

Q: Why does this lag fix work? Is it slowly destroying my phone?
A: Let's say an application counts from 1 to 10, and writes the value each time to disk.

Stock:
1 -> App tells RFS to write 1 to disk -> RFS writes 1 to disk -> RFS writes journal saying to changed the value on the disk.
2 -> App tells RFS to write 2 to disk -> RFS writes 2 to disk -> RFS writes journal saying to changed the value on the disk.
..
9 -> App tells RFS to write 9 to disk -> RFS writes 9 to disk -> RFS writes journal saying to changed the value on the disk.
10 -> App tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

Total physical disk writes: 20. Speed: SLOW! Wear and tear on disk: HIGH!

Lag Fix:
1 -> App tells EXT2 to write 1 to disk -> EXT2 stores 1 in RAM.
2 -> App tells EXT2 to write 2 to disk -> EXT2 stores 2 in RAM.
..
9 -> App tells EXT2 to write 9 to disk -> EXT2 stores 9 in RAM.
10 -> App tells EXT2 to write 10 to disk -> EXT2 stores 10 in RAM.
..
EXT2 tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

Total physical disk writes: 2. Speed: FAST! Wear and tear on disk: LOW!

This isn't exactly what is happening, but it gives you the general idea.

Q: Can this mod work on other Android devices? Would we see a performance boost on them as well? If not why is it limited to the Galaxy S?
A: SGS has very very good hardware, but it has some parts of it's hardware poorly implemented. The filesystem that samsung chose to use is custom-built using FAT32 as a base, RFS. It has a lot of the problems that FAT32 has, and should have been left back in the 90s, or even the 80s. :)

One of the big issues with it is how it handles multiple requests - it blocks. It blocks everything. When your mail app wants to read the mail you just tried to view, but your twitter app is busy writing a new tweat it just received, your mail app is forced to wait.

This is bad, but it could be worse! And it is... your twitter app didn't just get one tweat, it got 50 tweaks. It is busy writing the tweats one by one to the filesystem. This would be fine, since all modern filesystems will buffer writes, so instead of writing each one at a time, they will batch them together and write it as a big chunk. Uh oh - RFS does no buffering at all! After each write, it will also write an update to the grafted-on journal system. Guess what happened to your mail you were trying to view while all this happened? It 'lagged' and you got a black screen for half a second, before the mail popped into view.

Luckily the hardware on the device is so good that you usually don't even notice the problem until you have a lot of apps running, all writing their updates when you unlock the phone.

This is mostly speculation based on experiments done on RFS -- RFS is closed source, and we have no idea if the problems are just badly set settings (such as a block size that is too small), coding bugs in the implementation, or if RFS is just really that badly designed.

This fix just grafts a buffer on top of the RFS filesystem, using a very very simple and fast filesystem, EXT2. It fixes most of the issues by writing to RFS as seldom as possible.

So no, this fix won't fix other devices, since they're already running quite close to maximum speed. The SGS at stock is running nowhere near maximum speed, and this lag fix takes it a bit closer. You could probably speed up other devices by tweaking the filesystem settings to give them a big buffer or similar, but it isn't really needed. (I haven't actually tried to put an EXT2 onto any other Android phone, as I don't have any other Android phone, so this is just speculation.)

Q: My phone is fast now!
A: Yeah.
 
Last edited:
  • Like
Reactions: samsung best

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
Oh, awesome. I managed to post this in the wrong forum. Doh!

Could a moderator please move this to Android Dev sub forum?
 

MAMBO04

Retired Recognized Developer
Jan 29, 2009
1,581
888
Brighton
haha looks awesome dude but you are correct, wrong section ;) im gonna try it now, will report in 5 mins!
 
Last edited:

E_man5112

Senior Member
Jul 13, 2010
649
34
A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is
 

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is

The old one is still here. Nothing has changed that should stop it working on the captivate though, but it is completely untested. Use the 1.0 (which has had a lot of testing) until this one has been put through the paces. :D
 

amerikian

Senior Member
Mar 19, 2007
232
19
madison
The old one is still here. Nothing has changed that should stop it working on the captivate though, but it is completely untested. Use the 1.0 (which has had a lot of testing) until this one has been put through the paces. :D

A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is

I'm running the manual ext2 fix with Q scores 2000+. I'll try 2.0 Util tonight and post feedback....
 

Zilch25

Senior Member
Jul 28, 2010
2,073
12
West Palm Beach, FL
The old one is still here. Nothing has changed that should stop it working on the captivate though, but it is completely untested. Use the 1.0 (which has had a lot of testing) until this one has been put through the paces. :D

I'm in the process of flashing back to stock on my Captivate so I can give this a legit test. I'll report back here and let you know how it goes. Assuming my Captivate doesn't melt I'll update my OP from the thread about the original fix in the Captivate section!
 

clubtech

Senior Member
Jun 26, 2007
1,908
353
USA
I just removed the V1 version and finished the V2.
It finally finished and rebooted the phone. now it tells me my internal memory storage is full. None of my Widgets will load.
Looking i see only 14MB free in internal storage.

thoughts?
 

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
I'm in the process of flashing back to stock on my Captivate so I can give this a legit test. I'll report back here and let you know how it goes. Assuming my Captivate doesn't melt I'll update my OP from the thread about the original fix in the Captivate section!

Just as long as you point out that this fix isn't heavily tested yet! :D
 

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
I just removed the V1 version and finished the V2.
It finally finished and rebooted the phone. now it tells me my internal memory storage is full. None of my Widgets will load.
Looking i see only 14MB free in internal storage.

thoughts?

Thoughts? That's bad. :D

You should be seeing roughly 215mb free. Did you see any errors in the log at all?
 

Guiper

Senior Member
Sep 9, 2008
160
192
Everything is working fine for me. First reboot after lagfix had some problems with downloading apps from market, but after a second reboot it got fixed.

"Biggest" problem now, is just the phone stating that my internal phone storage is too low, with an icon on notification bar that I cannot remove. Already deleted some .bak from /data folder, any more tips what I can delete to get rid from this message?

Regarding the fix. apps are indeed much more snappier, no lag on the system when installing apps from market, and overall if the phone would continue like this for the next 48 hours, lag fix form me is solved. I had some problems after some 24h, with some lag, even with the previous version of the lag fix.
 

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
I just removed the V1 version and finished the V2.
It finally finished and rebooted the phone. now it tells me my internal memory storage is full. None of my Widgets will load.
Looking i see only 14MB free in internal storage.

thoughts?

Looking through my old V1 remove script, I believe I was leaving behind the .bak files! Nastyyy... I'll update V2 to remove those if they're there on install. Will hopefully clear up any problems.
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    [size=+2]This version is now deprecated in favor of the 2.0 APK version. Please see this link: http://xdaforums.com/showthread.php?t=784691[/size]

    This version is not recommended for use any longer.

    Details about what this fix does:

    Creates a VIRTUAL EXT2 filesystem inside the stock RFS filesystem on the internal SD card, with a 4KB block size. This means that this lag fix creates a buffer between the real filesystem and the android system. This buffer should reduce the amount of disk I/O required for all operations by utilizing EXT2 buffering, as well as not writing file access times to disk, etc.

    Folders that are currently supported:

    /data/data
    /data/system
    /data/dalvik-cache
    /data/app
    /data/app-private as a symlink to /data/app/app-private

    /dbdata/databases is not supported. It appears to be ROM backed, and can cause problems if overwritten.

    Benefits over version 1

    1.5GB of application data available, with no data loss.
    e2fsck of the EXT2 partition on each boot.
    Correct busybox version included! YES!
    /app and /app-private directory included in the fix for faster application installs.
    /dbdata/databases included in the fix, expected to give a big performance boost for apps that use it.
    Mounts instead of symlinks for extra performance as OS does less work (about 100 or so more quadrant).

    Benefits over other lag fixes

    Open source, with full comments and ease of editing.
    Works on any and all firmware versions, including any yet unreleased froyo versions (that don't change file structure).

    Credits
    Big thanks to mimocan for putting us all on the right track in how to sort out lag problems!
    Big thanks to ykk_five for showing us all how well loopback filesystem mounting works!
    Big thanks to cyanogen mod for e2fsck

    Requirements for One Click Lag Fix 2.0

    Rooted phone - http://www.addictivetips.com/mobile...t-samsung-galaxy-s-i9000-with-a-single-click/
    Windows computer with SGS Drivers (Samsung Kies), or the ability to read through the batch file and run it yourself.
    (Beta Release) The ability to reflash your device if something goes wrong.
    No other lag fix installed. If you installed One Click Lag Fix 1.0, then use the uninstall function which came with that lag fix before running this lag fix. (Untested but assumed to be working, please help out here.)
    1.5GB of freespace on Internal SD Card for swap files while the fix is working (/sdcard).
    "Internal phone storage" in Settings->SD Card must read greater than 500mb (0.5GB) of free space.

    How to run One Click Lag Fix 2.0

    Place your phone into USB debugging mode: Settings->Applications->Development
    Attach your device to your computer. :rolleyes: Do not mount the drives.
    Download the attached ZIP file.
    Unzip to a folder of your choice.
    Double click "lagfixme.bat".
    Don't double click "unlagfixme.bat". :rolleyes:
    Wait for it to complete.
    You will need your phone to be unlocked when it runs the script, so that you can accept the permissions request that will appear on your device.

    How to remove One Click Lag Fix 2.0

    Double click "unlagfixme.bat"
    Wait for it to complete.

    Known Issues For All Versions

    Some custom firmwares use up all available space in /system. This fix requires some libraries to be placed in /system/lib. These libraries are used to create the filesystem properly, and to check it for errors on every boot.
    If your firmware does not have the available space (around 1mb) in /system, do not use this fix! Your phone will not boot and will have to be restored from backup / reflashed.
    Current known firmwares with this issue: None yet. Please provide the firmware version+mods if you encounter this issue. It will show up as an out of space error in the log, under 'Copying libraries'.

    Known Issues 2-1, 2-2

    Paid apps from the market have issues.
    Google maps and other pre-installed ROM-backed applications have issues.

    2-3 Changes from 2-2

    /dbdata has been removed. This fixes maps issues.
    /app-private is now a symlink to /app/app-private. This fixes paid apps issues.

    Alternate installation methods for similar fixes

    Tayutama has made an update.zip version that is easy to install - http://xdaforums.com/showpost.php?p=7632258&postcount=208
    Chainfire has a .NET version of this fix with some nice features - http://xdaforums.com/showthread.php?t=751513
    1
    Frequently Asked Questions

    Q: My apps are force closing while this fix is running, and I can't use my phone!
    A: By design. The script has backed up/copied your apps over to the internal SD card (remember the requirement about 1.5GB of free space on the SD card?). It is now overwriting them with a 1.5GB file. As the file overwrites an app that is trying to do something, it will probably force close. This is normal.
    Closing all running apps, and removing widgets before running this fix can make the process much smoother, though.

    Q: The script can't transfer files to my phone / The script can't run / Help help I'm dieing!
    A: Read the first post again.

    Q: My paid apps from the market don't show up.
    A: I will hopefully have a fix for this sooner or later. Hold tight! It's in the known issues. I don't have access to paid apps, so I can't test this.

    Q: Does this need busybox?
    A: No, busybox is included.

    Q: I only have 200mb of free space now! What gives?
    A: The lag fix has made a 1.5GB file, and is storing all of the data inside there. The side effect is that the free space meter is now incorrect. Sorry, this can't be helped. :(
    You can check real free space by using ADB like this:
    Code:
    adb shell
    su
    busybox df -h

    Q: When I use a backup tool, the backup is now 1.5GB big! It's taking forever!
    A: The backup tool isn't designed to work with this fix. It will work, it just won't work well. Hopefully this fix will be short lived, and either Samsung will give us a new update, or someone will give us a good custom firmware that can natively mount what we need, where we need it. Or someone might come out with a better backup manager. Until then, we suffer. :(

    Q: Will a reflash wipe this fix?
    A: Yes, a reflash will wipe everything this fix did.

    Q: Can this brick my phone?
    A: If you know how to get to the download mode from power off (hint: volumedown+home+power), then almost nothing short of throwing your phone off a tall building can actually brick it. If you can't do this though, or don't know someone who can, then you're better off waiting for samsung to release a fix. Anything that moves files around on your device has the potential to break things, and this fix has no QA department. :D

    Q: Why is /dbdata not included in your fix, but other people have included it?
    A: Other people have included it in the same way my 2-2 fix includes it. However, /dbdata is ROM backed. This means that the real files are on ROM, and only the changes appear in the /dbdata folder. When copying or moving files from this folder, you would need to specify each folder by exact name to ensure that it was copied across, and each firmware can have their own names. (This is because RFS wildcard will not catch an unused ROM backed file.) In some cases, you can get lucky and have this work perfectly because you have already used all the files in /dbdata. There is no fail safe method to do this though, and /dbdata does not make a big difference to performance. (It is already on NAND flash.) If you want to try your luck, v2-2 is still available.

    Q: Why does this lag fix work? Is it slowly destroying my phone?
    A: Let's say an application counts from 1 to 10, and writes the value each time to disk.

    Stock:
    1 -> App tells RFS to write 1 to disk -> RFS writes 1 to disk -> RFS writes journal saying to changed the value on the disk.
    2 -> App tells RFS to write 2 to disk -> RFS writes 2 to disk -> RFS writes journal saying to changed the value on the disk.
    ..
    9 -> App tells RFS to write 9 to disk -> RFS writes 9 to disk -> RFS writes journal saying to changed the value on the disk.
    10 -> App tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

    Total physical disk writes: 20. Speed: SLOW! Wear and tear on disk: HIGH!

    Lag Fix:
    1 -> App tells EXT2 to write 1 to disk -> EXT2 stores 1 in RAM.
    2 -> App tells EXT2 to write 2 to disk -> EXT2 stores 2 in RAM.
    ..
    9 -> App tells EXT2 to write 9 to disk -> EXT2 stores 9 in RAM.
    10 -> App tells EXT2 to write 10 to disk -> EXT2 stores 10 in RAM.
    ..
    EXT2 tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

    Total physical disk writes: 2. Speed: FAST! Wear and tear on disk: LOW!

    This isn't exactly what is happening, but it gives you the general idea.

    Q: Can this mod work on other Android devices? Would we see a performance boost on them as well? If not why is it limited to the Galaxy S?
    A: SGS has very very good hardware, but it has some parts of it's hardware poorly implemented. The filesystem that samsung chose to use is custom-built using FAT32 as a base, RFS. It has a lot of the problems that FAT32 has, and should have been left back in the 90s, or even the 80s. :)

    One of the big issues with it is how it handles multiple requests - it blocks. It blocks everything. When your mail app wants to read the mail you just tried to view, but your twitter app is busy writing a new tweat it just received, your mail app is forced to wait.

    This is bad, but it could be worse! And it is... your twitter app didn't just get one tweat, it got 50 tweaks. It is busy writing the tweats one by one to the filesystem. This would be fine, since all modern filesystems will buffer writes, so instead of writing each one at a time, they will batch them together and write it as a big chunk. Uh oh - RFS does no buffering at all! After each write, it will also write an update to the grafted-on journal system. Guess what happened to your mail you were trying to view while all this happened? It 'lagged' and you got a black screen for half a second, before the mail popped into view.

    Luckily the hardware on the device is so good that you usually don't even notice the problem until you have a lot of apps running, all writing their updates when you unlock the phone.

    This is mostly speculation based on experiments done on RFS -- RFS is closed source, and we have no idea if the problems are just badly set settings (such as a block size that is too small), coding bugs in the implementation, or if RFS is just really that badly designed.

    This fix just grafts a buffer on top of the RFS filesystem, using a very very simple and fast filesystem, EXT2. It fixes most of the issues by writing to RFS as seldom as possible.

    So no, this fix won't fix other devices, since they're already running quite close to maximum speed. The SGS at stock is running nowhere near maximum speed, and this lag fix takes it a bit closer. You could probably speed up other devices by tweaking the filesystem settings to give them a big buffer or similar, but it isn't really needed. (I haven't actually tried to put an EXT2 onto any other Android phone, as I don't have any other Android phone, so this is just speculation.)

    Q: My phone is fast now!
    A: Yeah.
    1
    Strange... installing 1.0 first won't help you though. It must be a bug somewhere that is causing it. 865 quadrant probably means it did not install correctly. Check if you have the problem copying libraries.

    Ok, well, I'm reinstalling 2.0 now, after unlagfixme.bat I get this message though, got it last time, but thought nothing of it



    Device size reported to be zero, invalid partition and mount: Invalid argument have me worried.
    1
    Did you manage to restore your phone eventually? This appears to a common problem with RyanZ OCLF. No support whatsover. You can always to a factory reset but best option would be to Flash your ROM afresh
    1
    Same here after installation,my Galaxy s died...Please help???
    You can do a factory rest to restore your phone but it'll still be laggy. Best way to go is to flash your ROM