[Nexus 6  General] TheArkive:
BE WARNED - THIS WILL ERASE EVERYTHING ON YOUR PHONE. DO NOT ATTEMPT THIS IF YOU HAVE NOT MADE A BACKUP AND/OR ARE NOT READY TO REINSTALL EVERYTHING ON YOUR PHONE FROM SCRATCH.

Credit goes to bbedward for his initial thread regarding this concept.

STATUS:

2017/01/08 - Not liking the performance of my Galaxy S3, so I've ordered a new phone (Huawei P8 Lite) for $58 from eBay! Supposedly brand new. I figured I'd have to give it a try just to see. Once I set this phone up I'll start tinkering with my Nexus 6 again. Phone should arrive around 17 Jan!

FOCUS:

Getting F2FS on ANY ROM, but for my purposes, I'm focused on getting F2FS with Flash Kernel to work on Nitrogen OS (if this can be done, then it can be done with any ROM!)

BASICS:

- Need recovery & kernel that support f2fs (tools + kernel driver version must match or be compatible - not sure what the specifics are yet)

Latest New Info:

- The Flash has said that his kernel and crDroid work with F2FS (I haven't tested it myself yet - this version of crDroid actually specifies F2FS support)

2017/01/08

- Found this thread by NABENDU1. It's for Nexus 4, but it gives some good insight on how F2FS works.

- [MENTION=2787279]vprasad1[/MENTION] found another working combination (post #15) - franco.Kernel - r60 Anykernel 7.1.1 with Danvdh's Stock Lite N6F26Q 7.1.1

Explaining a few details:

The issue here is that the exact version of F2FS tools included in most modded recoveries isn't actually specified (that I have found) and the version of tools that end up in the ROM (/system/bin/), which come from the recovery unless built into the ROM, must be compatible. One of the following is true (not sure which one yet):

- the F2FS tools version must be the same or greater than the kernel driver support version

- the F2FS tools version must be the same or less than the kernel driver support version

- the F2FS tools version must match the kernel driver support version

Given that The Flash is consistently including the latest F2FS support in his kernel, and since I've had the most trouble getting F2FS support to work with his kernel and other ROMs that technically don't support F2FS (using bbedward's method mentioned above - link to thread included) I'm inclined to think that the F2FS tools must be the same or greater version compared to the kernel driver support, though I have no way of confirming this yet. Hopefully I'll have different luck with Flash Kernel v1.7!

========

I used:

-

Nexus Root Toolkit v2.1.9

-

Nitrogen OS 2016-11-19

-

MagiKernel v1.1 Stable-1023

-

TWRP 3.0.2-0

(modded by

xanaxdroid

- thread is

here

)

(TWRP v3.0.2-0 by xanaxdroid mirror) - the original link is down.

I'll take these down if xanaxdroid asks. I have yet to hear from him...

Steps for clean install (and initial install of F2FS recovery / conversion to F2FS):

1) revert to stock (Nexus Root Toolkit)

2) flash recovery with f2fs support (Nexus Root Toolkit)

3) boot into recovery on device

4) full wipe device (normal wipe)

5) convert /cache & /data to f2fs

6) copy over desired kernel and rom to /sdcard

7) install rom & then kernel

8) run adb commands:

# adb shell

# mount -o rw /system

# cp /sbin/fsck.f2fs /system/bin/

# cp /sbin/mkfs.f2fs /system/bin/

# chmod a+x /system/bin/*f2fs*

9) reboot

========

When changing ROMs/kernel (F2FS recovery already installed):

1) boot into recovery

2) do full wipe (f2fs should have stayed from the first time)

3) install rom & then kernel

4) run adb commands:

# adb shell

# mount -o rw /system

# cp /sbin/fsck.f2fs /system/bin/

# cp /sbin/mkfs.f2fs /system/bin/

# chmod a+x /system/bin/*f2fs*

5) reboot

========

More semi-lengthy explanation about fstab:

bbedward suggests a difference in the fstab as being the primary suspect causing the difference in compatibility. Here's the only difference I could find that seemed to be relevant:

- the fstab that worked (MagiKernel + TWRP v3.0.2-0 (by xanaxdroid) + Nitro OS)

/devices/*/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto

- the fstab that didn't work (Flash Kernel + TWRP v3.0.2-0 (by xanaxdroid) + Nitro OS)

*block/sda* auto auto defaults voldmanaged=usbdisk:auto,noemulatedsd

Both fstab files did clearly have the lines needed to mount /data and /cache as f2fs, but they were identical.

NOTE: I also tried TWRP v3.0.0-0 (by xanaxdroid) with Flash Kernel and still no dice. I'm a fan of Flash Kernel since it's my first custom kernel I've played with. I hope to be able to use it some day with Nitrogen OS! Until then, thanks MagiKernel! (maybe I'll convert??? :D :confused: ) <- MagiKernel development has halted for now

========

What I've tried before:

All of the following implies that I've used the previously mentioned adb commands to copy over the f2fs tools and set the proper permissions.

In my experience, it seems that f2fs requires just the right combination of kernel + recovery. For example I used Nitrogen OS (2016-11-19) + Flash Kernel + mod TWRP 3.0.2-0 and it hasn't worked for me, but Nitrogen OS + MagiKernel + mod TWRP v3.0.2-0 did work. The failure for f2fs to work with Nitro OS + Flash Kernel is very reproducible, as is the success with Nitro OS + MagiKernel. (Again using TWRP v3.0.2-0 modded by xanaxdroid).

Keep in mind that the developer of

Flash Kernel

(developed by

The Flash

) has tested his kernel with crDroid (a CyanogenMod base ROM) and it worked for him, but I don't know what version of modded TWRP he was using and what version of f2fs tools were in that recovery. From what I've noticed, there seems to be a fundamental difference with CyanogenMod based ROMs when it comes to f2fs support, either that or there's just a version mismatch of f2fs tools between certain recovery + kernel combos. I don't know enough to understand the difference yet, but it is clear that just because a kernel claims to support f2fs doesn't mean that it will work with any ROM, even if you follow bbedward's tutorial mentioned at the top of this post.

The kernel and the recovery must work together (as in what version of mkfs.f2fs / fsck.f2fs supported by kernel & recovery must match (i think - thanks to bbedward again for this info)). The main issue here is that most modded recovery zips/imgs (that I have found) don't list the version of f2fs tools they have. On the other hand usually you can see this info on the main page of any given kernel developer.

I haven't found any specific rhyme or reason yet, but for those looking for Nitrogen OS (2016-11-19 - Android 7.1 - Nougat) + f2fs, this will help you.

NOTE: I'm a clean-freak, so I enjoy clean flashes, so my instructions are geared toward clean flashes, not dirty flashes. Having said that, doing this with a dirty flash is possible, but it will depend on the ROM/kernel you choose as to the details in how you upgrade/switch the ROM/kernel. Done properly, you should only have to switch file systems once and forego any future wiping of your /sdcard or internal storage.

========

NOTE : You'll know your recovery + kernel combo isn't working right when it takes longer than usual to get off the bootloader screen and start with your ROM's animation boot screen. If it's taking too long, you're probably having everything converted back to ext4.

*** WARNING *** WARNING *** WARNING *** WARNING ***

DO NOT INTERRUPT THIS PROCESS DURING BOOT. If you do then you'll render your /data partition inaccessible. It's still fixable with Nexus Root Toolkit > revert to stock, but that's a pain and it takes a while.

This OP will be updated as new info is uncovered!