F2FS FOR EVITA ANY AOSP ROM

Search This thread

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
F2FS FOR EVITA ANY AOSP ROM

F2FS for EVITA
AOSP only!
Current CM or most any of our AOSP ROMs around here that use a current CM based kernel.

THIS IS EXPERIMENTAL AND HAS POTENTIAL FOR DATA LOSS IF DONE IMPROPERLY. IF YOU ARE NOT COMFORTABLE WITH THAT PLEASE DO NOT ATTEMPT. I CANNOT BE AVAILABLE FOR 24/7 SUPPORT ON THIS.

These mods will provide the ability to format /data and /cache in F2FS format instead of EXT4. Use extreme caution. The will erase your entire /data partition just like a clean flash. I cannot and will not be held responsible for your failure to keep backups handy. F2FS is still considered experimental by Samsung and should be by you the user as well.

What is F2FS?
F2FS wiki

Why F2FS?
F2FS put to the test vs EXT4

How to switch?
PLEASE READ INSTRUCTIONS CAREFULLY. IF NOT FOLLOWED YOU WILL LIKELY BOOTLOOP!!

F2FS capable TWRP Recovery 2.7.1.0 KK version
F2FS capable TWRP Recovery 2.8.5.0 KK versionThis is the same as the current official TWRP built with the added F2FS support commits. When wiping a partition you will have the option to reformat in F2FS now as well.

Kernel+fstab conversion zip Flash this after converting partitions to F2FS to install a CM kernel with F2FS support built in. This zip uses an anykernel installer so it should be comparable with most current ROMS. The zip will extract your current boot.img, unpack and replace your current fstab with a new fstab to indicate you current partition types, replace kernel with F2FS capable kernel , then repack and replace the boot.img

Fstab conversion zip For use only when you are already running a F2FS kernel and only need to update fstab after switching to/from F2FS/EXT4. This installer will only unpack, edit the fstab, and repack the boot.img. This will not replace the kernel, you must already be using an F2FS kernel or be returning to EXT4 only to make use of this zip.

DOWNLOADS NOW HOSTED @ CODEFI.RE
http://downloads.codefi.re/jrior001/Evita-f2fs

Procedure for fresh conversion including new Rom flashing:
1. Backup everthing you want to keep with titanium backup or whatever backup you choose.
2. Fastboot flash the new recovery img.
3. Run a twrp backup in case things get ugly!
4. Flash new ROM now if desired.
5. Still in recovery...Goto wipe -> hit Advanced wipe. Select data and hit change partition type. Convert to F2FS. Repeat for cache.
6. Flash the Kernel+fstab conversion zip.
7. Reboot and profit. Any partition app on market can confirm new format changes.

Procedure for nightly ROM updates after F2FS conversion:
1. Flaah nightly
2. Flash kernel+fstab conversion zip.

Procedure if you want to convert back and forth after initial conversion for testing purposes:
1. Change formats of data/cache as desired (only ext4 and f2fs supported).
2. Flash fstab conversion zip to update format types before attempting boot.

Code:
CHANGELOG
V1.0 - Initial release

V1.1 - added inline_data flag to F2FS mounts

V1.2 - updated to latest kernel/fstab as of 8/9

V2.0 - updated for cm-12.0


Source:
Kernel: https://github.com/jrior001/android_kernel_htc_msm8960/tree/cm-11.0-f2fs
Recovery tree: https://github.com/jrior001/twrp-htc-evita/tree/cm-12.0
Fstab scripts: https://github.com/jrior001/f2fs_fstab_convert_script

Devs, feel free to use or modify any of this for your own work just give thanks to where it came from. It was not all my original work, I must give thanks to Metallice and a few other devs in the grouper forum whose scripts I adapted for my own work.

XDA:DevDB Information
F2FS EVITA, Kernel for the AT&T HTC One X

Contributors
jrior001
Source Code: https://github.com/jrior001/f2fs_fstab_convert_script

Kernel Special Features: f2fs support

Version Information
Status: Beta
Current Beta Version: 1.0
Beta Release Date: 2014-07-08

Created 2014-07-09
Last Updated 2015-02-26
 

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
Links and Instructions are now up. As promised, F2FS support is now possible for /data and /cache on Evita. For now there is no support for converting /system to F2FS as most have said it does not show significant gains because there is far less writing to /system partition. Also, as of now the only way to support converting /system would require specific ROMs built specifically for F2FS on system. As I have done it here we remain flexible to flash any regular nightly and still enjoy the gains of F2FS on /data and /cache. Follow instructions carefully and enjoy.
 

pandasa123

