My attempt to convert a XT1033 converted to GPe to F2FS. - Moto G General

Hello folks,
Well, we all know that the stock Moto G filesystem is F2FS. But surprisingly, the Moto G GPe has a native Ext4 support. Since F2FS is supposed to have about a 30% better performance, I decided to try out the convert to F2FS feature in Philz recovery. So I formatted my system and cache to F2FS (since it didn't give me an option to wipe data and data/media to convert) and flashed a ROM. Currently, I seem to be facing a bootloop.
Anyway, has anyone else tried something like this? If yes, then please share your experience here.
Cheers.

It would be great if that would be possible,then you could jump from retail stock to GPe more easly. I have an XT1032 stock rom and i'd really like GPe,but my concerns are that would i be able to stock XT1032 again from GPe? You know,for F2FS and if i wanted to flash custom roms again to have better support. Any thoughts on my question? And look the first post,this is really interesting since if you'd want custom roms and you are on GPe,you wouldnt need to flash stock ROM to avoid bugs with custom roms and GPe

TWRP also include a format to f2fs <-> ext4 option:
Add GUI option to change or repair file systems on individual partitions. The change is destructive so backup your data including internal sdcard first. This option should make it a little easier to migrate a device from ext4 -> f2fs, for instance. You will find this option under Wipe -> Advanced Wipe, then select only one partition and then press the Repair or Change File System button. If a developer has added f2fs support for your device and we don't have it in TWRP, please contact me via PM to arrange for it to be added.
Click to expand...
Click to collapse
http://teamw.in/project/twrp2​
Wipe > Advanced Wipe > <Select Partition> > Repair or Change File System > Change File System
I will test this out tomorrow when I have some time.

U need a kernel support somewhat like this in nexus 5 for f2fs
http://forum.xda-developers.com/google-nexus-5/orig-development/nexus-5-f2fs-t2668486

Stock kernel supports f2fs, GPE kernel does not. Development of a GPE kernel that supported f2fs would be ideal, assuming the GPE stock ROM also functions correctly with a f2fs formated USERDATA partition.

Has anyone even tried to flash boot.img from stock,and then converting in philz?

DeHuMaNiZeD said:
Has anyone even tried to flash boot.img from stock,and then converting in philz?
Click to expand...
Click to collapse
/boot/ (kernel+ramdisk) does not need to be formatted. Flashing boot.img before or after wouldn't make any difference.

lost101 said:
/boot/ (kernel+ramdisk) does not need to be formatted. Flashing boot.img before or after wouldn't make any difference.
Click to expand...
Click to collapse
Well, I tried using TWRP, but it ended converting my phone back to dual sim.
Sent from my Moto G using XDA Premium 4 mobile app

Using TWRP to reformat 'data' from f2fs to ext4 wipes SDCARD and didn't even change the format. Right now it appears if you plan on moving between GPE and non-GPE and possibly back again, keep a full firmware image for both.
EDIT: Actually it appears TWRP did format correctly. But the GPE kernel can't get past the Bootloader. Perhaps there are other partition table differences.
After another try..the following works fine.
Migrate to GPE:
1) In TWRP, wipe, and format 'Data' from f2fs to ext4 (this will wipe internal storage.)
2) Sideload / adb push GPE ROM or flash ROM and Kernel via fastboot.
3) Reboot​
Return to Motorola Stock:
1) In TWRP, wipe, and format 'Data' from ext4 to f2fs (this will wipe internal storage.)
2) Sideload / adb push Stock ROM or flash ROM and Kernel via fastboot.
3) Reboot​

rudi_j7 said:
Well, I tried using TWRP, but it ended converting my phone back to dual sim.
Click to expand...
Click to collapse
I re-read your OP. The GPE Kernel expects the 'userdata' partition to be ext4. Unless someone develops a custom kernel to support it; you will never be able to run the GPE ROM with an f2fs 'userdata.'

Because you set all partitions to F2FS. Only need to change /data to F2FS. Leave system and cache ext4. You would need a ROM with a patched fstab and then a kernel supporting f2fs for system and cache to be in F2FS as well. Plus major benefit is in /data, not system and cache. I tested full F2FS on my N4 and it was more a pain with less gain. /data is all that should be F2FS.
Sent from my Moto G using Tapatalk

