Use of F2FS for /data

Search This thread

HypoTurtle

Senior Member
May 5, 2011
1,970
1,257
Um no I haven't. I did try and use osmosis's kitchen and I swaped the fstab for the correct one. I was going to just edit it with my favorite notepad program but decided I wasn't sure I'd get it right.

It did not work. Not sure why.

Sent from my Nexus 7 using Tapatalk

What is most likely to work is to switch the fstab file and the kernel. If you can send me the boot img (better use PM as not to clog up this thread), I should be able to switch them in a few minutes.
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
What is most likely to work is to switch the fstab file and the kernel. If you can send me the boot img (better use PM as not to clog up this thread), I should be able to switch them in a few minutes.
I already managed to get it to work for /data just fine, that was easy. But I was wanting to use this same ROM with all three partitions formatted to F2FS, and using Fauxs 25 kernel. That requires a bit more work I think. And I bet the reward is minimal.

I will PM you what I did.
 

FReaKRaNT

Senior Member
Oct 28, 2012
464
108
Toronto
I already managed to get it to work for /data just fine, that was easy. But I was wanting to use this same ROM with all three partitions formatted to F2FS, and using Fauxs 25 kernel. That requires a bit more work I think. And I bet the reward is minimal.

I will PM you what I did.

Go to the updated tarp thread. It has a script to format all partitions to f2fs.

Cheers, FReaKRaNT
 

asturel

Member
Oct 28, 2010
38
13
Its a build flag, it has to be in BoardConfigCommon.mk before you make the recoveryimage
I also formatted /cache as f2fs, the device feels much smoother, also in antutu the storage i/o 686 -> 951
 

ss2man44

Senior Member
Aug 31, 2011
56
74
Trenton, GA
Newest TWRP doesnt need any hack, just add TARGET_USERIMAGES_USE_F2FS := true
I used your patch on cm11's kernel, working flawlessly, thanks!

Thanks for that. I knew it was something easy but I didn't want to set up yet another Android source tree just to show this proof of concept, so I didn't go digging very much for documentation regarding that define.
 

Maxr1998

Recognized Developer
Apr 15, 2013
2,161
3,221
25
Germany
maxr1998.de
Google Nexus 4
Nexus 7
So, to make a rom ALL-f2fs compatible, we just have to change /system and /data partitions format on fstab.grouper from ext4 to f2fs? Off course, on a device with already modified twrp recovery with f2fs tools....

Would interest me as well...

Sent using my nexus⁴ running Mahdi 2.5 with Xposed, XThemes and hells-Core B46 KK t4
 

frantisek.nesveda

Senior Member
Jan 10, 2012
342
524
So, to make a rom ALL-f2fs compatible, we just have to change /system and /data partitions format on fstab.grouper from ext4 to f2fs? Off course, on a device with already modified twrp recovery with f2fs tools....
Would interest me as well...

Well, there is more to that.
First, you have to have a kernel with the driver for F2FS compiled in. Next, you need to edit the fstab.grouper and change the format of /system, /cache and /data to F2FS. And then, in some cases, you need to modify the updater-script of the ROM so it won't format /system during the install as EXT4, but rather as F2FS.
The last thing is the reason I'm still on Data-F2FS instead of ALL-F2FS. I can still update my ROM via CMUpdater and then just install the kernel again, no need to unzip, change the updater-script and then zip again.
 

Maxr1998

Recognized Developer
Apr 15, 2013
2,161
3,221
25
Germany
maxr1998.de
Google Nexus 4
Nexus 7
Well, there is more to that.
First, you have to have a kernel with the driver for F2FS compiled in. Next, you need to edit the fstab.grouper and change the format of /system, /cache and /data to F2FS. And then, in some cases, you need to modify the updater-script of the ROM so it won't format /system during the install as EXT4, but rather as F2FS.
The last thing is the reason I'm still on Data-F2FS instead of ALL-F2FS. I can still update my ROM via CMUpdater and then just install the kernel again, no need to unzip, change the updater-script and then zip again.

Thanks! The thing is I am already on d-f2fs on Stock ROM, so I already have the drivers etc available, and since I don't use a custom ROM I also don't have problems woth stock...another thing, could sb give me a link to KOT49H only with root as update.zip?

Sent using my nexus⁴ running Mahdi 2.5 with Xposed, XThemes and hells-Core B46 KK t4
 

alexche77

Senior Member
Nov 16, 2012
119
13
Managua
F2FS Support

Hi guys, im here to inform that i have issues with es file explorer, it seems to be that it doesnt move my files, either cyanogen mod explorer
 

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Back story:
    I bought a Moto X during the $100 off promotion and while I was waiting for it to be delivered, I read reviews and poked around online for interesting things about the phone. As an 8GB Nexus 7 owner, the one thing that caught my eye the most was this section of the Anandtech review discussing internal storage performance. Considering how badly my N7's storage performance degraded and how unbearably slow it has become, I felt like it could make good use of this "flash friendly file system." Some Googling revealed that the F2FS driver was developed by Samsung and actually contributed to the official kernel, where it was implemented somewhere around 3.8. I've done some development for an HTC phone in the past, but never for the Nexus 7, so I went and researched the kernel. Because Google's Tegra 3 kernel is based on 3.1, I had to start working on backporting the driver, when I discovered this repository of backports for F2FS. It provides patches for 3.0 and 3.2, but not for 3.1, so I manually applied appropriate changes from each. When I flashed the kernel and booted, it seemed to work, so I went ahead and injected the kernel into the latest TWRP image as well. I also modified the fstab for both the recovery and ROM and compiled Cyanogenmod's f2fs-tools for Android and statically linked them before injecting them into TWRP as well. I then booted into recovery, formatted /data (TWRP knew to use mkfs.f2fs), and booted back into Android. Success, it worked! I've been using my Nexus 7 like this since Friday evening and it's been so much more usable. Not perfectly "like-new" smooth, but it doesn't hang as often or as long.


    I haven't seen anyone actually try this yet so I'm hoping my effort will be able to make a difference for N7 owners fed up with slow performance. Switching to f2fs is as easy as flashing a modified kernel and recovery, then doing a factory reset. Also, any interested developer is more than welcome to use anything I post here.

    Basically, I took the official Tegra 3 kernel and did this:

    KERNEL PATCH

    Then modified the stock ROM's fstab like this:

    FSTAB

    Then I gave TWRP statically-linked f2fs-tools binaries:

    F2FS-TOOLS

    Then I reformatted /data and away it went:

    SzDwaAi.png


    I'm going to reboot into Linux and attach my boot/TWRP images for you guys to test out. Until then, I'd love to have some feedback.
    • What do you think about using f2fs on the Nexus 7?
    • Is it worth it?
    • What kind of impact on performance or battery life do you think this will have?
    • Did I do something seriously wrong with my kernel/fstab?
    • Am I absolutely insane and dangerous to everyone's Nexus 7 tablets and their puppies?

    Image Downloads
    Android File Host | Google Drive

    Instructions:
    WARNING: This process obviously will wipe your data. Make a NANDroid backup beforehand and save it to your computer. While I personally use this, I take no responsibility for damage done to your device.
    1. Flash boot and recovery like usual:
      Code:
      $ fastboot flash boot boot-F2FS.img
      $ fastboot flash recovery openrecovery-twrp-2.6.3.1-grouper-F2FS.img
    2. Format Data in TWRP
    3. Reboot
    4. Done!
    Note that these are for the latest official 4.4.2 build KOT49H.

    Let me know how your performance and battery life change after applying this. Storage performance should noticeably increase and battery life change should be negligible.
    4
    f2fs implementation on the note2 and s3 on all partitions: kernel & recovery and a compatible rom for the s3...perhaps you might get some help from those devs. using it on my s3 and the performance has been great. not entirely sold on benchmarks but on ext4 i was getting 14-15k on antutu. w/ f2fs on the same cpu/gpu speeds, i'm getting 18-19k. HTH

    would really like to see this implementation on our beloved n7

    Using it on all partitions is very trivial and doesn't need any more kernel modifications. I just limited it to /data/ because that's what Motorola did and it seems to work very well for them. I also didn't know whether or not it would cause any problems in the long run.
    3
    f2fs implementation on the note2 and s3 on all partitions: kernel & recovery and a compatible rom for the s3...perhaps you might get some help from those devs. using it on my s3 and the performance has been great. not entirely sold on benchmarks but on ext4 i was getting 14-15k on antutu. w/ f2fs on the same cpu/gpu speeds, i'm getting 18-19k. HTH

    would really like to see this implementation on our beloved n7
    2
    So, to make a rom ALL-f2fs compatible, we just have to change /system and /data partitions format on fstab.grouper from ext4 to f2fs? Off course, on a device with already modified twrp recovery with f2fs tools....
    Would interest me as well...

    Well, there is more to that.
    First, you have to have a kernel with the driver for F2FS compiled in. Next, you need to edit the fstab.grouper and change the format of /system, /cache and /data to F2FS. And then, in some cases, you need to modify the updater-script of the ROM so it won't format /system during the install as EXT4, but rather as F2FS.
    The last thing is the reason I'm still on Data-F2FS instead of ALL-F2FS. I can still update my ROM via CMUpdater and then just install the kernel again, no need to unzip, change the updater-script and then zip again.
    2
    Newest TWRP doesnt need any hack, just add TARGET_USERIMAGES_USE_F2FS := true
    I used your patch on cm11's kernel, working flawlessly, thanks!