[GUIDE]How to convert to F2FS (Flash Friendly File system)

Search This thread

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
For information on what F2FS is see the link here: https://en.wikipedia.org/wiki/F2FS

http://www.xda-developers.com/f2fs-put-to-the-test-against-ext4/


Basically F2FS is a newish file system and was designed by Samsung purely for flash memory devices. It is significantly faster in write speed and therefore yields benefits when used on partitions like DATA and CACHE.
However the SYSTEM partition is read only and therefore would not benefit from F2FS as EXT4 is capable of high speed read. Not only that Ext4 adds benefits of data integrity due to being a journaling file system.
As the system partition is not being touched, any Rom can be used, stock or custom.

This guide will explain how to convert to the F2FS file system.


1. The first step is to convert the DATA and CACHE partition to F2FS.
For this a custom Recovery with F2FS support is required. I have already built modified versions of TWRP which fully support F2FS which can be found here: http://xdaforums.com/galaxy-tab-s/development/twrp-2-8-6-1-unofficial-sm-t800-805-807-t3074633

2. Install then boot to TWRP then make a backup of the DATA partition to your EXTERNAL SD CARD
Next select WIPE > ADVANCED WIPE then select CACHE then REPAIR OR CHANGE SYSTEM > CHANGE FILE SYSTEM > F2FS. Finally SWIPE TO CHANGE.
This will then format to F2FS, do the same for the DATA partition.
PLEASE NOTE THIS WILL COMPLETELY WIPE THE INTERNAL STORAGE, SO BACK UP ANY FILES YOU NEED TO THE PC OR EXTERNAL SD CARD!

3. Once the format is complete reboot TWRP by selecting the 'Recovery' option under the REBOOT tab.

4. Once rebooted to TWRP restore the backup of the DATA partition that was made earlier.
Ignore the warning about the backup being created with Ext4.

5. When that completes reboot to DOWNLOAD mode.

Next load up the relevant kernel below for your particular device in ODIN, put it in the AP slot then hit START.

SM-T805 BOCC KERNEL
SM-T800 BOCC KERNEL (confirmed working by godsfilth)
SM-T700 BOCC KERNEL(needs testing)

If the above kernels don't work because you have updated your rom to a later base you may need the updated kernels below. I have also added ext4 support in case anyone wants to switch back:

SM-T700 BOE6 KERNEL
SM-T705 BOE6 KERNEL
SM-T800 BOE6 KERNEL
SM-T805 BOE6 KERNEL

NOTE: the kernels provided are for Lollipop ONLY and is completely stock built from Samsung Sources except for the F2FS modifications. Also the kernel will allow Permissive mode to be set but is Enforcing by default( I think it should be the users decision and not forced permissive)
To change modes use SELinux mode changer http://xdaforums.com/showthread.php?t=2524485

I wanted this kernel to be as untouched and stable as possible, so as not to introduce any issues. If you wish to have a custom kernel ask your kernel developer to add F2FS support.


6. Once the flashing process is complete with ODIN the tablet should boot. It may take a good while for the tablet to boot as its sets itself up and you will see the normal SAMSUNG logo, so don't worry if you have to wait a while.
Once booted further reboots will boot as normal and infact will probably notice quicker startups. I notice almost 5-10 seconds faster and a quicker tablet overall.
Have tested this thoroughly for days and has been stable with no issues.

IF ANYONE WANTS TO TRY THIS OUT AND THEN RETURN TO EXT4, ITS A SIMPLE MATTER OF FOLLOWING THE SAME PROCEDURE, BUT CHOOSING EXT4 IN TWRP.

Source code

GOOD LUCK AND PLEASE GIVE FEEDBACK.

.
 
Last edited:

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
T800 kernel added. Not tested as I don't have the T800, so can someone confirm it works?
 

godsfilth

Senior Member
Mar 31, 2009
140
13
so it seems the T800 doesn't boot.
after a minute or two logcat starts running but seems to my untrained eye to loop to the same things every few minutes.
i can still force a reboot into recovery so no harm done, if you have any ideas ill test them out, ill try again sometime tomorrow maybe my sleep deprived brain missed something
 
  • Like
Reactions: samwheat

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
so it seems the T800 doesn't boot.
after a minute or two logcat starts running but seems to my untrained eye to loop to the same things every few minutes.
i can still force a reboot into recovery so no harm done, if you have any ideas ill test them out, ill try again sometime tomorrow maybe my sleep deprived brain missed something

How far does it boot and how long did you wait, do you see the second multicoloured Samsung logo?
It does boot on my t805 fine as do all t800 kernels, so seems strange it doesn't on your t800.
I will post another boot.img for you to try.
Can you try booting again then send me the kernel log.
cat /proc/last_kmsg > /sdcard/last_kmsg.txt
 
Last edited:

godsfilth

