F2FS | Improved I/O Performance on /data

Search This thread

zwliew

Senior Member
Dec 12, 2013
771
2,778
23
Singapore
github.com
For those who don't know what F2FS is, check these links out:
General info
Benchmarks

Warnings
1. Make sure you have a standard kernel for backup that uses ext4 just in case. If anything goes wrong, just install the backup kernel and reboot to recovery.
2. You will have to wipe your /data and /cache partitions for this. Basically factory reset.
3. For 2, you could try to backup data and restore after formatting. I haven't tried this but I could work.

Instructions to format /cache and /data as F2FS:
1. Boot into recovery
2. Install this kernel with F2FS CWM recovery
3. Reboot to recovery again
4. Go to 'Mounts and Storage'
5. Enable "toggle f2fs <-> ext4 migration"
6. Format /data and /cache to F2FS
7. Reboot

And now you have F2FS on /data and /cache :]


To install a new ROM that is not F2FS compatible, edit the updater-script as follows:

1. Replace strings
"mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");"
with string
"run_program("/sbin/busybox", "mount", "/system");"

2. Replace string
"format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");"
with string
"run_program("/sbin/mkfs.f2fs", "/dev/block/mmcblk0p3");"
Note: this string needs this patch in ROM

3. Add string
"run_program("/sbin/busybox", "mount", "/data");"
after strings
"run_program("/sbin/mkfs.f2fs", "/dev/block/mmcblk0p3");"
"run_program("/sbin/busybox", "mount", "/system");"

4. Add string
"unmount("/data");"
before string
unmount("/system");
 
Last edited:

zwliew

Senior Member
Dec 12, 2013
771
2,778
23
Singapore
github.com
  • Like
Reactions: zipperX

AtEExll

Senior Member
May 20, 2014
205
68
Catalonian Pyrenees
For install rom updates, the steps from install this kernel is always format data and cache?

Thanks by advance.
AtEExll

Sent from my GT-I8160 powered by CyanogenMod 11
 

S.AMU

Senior Member
Aug 6, 2013
703
202
Offenburg
when I try to format my cache partition I always get an error, that formatting was not possible.

also now im not able anymore to write on my /system partition. installing zips and restoring backups are always cancelled... sh***
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    For those who don't know what F2FS is, check these links out:
    General info
    Benchmarks

    Warnings
    1. Make sure you have a standard kernel for backup that uses ext4 just in case. If anything goes wrong, just install the backup kernel and reboot to recovery.
    2. You will have to wipe your /data and /cache partitions for this. Basically factory reset.
    3. For 2, you could try to backup data and restore after formatting. I haven't tried this but I could work.

    Instructions to format /cache and /data as F2FS:
    1. Boot into recovery
    2. Install this kernel with F2FS CWM recovery
    3. Reboot to recovery again
    4. Go to 'Mounts and Storage'
    5. Enable "toggle f2fs <-> ext4 migration"
    6. Format /data and /cache to F2FS
    7. Reboot

    And now you have F2FS on /data and /cache :]


    To install a new ROM that is not F2FS compatible, edit the updater-script as follows:

    1. Replace strings
    "mount("ext4", "EMMC", "/dev/block/mmcblk0p3", "/system");"
    with string
    "run_program("/sbin/busybox", "mount", "/system");"

    2. Replace string
    "format("ext4", "EMMC", "/dev/block/mmcblk0p3", "0", "/system");"
    with string
    "run_program("/sbin/mkfs.f2fs", "/dev/block/mmcblk0p3");"
    Note: this string needs this patch in ROM

    3. Add string
    "run_program("/sbin/busybox", "mount", "/data");"
    after strings
    "run_program("/sbin/mkfs.f2fs", "/dev/block/mmcblk0p3");"
    "run_program("/sbin/busybox", "mount", "/system");"

    4. Add string
    "unmount("/data");"
    before string
    unmount("/system");
    3
    @zwliew Only /data for now? How about /system too?

    i'll work on it. probably have it done within a few days :]
    1
    @up
    if you read the links you will understand...

    Seems faster... and using much more the /cache partition...
    1
    what the benefit of this?

    Read the first 2 links, mainly the 2nd one. It delivers better I/O performance than what ext4 has to offer.

    @up
    if you read the links you will understand...

    Seems faster... and using much more the /cache partition...

    It uses more /cache because it is a log-based filesystem
    1
    For install rom updates, the steps from install this kernel is always format data and cache?

    Thanks by advance.
    AtEExll

    Sent from my GT-I8160 powered by CyanogenMod 11

    if you have already formatted to f2fs before, all you have to do is install this kernel again after installing the rom.