You can get it by deleting the partition / data and change it later by f2fs with TWRP fastboot erase boot partition and flash the boot.img from the stock 4.4.4 rom motorola everything from GPE and I have it so it shows more fluid

Related

Factory image / OTA and F2FS

Hi there,
I searched a lot on the subject, but I'm still not sure if/how this would work:
Can you install a factory image or an OTA update on a F2FS formated Nexus 7 2012?
Currently I have a lollipop custom ROM and kernel, with all F2FS and TWRP running on my Nexus 7. Could I install a custom F2FS kernel on my F2FS formated Nexus 7, like Phantom, and then only flash system.img and userdata.img from a lollipop factory image? Then, could I simply flash future OTA update zips?
Thanks!
It will just format it back to ext4. I've been trying to get f2fs to wepork on mine but I can't get the damn thing to recognize and side load. So I keep having to reflash official builds and it just rewrites everything to the stock build. I flashed the whole thing as f2fs wiped the device.
bill3508 said:
It will just format it back to ext4. I've been trying to get f2fs to wepork on mine but I can't get the damn thing to recognize and side load. So I keep having to reflash official builds and it just rewrites everything to the stock build. I flashed the whole thing as f2fs wiped the device.
Click to expand...
Click to collapse
Hi,
I got as far as (in short):
- Flash factory image
- Flash openrecovery TWRP
- Backup system and data (you have to make some space on system first, e.g. by moving some apps over to data)
- Format system, cache and data to F2FS in TWRP
- Restore system and data backup with "Use rm -rf instead of formatting" checked in TWRP settings
- Flash boot.img from Phantom kernel
I got this to work with LP 5.02, but for some reason with 5.1 the system restore failed so far... As for updates, I thought that, in the same way, you could just restore a system backup of a newer factory install over your actual system, but I haven't tried that yet.
Then again, this all is quite tedious. I'm not very advanced in img or ROM modification, but I'd like to know what one would have to modify in factory images or ROMS to make them F2FS compatible. For JB there are ressources out there, but I haven't found anything for LP so far... Anyone?
All I did was on 5.1 flashed a F2FS kernel then in TWRP formated cache. It was like night and day.
Simply formating cache to f2fs makes already such a difference? Interesting, will give this a try. This would be a fairly easy solution to have a fast stock experience. I might try formating data to f2fs as well (and restoring backup), but leaving system on ext4. This way you may be able to simply flash the system image from future factory images to update your system, that would be a good enough solution for me.
First try updating to 5.1.
5.1 is running and performing so much better than on 5.0.2.
Even with ext4 filesystem and stock kernel.
Sent from my Nexus 7 using XDA Free mobile app
I already am on 5.1. Intitially it ran pretty good indeed, but I'm starting to get occasional lags again now. Not as bad as before, but still not as smooth as with JB when it was new... Like I said earlier, I haven't managed to do the TWRP f2fs backup and restore method for some reason with 5.1, but keeping system on ext4 might do the trick, so I'll try that and see if it improves upon stock 5.1...
rbeavers said:
All I did was on 5.1 flashed a F2FS kernel then in TWRP formated cache. It was like night and day.
Click to expand...
Click to collapse
Hey rbeavers, what kernel did you flash? I tried with Phantom Kernel r1 and r2, and I get NFC force close at startup, which prevents from using the tablet...
Thanks.
maksmtl said:
Hey rbeavers, what kernel did you flash? I tried with Phantom Kernel r1 and r2, and I get NFC force close at startup, which prevents from using the tablet...
Thanks.
Click to expand...
Click to collapse
I'm using Franco Kernel(r82). It supports F2FS(formatted /cache and /data to F2FS) and it works flawlessly.
TWRP backups fail on stock 5.1 with f2fs/franco?
I downloaded the 5.1 factory image; installed it using the included batch file; installed franco r82 and formatted /cache and /data to f2fs. It seems to run reasonably well, but TWRP 2.8.5.1 and 2.8.6.0 both fail to make a backup, giving an unspecified error when backing up the data partition. Do you experience the same thing? Do you know of a workaround?
maksmtl said:
Hey rbeavers, what kernel did you flash? I tried with Phantom Kernel r1 and r2, and I get NFC force close at startup, which prevents from using the tablet...
Thanks.
Click to expand...
Click to collapse
Franco Kernel(r82) sorry so late.
Still working great! Only gripe 2 - 3 second delay on waking up.
rbeavers said:
All I did was on 5.1 flashed a F2FS kernel then in TWRP formated cache. It was like night and day.
Click to expand...
Click to collapse
rbeavers said:
Franco Kernel(r82) sorry so late.
Still working great! Only gripe 2 - 3 second delay on waking up.
Click to expand...
Click to collapse
Running really good so far with Franco Kernel and Cache and Data in f2fs. Thanks guys.
I also don't get that wake delay btw. Maybe wipe cache again?
@CCarson: I made a successful backup using TWRP 2.8.6.0. Maybe backup your sdcard and then re-format data. Also, don't know if this applies to you, but if you have the 16GB model, the 5.1 factory image formated mine to 8GB, so I had to re-format data once to get it back to 16GB and only then I changed it to f2fs.

F2FS for /cache and /data (tested on CM12 ZL, possibly works on other FUSION3 / CM12)

OP updated with the twrp odin repack from yuga.
- based on TWRP 2850 for yuga
- changed TWRP splash curtain
- adddd F2FS binary from olivier
http://www.mediafire.com/download/38gxejrk6v3yrxe/TWRP285v4.img
WARNING! THIS WILL WIPE YOUR DATA PARTITION (INTERNAL SCDARD). MAKE SURE YOU HAVE A BACKUP BEFORE PROCEEDING!
Click to expand...
Click to collapse
Hope this helps, guide on how to convert /CACHE and /DATA to F2FS partitions. I've tried this before on my Nexus7 2012, and F2FS improves benchmark scores. Same behavior happened on my ZL, it improved benchmark from 21k to 26k!
Requirements:
1. ROM / Kernel that supports F2FS. I've tried this on CM12 build 03/12 and CM12 build 03/15, F2FS works ok. I believe this has been merged to CM since Mar builds.
2. mkfs.f2fs binary. Credits to Olivier for this. I grabbed his MultiROM TWRP for ODIN, unpack and grabbed the mkfs.f2fs binary. Unpack regular TWRP for ODIN and copied over the mkfs.f2fs binary, repack and flashed it on the FOTA partition.
3. Unlocked bootloader. Since we will be using custom ROM / kernel that supports F2FS, we need to have unlocked bootloader, or else it will result to softbrick. Hopefully when Sony releases Android5, hoping that their stock kernel supports F2FS so that no need to unlock bootloader.
Steps: (pics included for reference)
1. Make sure you are on modified TWRP with the mkfs.f2fs binary. If you dont want to unpack / repack, use the MultiROM TWRP.
2. Select Advanced > Terminal Command.
3. Start on /system/bin (optional).
4. Enter the command to format /cache to F2FS
mkfs.f2fs /dev/block/platform/msm_sdcc.1/by-name/cache
Click to expand...
Click to collapse
5. Enter the command to format /data to F2FS
mkfs.f2fs /dev/block/platform/msm_sdcc.1/by-name/userdata
Click to expand...
Click to collapse
6. Reboot recovery to refresh / reread the partitions. This step is very IMPORTANT!
7. If you have custom TWRP themes, it will revert back to plain TWRP, due to /data partition being formatted to F2FS.
8. Go to Wipe > Advanced Wipe.
9. Select Cache >Repair or Change Filesystem
10. It will show that /cache partition is now on f2fs filesystem.
11. Repeat step 9, select Data > repair or Change Filesystem. It will show /data partition is now on f2fs filesystem.
ADDED NOTE : I've also tried to format /system partition to F2FS, it formats it successful, but upon flashing the CM12 ROM, it reverts back to EXT4. I beleive this behavior happens because the system.img is in EXT4 format. This will be next project soon to complete ALL F2FS - /system /data / cache on F2FS partitions.
WARNING! THIS WILL WIPE YOUR DATA PARTITION (INTERNAL SCDARD). MAKE SURE YOU HAVE A BACKUP BEFORE PROCEEDING!
Click to expand...
Click to collapse
BIG THANKS to OLIVIER for the MultiROM TWRP and of course to CM12 for implementing F2FS.
How could I know that currently running kernel indeed runs F2FS?
ryanrudolf said:
Hope this helps, guide on how to convert /CACHE and /DATA to F2FS partitions. I've tried this before on my Nexus7 2012, and F2FS improves benchmark scores. Same behavior happened on my ZL, it improved benchmark from 21k to 26k!
Requirements:
1. ROM / Kernel that supports F2FS. I've tried this on CM12 build 03/12 and CM12 build 03/15, F2FS works ok. I believe this has been merged to CM since Mar builds.
2. mkfs.f2fs binary. Credits to Olivier for this. I grabbed his MultiROM TWRP for ODIN, unpack and grabbed the mkfs.f2fs binary. Unpack regular TWRP for ODIN and copied over the mkfs.f2fs binary, repack and flashed it on the FOTA partition.
3. Unlocked bootloader. Since we will be using custom ROM / kernel that supports F2FS, we need to have unlocked bootloader, or else it will result to softbrick. Hopefully when Sony releases Android5, hoping that their stock kernel supports F2FS so that no need to unlock bootloader.
Steps: (pics included for reference)
1. Make sure you are on modified TWRP with the mkfs.f2fs binary. If you dont want to unpack / repack, use the MultiROM TWRP.
2. Select Advanced > Terminal Command.
3. Start on /system/bin (optional).
4. Enter the command to format /cache to F2FS
5. Enter the command to format /data to F2FS
6. Reboot recovery to refresh / reread the partitions. This step is very IMPORTANT!
7. If you have custom TWRP themes, it will revert back to plain TWRP, due to /data partition being formatted to F2FS.
8. Go to Wipe > Advanced Wipe.
9. Select Cache >Repair or Change Filesystem
10. It will show that /cache partition is now on f2fs filesystem.
11. Repeat step 9, select Data > repair or Change Filesystem. It will show /data partition is now on f2fs filesystem.
ADDED NOTE : I've also tried to format /system partition to F2FS, it formats it successful, but upon flashing the CM12 ROM, it reverts back to EXT4. I beleive this behavior happens because the system.img is in EXT4 format. This will be next project soon to complete ALL F2FS - /system /data / cache on F2FS partitions.
BIG THANKS to OLIVIER for the MultiROM TWRP and of course to CM12 for implementing F2FS.
Click to expand...
Click to collapse
Sweet! I would love to see this on my Z2. It does wonders for my Nexus 10!
Would be nice if you attached mkfs.f2fs here in this thread.
phhuang said:
How could I know that currently running kernel indeed runs F2FS?
Click to expand...
Click to collapse
if you are running a fusion3 based device (z, zr, zl, tablet z, tablet z wifi) with a nightly or a recent build direct from source, it supports f2fs. i merged support for it directly into cm12 on the first of march.
thanks QSNC youre the man! still figuring out how to set /system to F2FS.
mkfs.f2fs binary
I attached mkfs.f2fs binary which is compiled from https://github.com/CyanogenMod/android_external_f2fs-tools
Thanks! Then I guess my Z1 could just pass it by now...
It says
Code:
/system/bin/mkfs.f2fs: line 1: syntax error: unexpected "("
-------------EDIT
I got it working using this, although I had to set the permissions to 755 after pushing via adb.
ADDED NOTE : I've also tried to format /system partition to F2FS, it formats it successful, but upon flashing the CM12 ROM, it reverts back to EXT4. I beleive this behavior happens because the system.img is in EXT4 format. This will be next project soon to complete ALL F2FS - /system /data / cache on F2FS partitions.
I think it is becuase of the block-based zip-filesfrom lollipop. The zip file flashes a filesystem directly instead of mounting /system and copying the system files to this patition.
i forgot to add, im using official TWRP 2.8.5.0 for Yuga (Xperia Z), i just repack it to use build.prop of ZL and included the mkfs.f2fs binary from MultiROM TWRP.
qsnc said:
if you are running a fusion3 based device (z, zr, zl, tablet z, tablet z wifi) with a nightly or a recent build direct from source, it supports f2fs. i merged support for it directly into cm12 on the first of march.
Click to expand...
Click to collapse
the merges u made, its only for fusion3 or its already also on CM12 z1, z2, z3 devices?
Good looks on this! Gonna be following this thread.
Can't you format using TWRP GUI?
After I tried it TWRP won't mount the new partitions. Not after reboot either. Z1 compact, TWRP 2.8.4.0 with mkfs.f2fs repack.
Edit: Seems like stock CM12 @ Z1c don't support f2fs yet. I've successfully formatted cache through terminal in TWRP, but when booting I get bootloop. And TWRP still won't mount it.
arunsai123 said:
I attached mkfs.f2fs binary which is compiled from https://github.com/CyanogenMod/android_external_f2fs-tools
Click to expand...
Click to collapse
Your compile is much bigger than any other mkfs.f2fs out there. (Most is 166kb uncompressed). Why is that?
Quick update -
I flashed my ZL with latest unofficial nightly build of Shufuking. It is based on CM12.1 / Android 5.1. F2FS still works, im running /cache and /data as F2FS.
Your guide is a bit complicated - actually, you can just flash a TWRP build of mine (http://olivier.hubdroid.com/yuga/twrp/) and switch to F2FS, without having to download a separate binary etc:
Go to Wipe > Advanced Wipe > select the desired partition > Repair or change filesystem > Change filesystem > f2fs
@Olivier
i tried your build fof odin, in this link http://olivier.hubdroid.com/odin/twrp/
but it won't boot. once i flash to fota and reboot, cyanogen recovery boots up. i tried every nightly build but it wont boot. i also tried the yuga builds for my odin same behavior. hope you csn create for odin, i'llbe happy to be tester for it.
OP updated with the twrp odin repack from yuga.
- based on TWRP 2850 for yuga
- changed TWRP splash curtain
- adddd F2FS binary from olivier
http://www.mediafire.com/download/38gxejrk6v3yrxe/TWRP285v4.img
ryanrudolf said:
@Olivier
i tried your build fof odin, in this link http://olivier.hubdroid.com/odin/twrp/
but it won't boot. once i flash to fota and reboot, cyanogen recovery boots up. i tried every nightly build but it wont boot. i also tried the yuga builds for my odin same behavior. hope you csn create for odin, i'llbe happy to be tester for it.
OP updated with the twrp odin repack from yuga.
- based on TWRP 2850 for yuga
- changed TWRP splash curtain
- adddd F2FS binary from olivier
http://www.mediafire.com/download/38gxejrk6v3yrxe/TWRP285v4.img
Click to expand...
Click to collapse
Logs. I need logs. If everything else fails, flash this hack too.
@Olivier
hack works! it now boots to TWRP 2860! i suppose if we flash new CM 12.1 nightly, we have to flash the hack again? thanks very much!
EDIT:
i reflashed original CM12.1 boot.img and same behavior happened, TWRP wont boot, it goes to cyanogen recovery. unpack / repack CM12.1 boot.img and replace the elf ram disk from your hack, it now works ok! am i correct the hack only replaces the elf ram disk?

[Q] F2FS to ext4

I have converted my Nexus 7(grouper) to all f2fs and flashed slimlp. How do I convert it Ext4 file system and flash CM 12 Nightlies.?
I believe it's the same way you converted to F2FS, but this time select "EXT4" and not "F2FS".
I thought of doing that, but better get to know from someone who has done that before.
Flashing factory image restored to ext4.. That is safest method to do this.
After you convert everything back ext4, you can convert the data and cache back to f2fs because the nightlies in cm12 support this. You just need to leave the system partition as ext4 since this isn't supported yet.
Yup, I have seen those options, but didn't convert it to F2FS.I am giving my tab to my brother and he is not interested in flashing and all, but before giving I wanted to try baton(I have a one plus one), that's why I have flashed CM12.1. I was unable to get baton work.

F2FS - recovery not compatible?

I was trying to convert my system, data and cache to F2FS but after the conversion I can't use Data anymore (apparently it cannot mount data and system anymore).
Could be a problem LinkedIn to the grarak modded 3.0.2 I'm using for Exodus 6?
Any feedback is welcome!
Up
Most probably as the official one from twrp supports f2fs natively.
I would recommend to go back to official twrp convert to f2fs properly from there and then flash the modified one, do this if you are brave enough, i havent tried this method but it should work. If all fails stay on ext4 till garak or twrp updates their twrp versions.
Thanks for you answer... I thought the same... I'll try as the new phone will come and let you know...
IlD4nX said:
I was trying to convert my system, data and cache to F2FS but after the conversion I can't use Data anymore (apparently it cannot mount data and system anymore).
Could be a problem LinkedIn to the grarak modded 3.0.2 I'm using for Exodus 6?
Any feedback is welcome!
Click to expand...
Click to collapse
I got the same error for my Redmi Note 3 ... tried 3.0.0.0, 3.0.2.2, but nothing. then a guy suggested this:
https://www.androidfilehost.com/?fid=24591000424943818
and it worked. Now I can't boot on f2fs, just trying to make it work on 6.0.1 Mokee rom

How to really clean my phone before a new flash?

Hello everyone.
Usually I just format things through TWRP and flash a new ROM, but I found the following in a Nexus 6 thread:
As to what I usually do for a really clean install (likely overkill):
Reboot to Bootloader
Wipe everything (fastboot erase all)
Do flash-base.sh from latest factory image (this reflashes modem partitions; this is required after erase all)
Boot to Recovery
Wipe everything from TWRP
Reboot to Recovery
Wipe everything again from TWRP (old habit from when the first wipe didn't actually get rid of everything on older devices)
fstrim Data, Cache, System, and Firmware partitions
Reboot to Recovery
ROM
GApps (I don't use GApps, but if I did, this is when they are to be flashed)
Reboot to Recovery
Wipe everything except System from TWRP
Format Data and Cache to F2FS
fstrim Data and Cache partitions
Reboot to Recovery
Kernel
Magisk
Reboot to System
Do set-up and copy files over to device
Reboot to Recovery
Wipe Dalvik Cache (I guess the button in TWRP would work; I do rm -Rf /data/dalvik-cache)
Use filesystem tools to check and repair partitions (e2fsck for ext4 being System and Firmware partitions, and fsck.f2fs for F2FS being Data and Cache partitions)
fstrim Data, Cache, System, and Firmware partitions
Reboot to System
Click to expand...
Click to collapse
Is there anything similar for Moto G5 Plus? I would really like to make a deep cleanup in my phone before flashing a new ROM.
Thanks in advance.
vitorsubs said:
Hello everyone.
Usually I just format things through TWRP and flash a new ROM, but I found the following in a Nexus 6 thread:
Is there anything similar for Moto G5 Plus? I would really like to make a deep cleanup in my phone before flashing a new ROM.
Thanks in advance.
Click to expand...
Click to collapse
Except part 1: flash-base.sh from latest factory image (we have no factory image) you can do everything on the Moto G5+ too.
The question is if that is really needed.
Wiping twice with TWRP isn't necessary anymore but you can do it if you want.
fstrim isn't really needed imo, but you can do it from terminal if you want.
And checking the partitions for errors may be a good thing but if the partitions are faulty you would recognise it when you try to flash anything. But this is a thing you can do too if you want to.
You can find the exact usage of the commands for fstrim and e2fsck and fsck.f2fs by googling for it.
If I want to be sure that everything is cleaned up I wipe all partitions except external SD with TWRP, reformat data (you'll have to do that as the F2FS formatted data partition is encrypted) and flash my usual stuff like ROM, gapps, kernel, magisk etc.
Sent from my Moto G5 Plus using XDA Labs

Categories

Resources