FORUMS
Remove All Ads from XDA

[UNOFFICIAL] [07/19] TWRP 3.1.1 with F2FS support

13,724 posts
Thanks Meter: 50,747
 
By nathanchance, Recognized Developer / Recognized Contributor on 23rd January 2017, 07:02 AM
Post Reply Email Thread
Introduction

Hello all, this is my version of TWRP for the Nexus 6P, which includes the ability to convert your /data and /cache partitions to F2FS. This will stay inline with TWRP's changes for the most part, the changes will be listed below.

What in the world is F2FS?

From Wikipedia:

Quote:

F2FS (Flash-Friendly File System) is a flash file system initially developed by Samsung Electronics for the Linux kernel.

The motive for F2FS was to build a file system that, from the start, takes into account the characteristics of NAND flash memory-based storage devices (such as solid-state disks, eMMC, and SD cards), which are widely used in computer systems ranging from mobile devices to servers.

F2FS was designed on a basis of a log-structured file system approach, which it adapted to newer forms of storage. Jaegeuk Kim, the principal F2FS author, has stated that it remedies some known issues of the older log-structured file systems, such as the snowball effect of wandering trees and high cleaning overhead. In addition, since a NAND-based storage device shows different characteristics according to its internal geometry or flash memory management scheme (such as the Flash Translation Layer or FTL), it supports various parameters not only for configuring on-disk layout, but also for selecting allocation and cleaning algorithms.


Before diving into this, I would recommend reading the official F2FS documentation to understand why this may be good for you. This is potentially unstable, F2FS is a file system that is very much in active development. There is a reason that most OEMs go with ext4 out of the box. But I digress, I am NOT here to sell you on F2FS; it makes zero difference to me if you use it or not, I am merely providing you with a tool to do so.


Changelog + differences

Differences:
  • f2fs-tools bumped to 1.7.0 (Omni's 6.0 branch is on 1.4.0)
  • TWRP app installation offer disabled by default


Conversion procedure
  1. Download TWRP from the link above
  2. Grab a kernel that supports F2FS (I use my own as I know it works)
  3. Back up any important data as this will wipe your entire internal storage
  4. Boot into the bootloader and flash the recovery
  5. Boot into TWRP and go into Wipe > Advanced Wipe
  6. Select Data and then hit "Change or Repair File System"
  7. Hit Change File System
  8. Choose F2FS and slide to confirm
  9. Repeat the previous three steps for cache
  10. Reboot and move all of your files back over (if restoring through TWRP, make sure to check the option to use rm -rf instead of formatting)
If you have any issues with this, you may need to ask your ROM developer to merge the two commits below.

Bug reports

You are NOT in ANY circumstance to report ANY bugs to the TWRP team.
  • If you have an issue with flashing something in TWRP, copy the recovery log to your sdcard and post it here.
  • If swapping to F2FS does not stick, try formatting your data with TWRP (Wipe > Format Data) or fastboot format userdata first.
  • If your phone does not boot after swapping to F2FS, either your kernel or ROM does not have proper support; post in their thread.
Additionally, check out some of these helpful posts:

Adding support to ROM

In order to properly support the initial conversion to F2FS, please add these two commits to your source:
https://github.com/omnirom/android_s...a23fa9178c7ca7
https://github.com/omnirom/android_s...1d47ceac3a325e

The reason some people have issues converting is fs_mgr will try to read the block device as ext4 and destroy the f2fs block. This commit skips that check, allowing F2FS to pass through.

Sources

TWRP is licensed under GPLv3, meaning my changes must be disclosed. I also inline a custom kernel so that source is included as well. I also add in the other repos I modify.
The Following 69 Users Say Thank You to nathanchance For This Useful Post: [ View ]
 
 
23rd January 2017, 07:34 AM |#2  
NoobInToto's Avatar
Senior Member
Flag Coimbatore
Thanks Meter: 243
 
More
First! :P
Thanks for the recovery. Been using it with flash kernel. I see considerable performance improvement in asphalt Xtreme game( idk if its the f2fs or kernel ).
The Following User Says Thank You to NoobInToto For This Useful Post: [ View ] Gift NoobInToto Ad-Free
23rd January 2017, 07:59 AM |#3  
ps000000's Avatar
Senior Member
Flag Nonthaburi / Bangkok
Thanks Meter: 326
 
More
Nice !!!
The Following User Says Thank You to ps000000 For This Useful Post: [ View ] Gift ps000000 Ad-Free
23rd January 2017, 08:39 AM |#4  
Member
Thanks Meter: 24
 
More
Thank you, and thank you for the exemplary GPL compliance. It's noticed and appreciated.
23rd January 2017, 09:33 AM |#5  
Senior Member
Flag Pune
Thanks Meter: 168
 
More
Now this is awesome... On it, will report soon
23rd January 2017, 09:51 AM |#6  
tikizondo94's Avatar
Senior Member
Flag Morgantown
Thanks Meter: 92
 
More
Much appreciated!

Sent from my Nexus 6P using Tapatalk
23rd January 2017, 11:39 AM |#7  
ariefabuzaky's Avatar
Senior Member
Thanks Meter: 424
 
More
So what rom is compatible with f2fs ?
Lineage : yes
RR : yes
UberRom : of course
pN : idk
DU : idk
Nitrogen : yes
Somebody must report it and i will update my post.
ThNks
The Following 2 Users Say Thank You to ariefabuzaky For This Useful Post: [ View ] Gift ariefabuzaky Ad-Free
23rd January 2017, 11:54 AM |#8  
Senior Member
Flag Amsterdam
Thanks Meter: 116
 
More
Quote:
Originally Posted by ariefabuzaky

So what rom is compatible with f2fs ?
Lineage : yes
RR : yes
UberRom : of course
pN : idk
DU : idk
Somebody must report it and i will update my post.
ThNks

Nitrogen should also work but i am doing something wrong... PN should only work with data to f2fs... i am trying different ways right now.

I restored everything to ext4 but i get bootloops now with everyrom... reboots constand... damnit

restored my twrp to latest 3.0.3 but i still get bootlooping... whay did i wrong :S Going back to complete stock latest google image... can anoyone tell me what i did wrong here?!

Restoring factory worked... back on 3.0.3 twrp and with PN rom installed. I will wait a couple of days on how to get it working properly on PN :P
Iceburn1
23rd January 2017, 01:10 PM |#9  
Guest
Thanks Meter: 0
 
More
Worked perfect! Thanks Flash!!!
23rd January 2017, 02:09 PM |#10  
bsg411's Avatar
Senior Member
Thanks Meter: 285
 
More
I tried this with PN and am now stuck in a boot loop. I flashed the twrp with F2FS support then tried to change the file system followed by installing the latest vendor, latest flashable bootloader+radio, latest pure nexus and gapps, flash kernel, and latest su. Didnt work. Im not stuck in a boot loop I cant get out of. Ive tried every combination of the above. I also tried restoring my backup but that gives me an error. I also tried changing the file system back to ext4. Nothing works. Anyone experience this or have any suggestions?

---------- Post added at 09:09 AM ---------- Previous post was at 08:58 AM ----------

Quote:
Originally Posted by jochem86

Nitrogen should also work but i am doing something wrong... PN should only work with data to f2fs... i am trying different ways right now.

I restored everything to ext4 but i get bootloops now with everyrom... reboots constand... damnit

restored my twrp to latest 3.0.3 but i still get bootlooping... whay did i wrong :S Going back to complete stock latest google image... can anoyone tell me what i did wrong here?!

Restoring factory worked... back on 3.0.3 twrp and with PN rom installed. I will wait a couple of days on how to get it working properly on PN :P

Im in the same boat.....what steps did you do to get back to stock?
23rd January 2017, 02:30 PM |#11  
vnphantom's Avatar
Senior Member
Flag Washington DC
Thanks Meter: 57
 
More
Data keeps reverting back to ext4 after 1st boot.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes