[MOD][RECOVERY] All-F2FS for GT-I9190|GT-I9192|GT-I9195 [TWRP 2.8.6.0 & Philz Touch]
Hi!
Here I'll try to explain how to use F2FS partitions on your Galaxy S4 Mini.
This is for "All-F2FS" that mean that /system, /cache, /data and /external SD are formatted with F2FS, keep in mind that this can work only with a compatible kernel and ROM.
About F2FS
F2FS (Flash-Friendly File System) is a flash file system created by Kim Jaegeuk (Hangul: 김재극) 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.
Samsung chose a log-structured file system approach, which it adapted to newer forms of storage. F2FS also remedies some known issues of the older log structured file systems, such as the snowball effect of wandering trees and high cleaning overhead. Because a NAND-based storage device shows different characteristics according to its internal geometry or flash memory management scheme (such as the Flash Translation Layer or FTL), Samsung also added various parameters not only for configuring on-disk layout, but also for selecting allocation and cleaning algorithms.
Warning
* You agree to use this MOD/Guide on you own risk and I don't take any responsability if you encounter any issue or if your personal data is lost
Requirements
Your S4 Mini, GT-I9190 or GT-I9195 or GT-I9192 (serrano3g, serranolte, serranods)
An external MicroSD card or a PC (for backup/restore)
Preinstalling Steps
Backup of your personal data to an external SD card or PC (photo, music, ringtones, etc).
Make a full nandroid (just in case that you want to rollback to EXT4) and copy to your PC.
Download and copy to your External SD Card TWRP or Philz Touch with full F2FS support. (Downloads on Second Post)
Download and copy to your External SD Card latest version of f4ktion kernel or use one with All-F2FS support.
Download and copy to your External SD Card CarbonROM with F2FS support, or you can test on your favorite ROM, take in mind that using F2FS on External SD Cards will require F2FS support on your ROM of minivold for vold managed volumes. (Downloads on Second Post)
How can you test your favorite ROM?
I'll include this time CarbonROM with support for F2FS, on upcoming builds you'll need to edit manually the updater-script.
You need to edit updater-script on the zip file, you need to change the following:
Look for:
Code:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
And change it for:
Code:
run_program("/sbin/busybox", "mount", "/system");
Look for:
Code:
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
And change it for:
Code:
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
Installation Steps (Clean Install)
1) Install your favorite recovery and reboot to recovery.
For TWRP
1.1) Go to Settings and select "Force data and cache wipe functions to use F2FS" and if you want F2FS support on /System partition, select "Include system partition"
1.2) Now go to Wipe menu and select Format Data and type "yes" (Warning this will format Data partition and your Internal Storage, so please don't forget to make a backup of your personal data)
1.3) Optional, select Advanced Wipe menu and check System and Cache partitions to convert to F2FS respectively.
For Philz Touch
1.1) Go to Mounts and Storage and select "toggle f2fs <-> ext4 migration"
1.2) Select format /data and confirm, now select format /data and /data/media (/sd, confirm, choose f2fs option and confirm again.
1.3) Optional, you can select format /system and format /cache to convert to F2FS respectively.
2) Install your ROM as usual, then flash your GApps and f4ktion kernel in this order.
3) Restore your personal data to your internal SD Card.
If you don't want to make a clean install, you can convert /data partition to F2FS using and restoring a /data nandroid backup.
Installation Steps (Restoring /Data partition)
1) Install your favorite recovery and reboot to recovery.
For TWRP
1.1) Make a nandroid of /data partition.
1.2) Go to Settings and select "Force data and cache wipe functions to use F2FS" and if you want F2FS support on /System partition, select "Include system partition"
1.3) Now go to Wipe menu and select Advanced Wipe menu and check Data, swipe to confirm wipe.
1.4) You can restore your /data nandroid now.
1.5) Optional, you can select format /system and format /cache to convert to F2FS respectively and install a new ROM.
For Philz Touch
1.1) Make a custom nandroid of /data partition.
1.2) Go to Mounts and Storage and select "toggle f2fs <-> ext4 migration"
1.3) Select format /data and confirm, now select format /data and /data/media (/sd, confirm, choose f2fs option and confirm again.
1.4) You can restore your /data nandroid now.
1.5) Optional, you can select format /system and format /cache to convert to F2FS respectively and install a new ROM.
How to check if you have correctly formatted partitions to F2FS?
Through terminal do:
Code:
su
mount | grep f2fs
Through adb do:
Code:
adb shell
su
mount | grep f2fs
Also you can check F2FS's status by doing:
Code:
cat /sys/kernel/debug/f2fs/status
Or just install DiskInfo app
Credits
@Dees_Troy for TWRP
@ktoonsez for F2FS mod
@Phil3759 for Philz Touch
TWRP 2.8.1.0 F2FS MOD
GT-I9190
GT-I9192
GT-I9195
Philz Touch F2FS
GT-I9190
GT-I9192
GT-I9195
F4k said:
Look for:
Code:
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
And change it for:
Code:
run_program("/sbin/mkfs.f2fs", "/dev/block/platform/msm_sdcc.1/by-name/system");
Click to expand...
Click to collapse
Do I need to do this part if I want to keep my system partition as Ext4 but wanted my data and cache partition as F2fs?
Thanks in advance
Envoyé de mon unknown en utilisant Tapatalk
Darktitor said:
Do I need to do this part if I want to keep my system partition as Ext4 but wanted my data and cache partition as F2fs?
Thanks in advance
Envoyé de mon unknown en utilisant Tapatalk
Click to expand...
Click to collapse
This step is if you want /system partition as f2fs, you can use f2fs on whatever you want.
If you don't edit updater-script, your /system partition will be formatted as ext4
Just a quick question, is this Carbon in this post the same as the latest build you have just released? Or is this one with an altered updater-script?
Phenom2122 said:
Just a quick question, is this Carbon in this post the same as the latest build you have just released? Or is this one with an altered updater-script?
Click to expand...
Click to collapse
It's the same but with modified updater-script, this version will format /system partition as f2fs, the one on Carbon's thread as ext4.
All formatted f2fs and everything flashed and running smoothly thanks f4k
Sent from my GT-I9195 using XDA Premium 4 mobile app
From now on we should unzip the rom file and change tha script to have f2fs?
Hope random reboots to stop..
Everything fine with clean install.. One bug tha colors in recent calls with tha black theme
Στάλθηκε από το GT-I9195 μου χρησιμοποιώντας Tapatalk
@F4k nice splash screen you have in your twrp recovery, also glad you added the "force wipe to use f2fs option " this way I can use the twrp themes without the need for additional changes to it.
Sent from my GT-I9195 using Tapatalk
Since doing a format of /data and /data/media Philz works correctly the first time with settings in mnt/shell/emulated/0/clockworkmod. After doing a reboot into recovery later, suddenly it has created a mnt/shell/emulated/0/0/clockworkmod and it seems to be randomly reading settings from either location ie. sometimes it will correctly launch Aroma, sometimes it wont. This is a very strange error because I went back to one of the older Philz versions and the same problem persists.
Will try out TWRP now.
can I format /system with f2fs and then just make a restore? or I have to install a new rom?
chacox said:
can I format /system with f2fs and then just make a restore? or I have to install a new rom?
Click to expand...
Click to collapse
You can try it, I tested several combinations restoring nandroid backups and they worked fine.
But I suggest you to made a full nandroid just un case.
Sent from my GT-I9190
F4k said:
You can try it, I tested several combinations restoring nandroid backups and they worked fine.
But I suggest you to made a full nandroid just un case.
Sent from my GT-I9190
Click to expand...
Click to collapse
ok, I will try right now! and Ill let you know if it works in that way, thanks for your great job!
update: yeah it worked in that way! I have f2fs in every partition! thanks
Does FSFS support symlinks?
If so, how to access FSFS formatted sdcards on /storage/sdcardX directly w/o fuse layer on top?
aguaz said:
Does FSFS support symlinks?
If so, how to access FSFS formatted sdcards on /storage/sdcardX directly w/o fuse layer on top?
Click to expand...
Click to collapse
To use F2FS on external sd cards, ROM needs to have F2FS support on minivold for vold managed volumes, my CarbonROM builds support it.
External storages are vold managed volumes, this is my external sd card formatted as F2FS:
Code:
/dev/block/vold/179:33 on /mnt/media_rw/sdcard1 type f2fs (rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,background_gc=off,user_xattr,inline_xattr,acl,active_logs=2
F4k said:
External storages are vold managed volumes, this is my external sd card formatted as F2FS:
Code:
/dev/block/vold/179:33 on /mnt/media_rw/sdcard1 type f2fs (rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,background_gc=off,user_xattr,inline_xattr,acl,active_logs=2
Click to expand...
Click to collapse
My understanding is that the mount point on /mnt/media_rw/sdcard1 is for internal use only. Apps however use the additional mount point on /storage/scdard1 . This mount point has a fuse layer on top, which prevents the use of symlinks on eg ext4 formatted cards. (see here: http://forum.xda-developers.com/showthread.php?t=1442729)
So I'm wondering if F2FS can be accessed by apps natively w/o fuse layer in order to use symlinks. That is of course assuming F2FS supports symlinks itself.
Recovery doesn't seem to support encrypted partitions properly (acts like they don't exist), also some weird input glitches... Doing more testing...
After using TWRP for a while I decided to go back to Philz, this time without reformatting or restoring any old settings. Everything is working perfectly now, something crazy must have happened with my old settings, I suspect with 'Sd Card Target'.
Thank you very much for this F4k. Besides the addition of F2fs support, previously the latest version available to us was 6.41.6, very nice to have such an up to date version now I seriously would donate if I had the means to, and as soon as I actually have some money in my bank account for a change I definitely will be doing so
dulemars said:
Recovery doesn't seem to support encrypted partitions properly (acts like they don't exist), also some weird input glitches... Doing more testing...
Click to expand...
Click to collapse
I don't added crypto support yet to TWRP
i've a problem with system partition.
i use twrp recovery. i've do a clean install format data, i've cheked in Advanced Wipe System and Cache partitions to convert to F2FS, wiped system and cache, i've install last cyanogen nightly and... in diskinfo data is f2fs, cache is f2fs but system is ext4.... why? what's wrong?
thanks
TWRP 3.0.1-0 with "All-F2FS" support
I have modified the standard TWRP recovery to work with F2FS partitions.
This is different from the previous recoveries that i published.
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.
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:
Zeus-Kernel.zip (CM12.1) - Here
Zeus-Kernel-MM.zip ( MM ) - Here
recovery-sprout-F2FS-All.img - Here
TWRP 3.0.1-0 Latest - Here
Changelogs:
-29/10/15: Initial Release
-02/04/15 : TWRP 3.0.1-0 Release
To switch your /system, /cache and /data partitions to F2FS follow instructions:
You need:
-Two files you can download above.
-A Android One (Sprout4) device obviously.
-Patience and Time.
Steps:
Flash this recovery with Fastboot (Maybe Flashify, Your wish)
Reboot in new recovery
Backup your /system , /data
(a) Go to Wipe, then Advanced Wipe, Select /System.
(b) Click on "Repair or Change File System"
(c) Click on "Change File System" option
(d) Select F2FS then Swipe to Change.
Repeat steps (a) to (d) with /data and /cache as you did with /system.
Now come back to main screen and go to "Settings"
Select "Use rm -rf instead of formatting."
Go to Restore menu and restore your previously backed up data.
Now Flash the Kernel zip provided above.
Reboot.
Done.
It's easier than it seems.
To restore partitions to stock:
Backup /system and /data
Change File System to EXT4.
Go to Restore menu and restore /system and /data again.
XDA:DevDB Information
[RECOVERY][All-F2FS] TWRP 3.0.1-0 with All-F2FS support, Tool/Utility for the OEM Cross Device Development
Contributors
Swapnil Solanki
Source Code: https://github.com/TeamWin
Version Information
Status: Stable
Current Stable Version: 3.0.1-0
Stable Release Date: 2016-04-02
Created 2015-10-30
Last Updated 2016-04-02
Reserved
Reserved
Yay......
It's here..
Thanks sir...
Thanks I got it resolved..
In the Meantime I'll keep mashing Thanks button...
Could you make a flashable zip for the recovery? Thanks!
vjtigas said:
Could you make a flashable zip for the recovery? Thanks!
Click to expand...
Click to collapse
Sure I'll make it soon.
Keep mashing thanks button
Regards.
so this change our system ext4 to f2fs?
my question
if i flash stock or custom rom (Kk,L,M) still on f2fs or back to ext4?
f2fs have great performance i think..
edit : i used sprout8,does it wipe my data/media storage?
Minions_Army said:
so this change our system ext4 to f2fs?
my question
if i flash stock or custom rom (Kk,L,M) still on f2fs or back to ext4?
f2fs have great performance i think..
edit : i used sprout8,does it wipe my data/media storage?
Click to expand...
Click to collapse
This doesn't change it. It just gives support for it.
No. (Misunderstood your question.)
He said it's for sprout4, but I think it don't wipe that.
vjtigas said:
This doesn't change it. It just gives support for it.
I don't think so.
He said it's or sprout4, but I think don't it wipes that.
Click to expand...
Click to collapse
wait for Op explain this
:cheers
hi i am using my sd card as adapted internal storage on android m. will this recovery detect any zip placed on this card? if no how to push the zip to my phone
vjtigas said:
Could you make a flashable zip for the recovery? Thanks!
Click to expand...
Click to collapse
Well I made a flashable zip
https://www.androidfilehost.com/?fid=24052804347850387
---------- Post added at 10:47 AM ---------- Previous post was at 10:45 AM ----------
austinpinto said:
hi i am using my sd card as adapted internal storage on android m. will this recovery detect any zip placed on this card? if no how to push the zip to my phone
Click to expand...
Click to collapse
No recovery is made to detect card formatted as Internal Storage as it encrypts it. To flash zip, you can put it in /data/media folder or OEM folder or simply use adb sideload from PC
Minions_Army said:
so this change our system ext4 to f2fs?
my question
if i flash stock or custom rom (Kk,L,M) still on f2fs or back to ext4?
f2fs have great performance i think..
edit : i used sprout8,does it wipe my data/media storage?
Click to expand...
Click to collapse
Yeah, it'll allow you to change the filesystems to F2FS.
It should still be F2FS after flashing KK ROMs. But LP and MM ROMs include an EXT4 image in their zips, so flashing MM or LP ROMs will convert the system partition to EXT4. Data and cache will stay as EXT4.
Formatting data always wipe /data/media. Wiping data with sprout8 recovery keeps /data/media, but as OP says that this is for sprout 4, it'll either not work with sprout8 (not sure) or wipe /data/media if you wipe /data.
hp5942 said:
Well I made a flashable zip
https://www.androidfilehost.com/?fid=24052804347850387
---------- Post added at 10:47 AM ---------- Previous post was at 10:45 AM ----------
No recovery is made to detect card formatted as Internal Storage as it encrypts it. To flash zip, you can put it in /data/media folder or OEM folder or simply use adb sideload from PC
Click to expand...
Click to collapse
i have the drivers for the phone but when i do adb sideload on pc when phone is in this recovery nothing hapends.
are there any other drivers that i must install?
i installed the google usb driver from google
austinpinto said:
i have the drivers for the phone but when i do adb sideload on pc when phone is in this recovery nothing hapends.
are there any other drivers that i must install?
i installed the google usb driver from google
Click to expand...
Click to collapse
Try reinstalling driver while device is in recovery. I had to install it twice on Win10
Hope that helps
I'm not sure where I'm going wrong. After I converted to f2fs, TWRP straight up refused to mount /system, /data and /cache.
I had to convert it back to ext4 before TWRP would mount them. Can anybody help me out?
I'm using cm13 beta2 having 3.10.92 Zeus kernel n 2.8.7.0 twrp recovery so do I need to change kernel after chnging system file to f2fs ...?
harsh. said:
I'm using cm13 beta2 having 3.10.92 Zeus kernel n 2.8.7.0 twrp recovery so do I need to change kernel after chnging system file to f2fs ...?
Click to expand...
Click to collapse
I think Zeus is the only kernel for sprout that supports f2fs. Your safest bet would be to install the latest Zeus(4.5) kernel.
If I flash the flashable zip uploaded by @hp5942, then, will the /system, /cache & /data to f2fs?
krittin98 said:
If I flash the flashable zip uploaded by @hp5942, then, will the /system, /cache & /data to f2fs?
Click to expand...
Click to collapse
No you'll have to do that yourself manually. Recovery is flashed to support mounting of F2FS. Follow instructions given at the beginning of thread and don't forget to flash Zeus kernel given at beginning of thread (mm of lollipop specific depending on your rom). Happy Flashing
I'm unable to take backup as not enough space can I flash system ROM n gapps from SD card after F2FS?
Sent from my Micromax AQ4501 using Tapatalk