[RECOVERY][All-F2FS] TWRP-2.7.0.0 with All-F2FS support [10/05/14]

Search This thread

legolas93

Senior Member
Jul 13, 2010
644
1,267
TWRP-2.7.0.0 with "All-F2FS" support

NOTE: I don't have a Nexus 5 to test this. It should work.
Please report back.​

I have modified the standard TWRP recovery to work with F2FS partitions.
This is for "All-F2FS" that mean that /system, /cache and /data are formatted with F2FS.
Keep in mind that this can work only with a compatible kernel and ROM.

What is F2FS?

F2FS (Flash-Friendly File System) is a flash file system created by Kim Jaegeuk at Samsung for the Linux operating system 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.

Download:
  • FormatPartitions.zip: Here (It is named mako but work on N5 too)
  • TWRP-recovery img: Here

Chagelogs:

- 10/05/14: Fix TWRP
- 08/05/14: Initial release

Here are some explanations. Read them

Recovery has the usual red back key to remember you that you are using a F2FS-recovery.
If wiping /system and /cache and making a factory reset from Wipe menu doesn't work, use FormatPartitions.zip. (<- READ THIS)
Instead wiping /data is fine within the wipe menu.

To switch your /system, /cache and /data partitions to F2FS follow instructions:
Keep in mind that you will lose all the files on the memory of your N5.

You need:
- Two files you can download above (img and FormatPartitions.zip)
- A ROM with "All-F2FS" support
(One way to make your ROM is with Convert To F2FS)
- GApps (i think you want PlayStore.) Usual GApps. Slim AiO work well.

  • Copy a ROM with "All-F2FS" support to your N5
  • Copy GApps to your N5
  • Copy FormatPartitions.zip to your N5
  • Reboot in bootloader
  • Flash this recovery with Fastboot (Maybe Flashify works too)
  • Reboot in new recovery
  • Flash FormatPartitions.zip
  • Reboot recovery (It's needed for some reasons..)
  • Flash ROM
  • Flash GApps
  • Go to Wipe Menu and Format Data (Not a simple wipe)
  • Reboot
  • Done.

It's easier than it seems :)



To restore partitions to stock:


- Download a standard TWRP
- Download RestorePartitions.zip (It is named mako but work on N5 too)


Enjoy. :D


Thanks for:
- dennes544 (All-F2FS Recovery is based on his Recovery)


(Required Commit)
(Source Here)
 
Last edited:

RoyJ

Senior Member
Apr 23, 2012
4,021
2,553
Looks interesting. I'll give it a shot this weekend. Thanks for this!
 

ilia1985

Senior Member
Oct 14, 2010
740
785
Al Ain
ASUS ROG Phone 5
Google Pixel 6
Hi... First of all thank you been waiting for this mod :)

I have followed all the steps but no luck... Even got new convert to f2fs app and converted a rom but it fails to flash giving error with updater script.. And normal Roms kill recovery and have to restock :(
 

legolas93

Senior Member
Jul 13, 2010
644
1,267
Hi... First of all thank you been waiting for this mod :)