Senior Member
Mar 31, 2009
140
13
How far does it boot and how long did you wait, do you see the second multicoloured Samsung logo?
It does boot on my t805 fine as do all t800 kernels, so seems strange it doesn't on your t800.
I will post another boot.img for you to try.
Can you try booting again then send me the kernel log.
cat /proc/last_kmsg > /sdcard/last_kmsg.txt

boots to the "samsung galaxy tab s" splash screen then dims a little and stays there left it for 10 minutes while i figured out where adb pull and windows 10 had decided the kmsg file should go as well as while i typed this.
i did see an error in recovery when formatting data as f2fs it said something along the line of "mount -o bind /data/media/sdcar0 error=255" pretty sure it was longer than that ill get the whole message if you want.
kmsg should be attached let me know if you need anything else
 

Attachments

  • last_kmsg.txt
    6.4 KB · Views: 40

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
boots to the "samsung galaxy tab s" splash screen then dims a little and stays there left it for 10 minutes while i figured out where adb pull and windows 10 had decided the kmsg file should go as well as while i typed this.
i did see an error in recovery when formatting data as f2fs it said something along the line of "mount -o bind /data/media/sdcar0 error=255" pretty sure it was longer than that ill get the whole message if you want.
kmsg should be attached let me know if you need anything else

That error message is normal because you've formatted the data partition, it's just a warning it can't mount sdcard/0.

Did you make sure that you formatted both cache and data to f2fs?

Also the kernel log you posted is from recovery not boot. To get the boot kernel log, boot as normal, give it a minute then immediately restart to recovery. Then run the command in the twrp terminal or adb.
 
Last edited:

godsfilth

Senior Member
Mar 31, 2009
140
13
ok so now that the kernel is working and i've played with it for a little while its definitely snappier at startup compared to ext4, noticeably so also apps seem to be a quicker as well ill play around with it some more and see but definitly plan on keeping it f2fs and swapping my girlfriends over as well
 
  • Like
Reactions: TheGoD

TheGoD

Senior Member
Oct 26, 2009
414
54
Any idea if apps like FolderMount that mount internal storage folders (like OBB) to the external card?
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
I would like to tell @ashyx a very enthusiastic THANK YOU for taking the time to put this guide and F2FS kernel together. We need more developers like you man. I'm happy I do not have to give up F2FS just because I got a new device, so thank you for this.

I would like to ask anyone who has not thanked ashyx, to please take the time and hit his thanks button. He deserves it :good:
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
Updated the kernel sources in op.

After flashing the new T700 kernel it does not boot for me. Saw the Samsung logo as usual for about 5 minutes maybe, but then the logo disappeared and then nothing. Seems to have shut down. The power button no longer worked to boot up either. However, it goes into Download Mode just fine.

Going to flash it again. BRB with some news. Thanks

EDIT: Flashed a second time and still the same, ROM will not boot on the BOE6 kernel. Thanks again
 
Last edited:

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
After flashing the new T700 kernel it does not boot for me. Saw the Samsung logo as usual for about 5 minutes maybe, but then the logo disappeared and then nothing. Seems to have shut down. The power button no longer worked to boot up either. However, it goes into Download Mode just fine.

Going to flash it again. BRB with some news. Thanks

EDIT: Flashed a second time and still the same, ROM will not boot on the BOE6 kernel. Thanks again

Which firmware base are you running?
 

SkOrPn

Senior Member
Jun 3, 2007
2,994
948
Albuquerque, NM
www.planetamd64.com
Which firmware base are you running?

I was running CarbonROM 5.1.1.

I can no longer boot system, and it wont boot to recovery either. What is the button combo for recovery again? Maybe I have it wrong.

I thought I had downloaded a zip for stock 5.0.2, but I cant find the darn thing now, lol. I have a TWRP backup of 4.4.2 and 5.0.2 (I think), but I'm on 5.0.2 Bootloader. Plus I need TWRP mode in order to even restore the backups.

is there a ODIN tar of 5.0.2, preferably rooted? I found TWDetox, but its a zip for TWRP to install. Damn it, lol I know for fact I found a tar for 5.0.2 but now I can't find it. I need to find a RedBull maybe that will help me locate it. LOL
 

ashyx

Inactive Recognized Contributor
Oct 14, 2012
15,055
9,947
POWER + VOL DOWN + HOME as soon as it restarts quickly change to VOL UP whilst still holding the other buttons.
 
  • Like
Reactions: SkOrPn

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    For information on what F2FS is see the link here: https://en.wikipedia.org/wiki/F2FS

    http://www.xda-developers.com/f2fs-put-to-the-test-against-ext4/


    Basically F2FS is a newish file system and was designed by Samsung purely for flash memory devices. It is significantly faster in write speed and therefore yields benefits when used on partitions like DATA and CACHE.
    However the SYSTEM partition is read only and therefore would not benefit from F2FS as EXT4 is capable of high speed read. Not only that Ext4 adds benefits of data integrity due to being a journaling file system.
    As the system partition is not being touched, any Rom can be used, stock or custom.

    This guide will explain how to convert to the F2FS file system.


    1. The first step is to convert the DATA and CACHE partition to F2FS.
    For this a custom Recovery with F2FS support is required. I have already built modified versions of TWRP which fully support F2FS which can be found here: http://xdaforums.com/galaxy-tab-s/development/twrp-2-8-6-1-unofficial-sm-t800-805-807-t3074633

    2. Install then boot to TWRP then make a backup of the DATA partition to your EXTERNAL SD CARD
    Next select WIPE > ADVANCED WIPE then select CACHE then REPAIR OR CHANGE SYSTEM > CHANGE FILE SYSTEM > F2FS. Finally SWIPE TO CHANGE.
    This will then format to F2FS, do the same for the DATA partition.
    PLEASE NOTE THIS WILL COMPLETELY WIPE THE INTERNAL STORAGE, SO BACK UP ANY FILES YOU NEED TO THE PC OR EXTERNAL SD CARD!

    3. Once the format is complete reboot TWRP by selecting the 'Recovery' option under the REBOOT tab.

    4. Once rebooted to TWRP restore the backup of the DATA partition that was made earlier.
    Ignore the warning about the backup being created with Ext4.

    5. When that completes reboot to DOWNLOAD mode.

    Next load up the relevant kernel below for your particular device in ODIN, put it in the AP slot then hit START.

    SM-T805 BOCC KERNEL
    SM-T800 BOCC KERNEL (confirmed working by godsfilth)
    SM-T700 BOCC KERNEL(needs testing)

    If the above kernels don't work because you have updated your rom to a later base you may need the updated kernels below. I have also added ext4 support in case anyone wants to switch back:

    SM-T700 BOE6 KERNEL
    SM-T705 BOE6 KERNEL
    SM-T800 BOE6 KERNEL
    SM-T805 BOE6 KERNEL

    NOTE: the kernels provided are for Lollipop ONLY and is completely stock built from Samsung Sources except for the F2FS modifications. Also the kernel will allow Permissive mode to be set but is Enforcing by default( I think it should be the users decision and not forced permissive)
    To change modes use SELinux mode changer http://xdaforums.com/showthread.php?t=2524485

    I wanted this kernel to be as untouched and stable as possible, so as not to introduce any issues. If you wish to have a custom kernel ask your kernel developer to add F2FS support.


    6. Once the flashing process is complete with ODIN the tablet should boot. It may take a good while for the tablet to boot as its sets itself up and you will see the normal SAMSUNG logo, so don't worry if you have to wait a while.
    Once booted further reboots will boot as normal and infact will probably notice quicker startups. I notice almost 5-10 seconds faster and a quicker tablet overall.
    Have tested this thoroughly for days and has been stable with no issues.

    IF ANYONE WANTS TO TRY THIS OUT AND THEN RETURN TO EXT4, ITS A SIMPLE MATTER OF FOLLOWING THE SAME PROCEDURE, BUT CHOOSING EXT4 IN TWRP.

    Source code

    GOOD LUCK AND PLEASE GIVE FEEDBACK.

    .
    3
    I've had my Tab S 10.5 T800 for quite a while now and have been less than pleased with its performance. Stock, Bliss, and down the list, no matter what I've put on it- it seemed something was inherently wrong with the Tab S. It has always been a bit sluggish considering the specs. My Note 3 and Nexus 10 seemed more responsive. I've been rather disappointed until today. I've been running the Slim build and noticed today F2FS was now supported. Flashed it with F2FS and its pretty unbelievable what a difference it has made. I've tried F2FS on other devices and seen little if any noticeable difference until now. No lag, smooth, responsive, and benchmarks are great. Highly suggest trying it and truly encourage further development on this.
    3
    For those that use F2FS and maybe wish to try updated source in custom kernel, you can find it in my SkyHigh TW LL kernel thread.

    @ashyx , you can find the source changes in my github repo. I started sorting and cherry-picking 60+ commits from https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs.git/log/?h=linux-3.4, but discovered arter97 had done the "hard yards" by patching 100's of commits to August for 3.4 :) Thank you @arter97 and open-source !!

    The F2FS update seems to work fine on my T705. Maybe you wish to update the "stock" kernel you have posted?

    I might also please make a small request. I know that your posted kernels have minimal changes from Samsung open-source, but as it is still modified and then compiled, it would be appreciated if you could post your source to comply with GPL legalities and XDA sharing policy. There aren't any exceptions ;) If you need help to set up or further guidance, I would be happy to help or our friendly forum Moderator :)
    3
    I would like to tell @ashyx a very enthusiastic THANK YOU for taking the time to put this guide and F2FS kernel together. We need more developers like you man. I'm happy I do not have to give up F2FS just because I got a new device, so thank you for this.

    I would like to ask anyone who has not thanked ashyx, to please take the time and hit his thanks button. He deserves it :good:
    2
    Much appreciated, thanks for the feedback. :thumbup: