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:
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:
Conversion procedure
Bug reports
You are NOT in ANY circumstance to report ANY bugs to the TWRP team.
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_system_core/commit/1c6700a8fb31c6e314df4f031fa23fa9178c7ca7
https://github.com/omnirom/android_system_vold/commit/c879edb2fecae709f404c2d71c1d47ceac3a325e
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.
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:
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.
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
- 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)
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.
- https://forum.xda-developers.com/showthread.php?p=70699197
- https://forum.xda-developers.com/showthread.php?p=71074016
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_system_core/commit/1c6700a8fb31c6e314df4f031fa23fa9178c7ca7
https://github.com/omnirom/android_system_vold/commit/c879edb2fecae709f404c2d71c1d47ceac3a325e
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.
- Recovery: https://github.com/nathanchance/android_bootable_recovery/tree/android-7.1
- Kernel: https://github.com/nathanchance/angler/tree/7.1.2-flash
- Device tree: https://github.com/nathanchance/twrp_device_huawei_angler/tree/android-6.0
- f2fs-tools: https://github.com/nathanchance/android_external_f2fs-tools/tree/android-6.0
Attachments
Last edited: