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?
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
- f2fs-tools bumped to 1.7.0 (Omni's 6.0 branch is on 1.4.0)
- TWRP app installation offer disabled by default
- Download TWRP from the link above
- Grab a kernel that supports F2FS (I use my own as I know it works)
- Back up any important data as this will wipe your entire internal storage
- Boot into the bootloader and flash the recovery
- Boot into TWRP and go into Wipe > Advanced Wipe
- Select Data and then hit "Change or Repair File System"
- Hit Change File System
- Choose F2FS and slide to confirm
- Repeat the previous three steps for cache
- 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)
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.
Adding support to ROM
In order to properly support the initial conversion to F2FS, please add these two commits to your source:
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.
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.