Senior Member
Jul 20, 2013
1,562
1,534
South Grafton
If we were building an AOSP ROM, how would we have F2FS already enabled? just wondering if there was a way to eliminate a few steps
 

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
If we were building an AOSP ROM, how would we have F2FS already enabled? just wondering if there was a way to eliminate a few steps
I've been following some other devices trials and tribulations with f2fs. Most other places I'm seeing dev convert the partitions in the device trees fstab. This results in a fixed f2fs or fixed ext4 ROM. As a dev that means building 2 ROMs which is a time waster.

With these fstab scripts I modded from the grouper forums I was able to make basically any aosp ROM adaptable to f2fs or ext4 for data and cache. I have included this same script work and the needed f2fs tools into the torched installer as well as the f2fs conversion zips.

Pandasa123 I have posted all the source in the f2fs thread. You really only need the kernel commits and the f2fs capable recovery along with my scripts. You could also build a fixed f2fs ROM if you chose and I have commits on my github and on CM gerrit to use as examples for that as well. I have also pushed kernel commits to CM gerreit in hopes that intervigil will merge them to make this a lot simpler but I highly doubt that will happen.
 

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
@pandasa123, little more info...

If you look through my fstab zip scripts you'll find that they check the partitions for filesystem type, unpack the boot.img and the edit the fstab accordingly for f2fs or ext4 with all the proper mount flags and then repack the boot.img.

This seemed to me to be an easy way for any user to get their feet wet on f2fs and it takes the extra work away from the devs having to cook duplicate roms. Flash any current ROM, then flash the conversion zip to get your fstab proper based on whatever partition format you are currently on.

There is also a movement on liquid smooth to incorporate this type of conversion script into the ROM zip but its still a huge wip.
 

Heisenberg

Retired Forum Moderator
Jun 29, 2011
27,180
18,633
Knocking on your door
OnePlus 9 Pro
Great work, what an awesome parting gift. I have to say again, you've been such a fantastic asset to the Evita forum, easily one of the most significant and high quality contributors we've had the privilege to have here. Really wish I could get my hands on a OnePlus One now!

Sent from my Evita
 
  • Like
Reactions: mehdifirefox

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
Great work, what an awesome parting gift. I have to say again, you've been such a fantastic asset to the Evita forum, easily one of the most significant and high quality contributors we've had the privilege to have here. Really wish I could get my hands on a OnePlus One now!

Sent from my Evita
Did you try the f2fs yet? Curious for some feedback on how it feels to others. @cannondaleV2000 was helping me test this for a week or so until he bricked his ville then other day(unrelated, switching hboots failed him).
 

Heisenberg

Retired Forum Moderator
Jun 29, 2011
27,180
18,633
Knocking on your door
OnePlus 9 Pro
I haven't yet, I'm a stay at home dad to a seven week old little girl so I struggle to find the time to even flash a ROM recently. If I get some free time (that's a fairly big if) I'll definitely test it out. It's a real shame about his Ville, I think he got really unlucky and his PC thermalled and rebooted on him during the hboot change. Pretty sure he's getting it jtagged though.

Sent from my Evita
 

sephiroth2k

Senior Member
Nov 10, 2012
125
101
EXT4 vs F2FS benchmarks

a7gXkdY.png


These were done on the same ROM (PA 4.42 stock kernel, then PA 4.42 F2FS evita kernel), followed instructions exactly, rebooted and re-ran the benchmark several times with approximately the same results. Benchmarks were performed on the /data partition. Not sure why SQLite performance took such a hit...
 
Last edited:
  • Like
Reactions: pandasa123

sephiroth2k

Senior Member
Nov 10, 2012
125
101
jrior001 said:
Generally similar to what numbers I had as well. Noticeable gains in both continuous and random write speeds.
Yeah definitely, just curious as to why SQLite was slower with faster random write benchmarks? Seems counter-intuitive; faster writes should mean faster database writes. Also, across multiple runs Browser and Camcorder opened more quickly with F2FS but Camera was slower. IANA filesystem developer however. Thanks for this awesome contribution to the evita scene.

---------- Post added at 09:33 PM ---------- Previous post was at 09:13 PM ----------

Hey I googled a little and found this, suggested issue was "I suspect that you turned on CONFIG_DEBUG_MUTEXES in your .config." # CONFIG_DEBUG_MUTEXES is not set in ville_defconfig . Just throwing it out there
 
  • Like
Reactions: jrior001

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
Yeah definitely, just curious as to why SQLite was slower with faster random write benchmarks? Seems counter-intuitive; faster writes should mean faster database writes. Also, across multiple runs Browser and Camcorder opened more quickly with F2FS but Camera was slower. IANA filesystem developer however. Thanks for this awesome contribution to the evita scene.

---------- Post added at 09:33 PM ---------- Previous post was at 09:13 PM ----------

Hey I googled a little and found this, suggested issue was "I suspect that you turned on CONFIG_DEBUG_MUTEXES in your .config." # CONFIG_DEBUG_MUTEXES is not set in ville_defconfig . Just throwing it out there
Its off in Evita source as well. Appreciate the effort and I will look more at that commit as well.
 
  • Like
Reactions: sephiroth2k

budroid

Senior Member
I decided to give the F2FS a try and so I went with the latest CarbonKat and your Torched kernel. I haven't run any benchmarks and I'm still getting all my stuff put back on here but I must say that almost everything seems faster so far. Most noticeable differences so far for me are bootup time is significantly shorter and my phone didn't slow down much at all while installing my apps from the Play Store. Before the switch to F2FS, I had noticed that my phone would lag (sometimes badly) as I would go through the My Apps list in the Play Store and continue choosing apps to install while others were still downloading/installing. Also for me most apps seem to open a little faster than before and work more smoothly.

I do have a question for you about the TWRP backup/restore process with F2FS. Specifically, lets say I backup CarbonKat with the F2FS partitions and then install something else without F2FS (or restore another backup that is not F2FS). If I want to switch back, can I then just restore my TWRP backup of CarbonKat with F2FS? If not, can you recommend a process for that? I'm probably not going to switch from this setup for a while but its hard to tell.

Also, about using the kernel+fstab zip vs just the fstab zip...I used the fstab only zip after flashing your kernel (which already has F2FS support) and that worked out fine for me. But, could I just always use the kernel+fstab zip even if the kernel I flash already has F2FS support?

Hope these questions are ok and thank you for all that you've done for our devices. This F2FS change is one of the most noticeable performance increases I've seen on my Evita and it's been my daily driver since AT&T released it back in 2012. Are there any benchmarks that you'd like me to run or any questions I might be able to answer for you on my usage/experience? If so, I may have to ask for detailed instructions if there's something I haven't needed to do before with android (still learning).
 

jrior001

Senior Member
Aug 12, 2010
3,200
8,681
Va Beach
I decided to give the F2FS a try and so I went with the latest CarbonKat and your Torched kernel. I haven't run any benchmarks and I'm still getting all my stuff put back on here but I must say that almost everything seems faster so far. Most noticeable differences so far for me are bootup time is significantly shorter and my phone didn't slow down much at all while installing my apps from the Play Store. Before the switch to F2FS, I had noticed that my phone would lag (sometimes badly) as I would go through the My Apps list in the Play Store and continue choosing apps to install while others were still downloading/installing. Also for me most apps seem to open a little faster than before and work more smoothly.
That's bid difference I saw as well, apps install and load a bit quicker.

I do have a question for you about the TWRP backup/restore process with F2FS. Specifically, lets say I backup CarbonKat with the F2FS partitions and then install something else without F2FS (or restore another backup that is not F2FS). If I want to switch back, can I then just restore my TWRP backup of CarbonKat with F2FS? If not, can you recommend a process for that? I'm probably not going to switch from this setup for a while but its hard to tell.

If you ran a backup of your old ext4 /data partition and attempt to restore it, TWRP will restore it exactly as it was, in ext4. Lable your backups yo make it easier on yourself!! Twrp will restore in the same format as it was when backed up. Make sure you run the fstab script afterwards or you will bootloop while it fails to load /data.

Also, about using the kernel+fstab zip vs just the fstab zip...I used the fstab only zip after flashing your kernel (which already has F2FS support) and that worked out fine for me. But, could I just always use the kernel+fstab zip even if the kernel I flash already has F2FS support?

Yes but it will replace your kernel with a basic CM kernel w/f2fs support. If you want to run torched you made the right choice using the fstab only.

EDIT: Torched Installer includes the conversion script as well now.

Hope these questions are ok and thank you for all that you've done for our devices.
Great questions!! And your welcome, I've learned tons messing with this over the last 2 years :)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    F2FS FOR EVITA ANY AOSP ROM

    F2FS for EVITA
    AOSP only!
    Current CM or most any of our AOSP ROMs around here that use a current CM based kernel.

    THIS IS EXPERIMENTAL AND HAS POTENTIAL FOR DATA LOSS IF DONE IMPROPERLY. IF YOU ARE NOT COMFORTABLE WITH THAT PLEASE DO NOT ATTEMPT. I CANNOT BE AVAILABLE FOR 24/7 SUPPORT ON THIS.

    These mods will provide the ability to format /data and /cache in F2FS format instead of EXT4. Use extreme caution. The will erase your entire /data partition just like a clean flash. I cannot and will not be held responsible for your failure to keep backups handy. F2FS is still considered experimental by Samsung and should be by you the user as well.

    What is F2FS?
    F2FS wiki

    Why F2FS?
    F2FS put to the test vs EXT4

    How to switch?
    PLEASE READ INSTRUCTIONS CAREFULLY. IF NOT FOLLOWED YOU WILL LIKELY BOOTLOOP!!

    F2FS capable TWRP Recovery 2.7.1.0 KK version
    F2FS capable TWRP Recovery 2.8.5.0 KK versionThis is the same as the current official TWRP built with the added F2FS support commits. When wiping a partition you will have the option to reformat in F2FS now as well.

    Kernel+fstab conversion zip Flash this after converting partitions to F2FS to install a CM kernel with F2FS support built in. This zip uses an anykernel installer so it should be comparable with most current ROMS. The zip will extract your current boot.img, unpack and replace your current fstab with a new fstab to indicate you current partition types, replace kernel with F2FS capable kernel , then repack and replace the boot.img

    Fstab conversion zip For use only when you are already running a F2FS kernel and only need to update fstab after switching to/from F2FS/EXT4. This installer will only unpack, edit the fstab, and repack the boot.img. This will not replace the kernel, you must already be using an F2FS kernel or be returning to EXT4 only to make use of this zip.

    DOWNLOADS NOW HOSTED @ CODEFI.RE
    http://downloads.codefi.re/jrior001/Evita-f2fs

    Procedure for fresh conversion including new Rom flashing:
    1. Backup everthing you want to keep with titanium backup or whatever backup you choose.
    2. Fastboot flash the new recovery img.
    3. Run a twrp backup in case things get ugly!
    4. Flash new ROM now if desired.
    5. Still in recovery...Goto wipe -> hit Advanced wipe. Select data and hit change partition type. Convert to F2FS. Repeat for cache.
    6. Flash the Kernel+fstab conversion zip.
    7. Reboot and profit. Any partition app on market can confirm new format changes.

    Procedure for nightly ROM updates after F2FS conversion:
    1. Flaah nightly
    2. Flash kernel+fstab conversion zip.

    Procedure if you want to convert back and forth after initial conversion for testing purposes:
    1. Change formats of data/cache as desired (only ext4 and f2fs supported).
    2. Flash fstab conversion zip to update format types before attempting boot.

    Code:
    CHANGELOG
    V1.0 - Initial release
    
    V1.1 - added inline_data flag to F2FS mounts
    
    V1.2 - updated to latest kernel/fstab as of 8/9
    
    V2.0 - updated for cm-12.0


    Source:
    Kernel: https://github.com/jrior001/android_kernel_htc_msm8960/tree/cm-11.0-f2fs
    Recovery tree: https://github.com/jrior001/twrp-htc-evita/tree/cm-12.0
    Fstab scripts: https://github.com/jrior001/f2fs_fstab_convert_script

    Devs, feel free to use or modify any of this for your own work just give thanks to where it came from. It was not all my original work, I must give thanks to Metallice and a few other devs in the grouper forum whose scripts I adapted for my own work.

    XDA:DevDB Information
    F2FS EVITA, Kernel for the AT&T HTC One X

    Contributors
    jrior001
    Source Code: https://github.com/jrior001/f2fs_fstab_convert_script

    Kernel Special Features: f2fs support

    Version Information
    Status: Beta
    Current Beta Version: 1.0
    Beta Release Date: 2014-07-08

    Created 2014-07-09
    Last Updated 2015-02-26
    11
    Links and Instructions are now up. As promised, F2FS support is now possible for /data and /cache on Evita. For now there is no support for converting /system to F2FS as most have said it does not show significant gains because there is far less writing to /system partition. Also, as of now the only way to support converting /system would require specific ROMs built specifically for F2FS on system. As I have done it here we remain flexible to flash any regular nightly and still enjoy the gains of F2FS on /data and /cache. Follow instructions carefully and enjoy.
    7
    @jrior001 any possibility you can update this thread with new setups for the new CM (with F2Fs baked in) and TWRP 8+. I know you are busy with the new OPO !
    I may be able to get some freshness out in a few days...CM guys are testing offmode charging graphics ATM and I'd like to hold off until that's ready before building new recovery.
    6
    Officially giving up on porting to sense. The fstab structure is a bit different and the modern recoveries will not flash the old sense roms. You could play recovery shuffle but I really just don't have the time to play the game.

    Also I saw some new changes in latest CM nightlies that affected fstab. These may affect conversion. As these filter down to the other aosp ROMs, more issues will pop up. I'll try to get an update in soon.
    4
    Could you please define "speeds"? Do you have any supportive data or is this just anecdotal?

    Sent from my Evita

    Torched F2FS is on the right in attached image. As you would say, read the thread - I've been posting benchmarks ;). I'm at work, didn't attach first try.