[RECOVERY][ROMs] Recovery and Rom for All-F2FS 08/06/14

Search This thread

legolas93

Senior Member
Jul 13, 2010
644
1,267
Recovery and Rom for All-F2FS

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.

What is All-F2FS?

We used F2FS only for /data. It was simply because we have only to flash a compatible Kernel and Format /data partition. With All-F2FS we use F2FS for all partitions and we need a compatible ROM


Instructions:

Compatible ROM:

(All credits to authors. I have only made them compatible with F2FS)

  • Download compatible ROM
  • Download FormatPartitions.zip
  • Download "special" TWRP for All-F2FS: openrecovery-twrp-2.7.1.0-mako-All-F2FS.img
    (This is different for that of simply F2FS)
  • Copy FormatPartitions.zip and ROM on Phone
  • Flash "special" TWRP with Fastboot
  • Flash FormatPartitions.zip with new Recovery
  • Reboot Recovery
  • Flash ROM with new Recovery
  • (Flash GApps with new Recovery)
  • Go to Wipe Menu and press Format Data (The Big BUTTON!) (You will LOSE all your Data! Music, Movies etc!!)
  • Reboot

(Recovery has a RED back button to remember you that you are using the F2FS recovery!)

If you get something like "Unable to mount '/cache'", Flash FormatPartitions.zip and reboot recovery.

Enjoy :)

Phone is snappy and smooth with All-F2FS.

2db12xy.png



To go back:
- Flash a "normal" recovery
- Format Data
- Reboot Recovery
- Flash RestorePartitions.zip (Untested)
- Reboot Recovery
- Flash your previous ROM

(Required commit)
 
Last edited:

Medel-Silver

Senior Member
Aug 15, 2010
259
99
Why you say Download "special" TWRP for All-F2FS if this is the same recovery you post in only data F2FS?
 

PatrickMac

Senior Member
May 12, 2012
665
218
Why you don´t look at the download from the 2 posts before talk!?

Open both and you will see the same link = The same recovery

the important part is the formatpartitions.zip, as this formats the /cache and /system partition to f2fs. the recovery formats the /data partition to f2fs as far as I know
 

halfbytecode

Senior Member
Apr 11, 2012
510
209
@legolas93 The required commit is kernel stuff from bricked nexus 5 kernel, if I understand correctly.

Any particular commits for adding F2FS support to a ROM?

Sent from my Nexus 4 using Tapatalk
 

jolinnard

Senior Member
Sep 3, 2009
1,183
1,609
Thank you @legolas93. Slimkat works sweet. Definitely something in my kernel mods or Rastakat aren't well configured for f2fs. I will stay in your build for a while.
 

andr4e

Senior Member
Apr 27, 2012
134
84
RestorePartitions.zip
not work, "normal" recovery can't mount sdcard
 

ph37rd

Senior Member
Oct 6, 2012
1,072
634
59
No Root

If I do not have root access, is it just a matter of reflashing the ROM?
EDIT:
have to enable it in developer options.
 
Last edited:
  • Like
Reactions: qu3becker

slickw

Senior Member
Jun 4, 2013
198
91
can anyone make compatible matirix kernel ?
thats the only thing stoping from trying this
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    Recovery and Rom for All-F2FS

    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.

    What is All-F2FS?

    We used F2FS only for /data. It was simply because we have only to flash a compatible Kernel and Format /data partition. With All-F2FS we use F2FS for all partitions and we need a compatible ROM


    Instructions:

    Compatible ROM:

    (All credits to authors. I have only made them compatible with F2FS)

    • Download compatible ROM
    • Download FormatPartitions.zip
    • Download "special" TWRP for All-F2FS: openrecovery-twrp-2.7.1.0-mako-All-F2FS.img
      (This is different for that of simply F2FS)
    • Copy FormatPartitions.zip and ROM on Phone
    • Flash "special" TWRP with Fastboot
    • Flash FormatPartitions.zip with new Recovery
    • Reboot Recovery
    • Flash ROM with new Recovery
    • (Flash GApps with new Recovery)
    • Go to Wipe Menu and press Format Data (The Big BUTTON!) (You will LOSE all your Data! Music, Movies etc!!)
    • Reboot

    (Recovery has a RED back button to remember you that you are using the F2FS recovery!)

    If you get something like "Unable to mount '/cache'", Flash FormatPartitions.zip and reboot recovery.

    Enjoy :)

    Phone is snappy and smooth with All-F2FS.

    2db12xy.png



    To go back:
    - Flash a "normal" recovery
    - Format Data
    - Reboot Recovery
    - Flash RestorePartitions.zip (Untested)
    - Reboot Recovery
    - Flash your previous ROM

    (Required commit)
    23
    Guys, I will write an analytical post flashing F2FS ROMs, other than the one provided in the OP(CM11 version is at the end of the post):


    This works for most AOSP-based ROMs(ParanoidAndroid, PSX, Velocity etc have worked for me so far)


    1) Download the Modified Recovery PROVIDED IN THE OP

    2) Download the FormatPartitions.zip PROVIDED IN THE OP

    3) If your ROM is AOSP-based then download the SlimKat ROM PROVIDED IN THE OP (We need its boot.img file).

    4) Download your favourite ROM(be it ParanoidAndroid, Velocity, PSX etc)

    5) Open your favourite ROM with WinRar/whatever you use and navigate to META-INF\com\google\android\updater-script

    6) Open updater-script with Notepad/whatever you use and replace these 2 lines(RESPECTIVELY):

    Code:
    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");

    TO

    Code:
    run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
    run_program("/sbin/busybox", "mount", "/system");


    Note: Notepad on Windows has a replace functionality. It's on Edit---->Replace. So you can paste the stock code and the one you want it to be replaced with. :)

    7) Now replace the boot.img inside your FAVOURITE ROM(you can find it when you open the ROM .zip file) with either the one in the MODIFIED SLIMKAT PROVIDED IN THE OP(if it's AOSP-based) or the other one( @WiwiPouPou's one) if it's CM11.

    8) Copy FormatPartition.zip which you downloaded to your Phone

    9) Reboot to fastboot mode and flash the MODIFIED RECOVERY which you downloaded. The code to do so is:

    Code:
    fastboot flash recovery the_name_of_the_modified_recovery.img

    10) Reboot to Recovery

    11) Flash FormatPartitions.zip with new Recovery

    12) Reboot recovery

    13) Flash your FAVOURITE ROM(which you modified some minutes ago)

    14) Flash your favourite Gapps(I installed @BaNkS's Gapps)

    15) I don't recommend flashing a custom kernel NOW, because when I did, the WiFi wasn't working. You can flash a kernel later.

    16) Go to Wipe Menu and press Format Data (The Big BUTTON!) (You will LOSE all your Data! Music, Pictures, Movies etc!!)

    17) Reboot to Android

    18) You can now reboot to Recovery and flash your custom Kernel. Be careful though because you need a kernel that supports F2FS. I recommend ak's xGenesis kernel. It works like a charm without any problems.


    I followed these steps for converting ParanoidAndroid to F2FS and it worked like a charm. :)




    CM11 time

    F2FS-based TWRP 2.7.1.0 won't change the partitions to f2fs for me. So you have to do the following:

    IGNORE 1, 2 & 3 IF YOUR PARTITIONS ARE ALL-F2FS.

    1)Go into recovery

    2)type:
    Code:
    adb shell
    mkfs.f2fs /dev/block/mmcblk0p21 (System)
    mkfs.f2fs /dev/block/mmcblk0p22 (Cache)
    mkfs.f2fs /dev/block/mmcblk0p23 (Data) (Be careful this will delete everything you have)

    3) Via using adb push, push the CM11 file, gapps etc into /sdcard. To do that simply type:
    Code:
    adb push asdf.zip /sdcard (NOTE: the asdf.zip must be in the same folder that adb.exe is)

    4)Wipe /system, /data, /cache & dalvik-cache.

    5)Install CM11 etc.

    6)Install @jolinnard 's kernel: http://xdaforums.com/member.php?u=2002216 (NOTE: I used the ak and it worked, I don't know about the other kernels but I believe they should work as well.)

    7)Reboot and have fun with all-f2fs


    Note: if it didn't work, just change the 2 lines in the updater-script. You can clearly see the 2 lines that MIGHT need to be replaced at the top of this post. Have fun!



    NOTE: If you have successfully converted your partitions to F2FS, you don't need to flash FormatPartitions.zip file & Wipe your Data over and over again. Simply wipe /system, /data & /cache and flash the F2FS ROM you just converted like you would do with any other ROM in the past.


    Thanks Nabendu1 for the F2FS code above. Original post of his can be found here: http://www.purespeedx.net/index.php/Thread/269-F2FS-Discussions/?postID=9795#post9795




    Latest F2FS Adreno binaries updated on are here: http://xdaforums.com/nexus-4/general/qualcomm-adreno-gpu-binaries-t2667759




    So as I pray, UNLIMITED ANDROID WORKS.
    10
    Hey guys. I've just published an app that let you convert a Standard ROM to All-F2FS ROM without a computer. Directly on your phone/tablet.

    Convert To F2FS
    https://play.google.com/store/apps/details?id=com.runnerway.converttof2fs

    -lSpP8Rh6vRVew5L72u3ZEh7Vf4d6VDx2kul2ueIhfihJ2Cw0gyDbYiMHVnRI7A9X6A=h900-rw


    So you can convert yourself every ROM you want without troubles.
    Now it's easy to stay up to date with the ROM you like.

    Tested with:
    - SlimROM
    - Cyanogenmod
    Should work with other ROMs too.

    It cost very little, like a coffe.
    I think it's usefull and it's a good way to support my work.
    Thank you. :D
    8
    Yes, I flashed a F2FS kernel. In fact, I am using that kernel with the F2FS version of SlimKat posted in the OP, so I couldn't figure why the newest SlimKat version doesn't work even after modifying those 2 lines in the updater script.

    Ok, lets do a recap please.

    1. We have 3 partition that can be formatted into f2fs: /system (where ROM lives), /data (or userdata, emulated sdcard etc) and /cache
    2. f2fs is not included in stock kernel, so we need a custom kernel patched with f2fs
    3. We need to setup the correct fstab (the filesystem table). This table is inside boot.img (the kernel partition) and it has to fit exactly. What I meant is if you want to have all partitions in f2fs, or only one or two...
    Because of that, many users start to change only /data partition, so in this situation you can use every ROM you want (because all ROMs format /system into ext4 filesystem), but you have to flash a f2fs enabled kernel and set /data into f2fs in fstab. Same if you want /cache too.
    But if you want /system in f2fs, you need to check updater-script into ROM zip. Because, like I said, most of the ROMs specifically format into ext4. This can be changed easily modifying these lines:
    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");

    to:
    run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
    run_program("/sbin/busybox", "mount", "/system");


    The kernel part is the other important part. We need the perfect partition table, so this is what my selectable script does: simply renaming the zip, it setup the correct entry in fstab according the partition you want to mount as f2fs. A couple examples with HellsDoctor selectable:
    - You format /data and /cache in f2fs, you can flash the ROM you want (/system will remain in ext4, stock). Then you download my selectable zip: HellsDoctor_R29-F2FS-selectable.zip, you rename it in HellsDoctor_R29-F2FS-data-cache.zip and you are done. Flash zips in the typical order: ROM + GAPPS + (renamed)kernel.
    - You only want system into f2fs. Well, you don't have to format anything from recovery, because ROM does it every time. So you need to change updater-script of your favorite ROM or you can use Slimkat posted in the OP, or another one that has these 2 lines in f2fs. Rename HellsDoctor_R29-F2FS-selectable.zip into HellsDoctor_R29-F2FS-system.zip and flash as always: ROM + GAPPS + (renamed)kernel
    - And so on...

    It's a bit complicated for me to explain this easily in English ... but I'm trying to. Thanks for your patience ;)
    6
    New selectable zip

    Hi!

    After code a little bit, I make a zip that is "selectable". Is not as advanced as "aroma" but it should work and it will be easy to understand:

    - Download the zip: HellsDoctor R29 for the moment
    - Rename with desired partitions to mount as f2fs. For instance if you want all f2fs:
    HellsDoctor_R29-F2FS-selectable.zip --> HellsDoctor_R29-F2FS-data-cache-system.zip

    or if you want only /data:
    HellsDoctor_R29-F2FS-data.zip

    or data and cache:
    HellsDoctor_R29-F2FS-data-cache.zip

    The order as well as punctuation are not important (don't use spaces btw). But remember to write the correct words, only these 3 are accepted:
    • system
    • data
    • cache

    Basically all the job consist to generate a fstab during the flash process by this script kernel/smart-fstab-generator.sh. Feel free to adopt it if you desire.

    Greetings