I have followed all the steps but no luck... Even got new convert to f2fs app and converted a rom but it fails to flash giving error with updater script.. And normal Roms kill recovery and have to restock :(

As stated i don't have the Nexus 5. But i think that if you give me the recovery.log after the failed flash i can solve the problem. :D
If you have some time can you retry and after the failed flash go to Advanced -> Recovery log. And then send it to me? Thank you.
 

RoyJ

Senior Member
Apr 23, 2012
4,021
2,553
@legolas93 can this be done without the play store app? I can't afford to buy it, but I am comfortable grabbing recovery logs. I just haven't messed with this F2FS stuff yet. Not sure what ROMs, if any, are F2FS compatible already.
 

kdh2834

Senior Member
Jul 12, 2012
217
149
Pune
@legolas93 can this be done without the play store app? I can't afford to buy it, but I am comfortable grabbing recovery logs. I just haven't messed with this F2FS stuff yet. Not sure what ROMs, if any, are F2FS compatible already.

There r no Roms which r f2fs-all compatible yet. But u can edit them urself to make them compatible.

Without the playstore app also its simple u just hv to change the updater-script of the rom in the META-INF folder


find for lines as below:
HTML:
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

and replace them with this:
HTML:
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
run_program("/sbin/busybox", "mount", "/system");

and sometimes u can see this line isolated
HTML:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

so do the same thing and change it to this
HTML:
run_program("/sbin/busybox", "mount", "/system");

and u need f2fs-all compatible kernels aswell..
 

micr0g

Senior Member
Sep 6, 2013
552
236
Sony Xperia 1 III
There r no Roms which r f2fs-all compatible yet. But u can edit them urself to make them compatible.

Without the playstore app also its simple u just hv to change the updater-script of the rom in the META-INF folder


find for lines as below:
HTML:
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

and replace them with this:
HTML:
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
run_program("/sbin/busybox", "mount", "/system");

and sometimes u can see this line isolated
HTML:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

so do the same thing and change it to this
HTML:
run_program("/sbin/busybox", "mount", "/system");

and u need f2fs-all compatible kernels aswell..

Hello i tried yesterday and today with this trick, from mako thread, but with no success
Everytime i get a failed on twrp
 

kdh2834

Senior Member
Jul 12, 2012
217
149
Pune
Hello i tried yesterday and today with this trick, from mako thread, but with no success
Everytime i get a failed on twrp

I think it only works with NON-CAF ROMS (AOSP)
so.. if u tried it with a CAF ROM it might give errors... but not in twrp for sure..
see if u did the zip properly..
 

micr0g

Senior Member
Sep 6, 2013
552
236
Sony Xperia 1 III
I think it only works with NON-CAF ROMS (AOSP)
so.. if u tried it with a CAF ROM it might give errors... but not in twrp for sure..
see if u did the zip properly..

I tried with Slimkat,so AOSP

replaced
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
with
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");

and

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
with
run_program("/sbin/busybox", "mount", "/system");
 
  • Like
Reactions: micky387

legolas93

Senior Member
Jul 13, 2010
644
1,267
I tried with Slimkat,so AOSP

replaced
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
with
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");

and

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
with
run_program("/sbin/busybox", "mount", "/system");

Have you flashed the recovery i posted in OP? Can i have a recovery.log of the failed flash?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    TWRP-2.7.0.0 with "All-F2FS" support

    NOTE: I don't have a Nexus 5 to test this. It should work.
    Please report back.​

    I have modified the standard TWRP recovery to work with F2FS partitions.
    This is for "All-F2FS" that mean that /system, /cache and /data are formatted with F2FS.
    Keep in mind that this can work only with a compatible kernel and ROM.

    What is F2FS?

    F2FS (Flash-Friendly File System) is a flash file system created by Kim Jaegeuk at Samsung for the Linux operating system 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.

    Download:
    • FormatPartitions.zip: Here (It is named mako but work on N5 too)
    • TWRP-recovery img: Here

    Chagelogs:

    - 10/05/14: Fix TWRP
    - 08/05/14: Initial release

    Here are some explanations. Read them

    Recovery has the usual red back key to remember you that you are using a F2FS-recovery.
    If wiping /system and /cache and making a factory reset from Wipe menu doesn't work, use FormatPartitions.zip. (<- READ THIS)
    Instead wiping /data is fine within the wipe menu.

    To switch your /system, /cache and /data partitions to F2FS follow instructions:
    Keep in mind that you will lose all the files on the memory of your N5.

    You need:
    - Two files you can download above (img and FormatPartitions.zip)
    - A ROM with "All-F2FS" support
    (One way to make your ROM is with Convert To F2FS)
    - GApps (i think you want PlayStore.) Usual GApps. Slim AiO work well.

    • Copy a ROM with "All-F2FS" support to your N5
    • Copy GApps to your N5
    • Copy FormatPartitions.zip to your N5
    • Reboot in bootloader
    • Flash this recovery with Fastboot (Maybe Flashify works too)
    • Reboot in new recovery
    • Flash FormatPartitions.zip
    • Reboot recovery (It's needed for some reasons..)
    • Flash ROM
    • Flash GApps
    • Go to Wipe Menu and Format Data (Not a simple wipe)
    • Reboot
    • Done.

    It's easier than it seems :)



    To restore partitions to stock:


    - Download a standard TWRP
    - Download RestorePartitions.zip (It is named mako but work on N5 too)


    Enjoy. :D


    Thanks for:
    - dennes544 (All-F2FS Recovery is based on his Recovery)


    (Required Commit)
    (Source Here)
    6
    @legolas93 can this be done without the play store app? I can't afford to buy it, but I am comfortable grabbing recovery logs. I just haven't messed with this F2FS stuff yet. Not sure what ROMs, if any, are F2FS compatible already.

    There r no Roms which r f2fs-all compatible yet. But u can edit them urself to make them compatible.

    Without the playstore app also its simple u just hv to change the updater-script of the rom in the META-INF folder


    find for lines as below:
    HTML:
    format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
    mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

    and replace them with this:
    HTML:
    run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
    run_program("/sbin/busybox", "mount", "/system");

    and sometimes u can see this line isolated
    HTML:
    mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");

    so do the same thing and change it to this
    HTML:
    run_program("/sbin/busybox", "mount", "/system");

    and u need f2fs-all compatible kernels aswell..
    5
    You guys can modify these scripts for free

    figue/f2fs-scripts · GitHub - http://goo.gl/FOK6LO
    3
    Thanx :) fronco will be awsome

    Sent from my Nexus 5 using XDA Premium 4 mobile app

    I created a thread

    ill be updating whenever there is a new release within a day or two :)
    2
    Hello @legolas93
    Thanks for interesting
    Here is the log

    http://pastebin.com/4p5HP7cc

    With the help of micr0g (Thank you a lot!) we tested the procedure.

    OP updated with working TWRP Recovery for All-F2FS.

    Enjoy :D


    In case of problems report back.