Can we use the F2FS file system on our GNex instead of EXT4?

Search This thread

Shidell

Senior Member
Jan 21, 2009
563
85
The Moto X (and more importantly, the Moto G) are using F2FS on their /data partitions and are seeing great I/O performance--even the Moto G, which is using essentially MicroSD eMMC is performing very well, and it's attributed to F2FS.

Is it possible to merge the patches required for F2FS support into the currently GNex kernel and produce a Recovery image built using that kernel that could clean /data and create a F2FS partition on it? Further, could that same kernel then be used in conjunction with an Android image to provide support for F2FS in Android, as the Moto X and G do?

The benchmarks for F2FS performance on NAND is incredible, and the GNex's is seeing new life with KitKat's memory and process optimizations. I'd like to start a discussion on bringing F2FS support to the GNex, in the interest of furthering it's potential.
 

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
The Moto X (and more importantly, the Moto G) are using F2FS on their /data partitions and are seeing great I/O performance--even the Moto G, which is using essentially MicroSD eMMC is performing very well, and it's attributed to F2FS.

Is it possible to merge the patches required for F2FS support into the currently GNex kernel and produce a Recovery image built using that kernel that could clean /data and create a F2FS partition on it? Further, could that same kernel then be used in conjunction with an Android image to provide support for F2FS in Android, as the Moto X and G do?

The benchmarks for F2FS performance on NAND is incredible, and the GNex's is seeing new life with KitKat's memory and process optimizations. I'd like to start a discussion on bringing F2FS support to the GNex, in the interest of furthering it's potential.

I'm not sure but I'm very interested in this , if you can find these commits , I'll add this to my to do list . :thumbup:


Edit I found some , thanks for this topic I'll start seeing if it's possible

Sent from my Galaxy Nexus using Tapatalk
 
Last edited:

Shidell

Senior Member
Jan 21, 2009
563
85
I'm not sure but I'm very interested in this , if you can find these commits , I'll add this to my to do list . :thumbup:


Edit I found some , thanks for this topic I'll start seeing if it's possible

Sent from my Galaxy Nexus using Tapatalk

Awesome--thanks for investigating. I know you have the know-how to implement F2FS if it's feasible. :) It does appear to F2FS does offer about a 30% I/O perf improvement across the board, but in some cases, it can be as much as 300%, which is insane.

Here's a post I made on reddit with links to performance benchmarks of F2FS vs EXT3, EXT4, BTRFS, etc.

http://www.reddit.com/r/GalaxyNexus/comments/1t7a17/can_we_discuss_f2fs_on_the_galaxy_nexus_seems/

Did you have any luck looking for F2FS patches? Anything I can help with?
 

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
Awesome--thanks for investigating. I know you have the know-how to implement F2FS if it's feasible. :) It does appear to F2FS does offer about a 30% I/O perf improvement across the board, but in some cases, it can be as much as 300%, which is insane.

Here's a post I made on reddit with links to performance benchmarks of F2FS vs EXT3, EXT4, BTRFS, etc.

http://www.reddit.com/r/GalaxyNexus/comments/1t7a17/can_we_discuss_f2fs_on_the_galaxy_nexus_seems/

Did you have any luck looking for F2FS patches? Anything I can help with?

Actually I did , I applied the patches necessary , the kernel supports f2fs , and now I'm in the process of getting the data partition formatted and mounted , which is ROM side in the fstabs , so hopefully I can build a ROM soon that's mounted f2fs , I've been all over this , it's definitely gonna work , just a matter of time before I get everything together
It was a patchset of 250 patches to the kernel .

Trying for some seat time tonight , :fingers-crossed:

Sent from my Galaxy Nexus using Tapatalk
 

Zittoro

Senior Member
Feb 26, 2013
311
144
Everything has its upside and downside. I'm not being a smarta$$ or something but just warning you guys...

I think f2fs has a more than 50 or so times slower average mounting time than that of ext4, so most of the flashaholics out there will simply come back to ext4. It requires partition formats and an f2fs kernel. If one flashes an f2fs kernel to a phone with ext4 partitions, the phone will simply hardbrick, and vice versa. Of course it is possible to be unbricked, but it will be difficult for anyone who hasn't dealt with partitions, especially NAND, before.

I'm just afraid this will brick thousands of gnex's. It will cause a serious confusion and eventually succeed or will just be ignored by everyone.


Edit:
I have seen two people successfully ported f2fs, one to Galaxy Nexus and the other to Nexus 5, but both of them said their phone literally mounted forever. Of course the benchmark provided by one of them with gnex showed a really good improvement, but even he forgot that he shouldn't flash an ext4 kernel, which he did and got bricked.
 
Last edited:
  • Like
Reactions: bsmitty83

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
Everything has its upside and downside. I'm not being a smarta$$ or something but just warning you guys...

I think f2fs has a more than 50 or so times slower average mounting time than that of ext4, so most of the flashaholics out there will simply come back to ext4. It requires partition formats and an f2fs kernel. If one flashes an f2fs kernel to a phone with ext4 partitions, the phone will simply hardbrick, and vice versa. Of course it is possible to be unbricked, but it will be difficult for anyone who hasn't dealt with partitions, especially NAND, before.

I'm just afraid this will brick thousands of gnex's. It will cause a serious confusion and eventually succeed or will just be ignored by everyone.


Edit:
I have seen two people successfully ported f2fs, one to Galaxy Nexus and the other to Nexus 5, but both of them said their phone literally mounted forever. Of course the benchmark provided by one of them with gnex showed a really good improvement, but even he forgot that he shouldn't flash an ext4 kernel, which he did and got bricked.

I agree with you about this may or may not be worth it to the general public. But I was interested in this for the op as well as my curiosity .
That's also a great reason for this to stay in the dev support thread

The kernel supports both filesystem's , so flashing the f2fs kernel on a ext partition is OK , hell I'm running that combo now lol , I'm only using ( trying to ) f2fs for the userdata partition like the motoX .

I'm not doing this for recognition , weather its of value to anyone other than my curiosity or self is secondary , not saying I'm thinking only about me. But I would never put a ROM out that I didn't test on my phone first .
I'm compiling AOKP 4.4 now with hopefully everything I'm looking for . I'll post the eventual results .

Sent from my Galaxy Nexus using Tapatalk
 

Zittoro

Senior Member
Feb 26, 2013
311
144
I agree with you about this may or may not be worth it to the general public. But I was interested in this for the op as well as my curiosity .
That's also a great reason for this to stay in the dev support thread

The kernel supports both filesystem's , so flashing the f2fs kernel on a ext partition is OK , hell I'm running that combo now lol , I'm only using ( trying to ) f2fs for the userdata partition like the motoX .

I'm not doing this for recognition , weather its of value to anyone other than my curiosity or self is secondary , not saying I'm thinking only about me. But I would never put a ROM out that I didn't test on my phone first .
I'm compiling AOKP 4.4 now with hopefully everything I'm looking for . I'll post the eventual results .

Sent from my Galaxy Nexus using Tapatalk

I know that you're not gonna do anything silly, but I was warning just in case :) In fact, I'm keen to see another development going on Gnex!!

But are you really doing it like that? If I were you, I would certainly go to the REAL HELL. :cool:
Don't be a bat, just make everything f2fs. It won't do any good with ext4 + f2fs combo.
 
  • Like
Reactions: bsmitty83

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
I know that you're not gonna do anything silly, but I was warning just in case :) In fact, I'm keen to see another development going on Gnex!!

But are you really doing it like that? If I were you, I would certainly go to the REAL HELL. :cool:
Don't be a bat, just make everything f2fs. It won't do any good with ext4 + f2fs combo.

Once I get more comfortable with the filesystem's I'll try doing the sdcard as well . don't think I'll be messing with boot or radio fs anytime soon lol

Sent from my Galaxy Nexus using Tapatalk
 
  • Like
Reactions: seriousia

Shidell

Senior Member
Jan 21, 2009
563
85
I know that you're not gonna do anything silly, but I was warning just in case :) In fact, I'm keen to see another development going on Gnex!!

But are you really doing it like that? If I were you, I would certainly go to the REAL HELL. :cool:
Don't be a bat, just make everything f2fs. It won't do any good with ext4 + f2fs combo.

Does it really take that long to mount the FS? The Moto X and G are using F2FS, does it take them forever to boot/mount?h

Also, can you point us in the direction of the person who got F2FS running on the Gnex/benchmarks? That would help shed some light on what could be gained and if it's worth it. It should be noted that F2FS has a lot of planned changes coming in the linux kernel (soon) which are supposed to make it even faster.
 
Last edited:

Shidell

Senior Member
Jan 21, 2009
563
85
Here are benchmarks from Samsung displaying F2FS vs. EXT4 on a Samsung Galaxy S3: http://lkml.indiana.edu/hypermail/linux/kernel/1210.2/00005.html

Some of those performance gains are insane--twice as fast in some cases. Mounting time does look to be much, much slower--but we are talking about milliseconds here; is 2.2 seconds to mount a big deal? Doesn't seem like it, if you can improve your storage I/O by that much.
 

Zittoro

Senior Member
Feb 26, 2013
311
144
Here are benchmarks from Samsung displaying F2FS vs. EXT4 on a Samsung Galaxy S3: http://lkml.indiana.edu/hypermail/linux/kernel/1210.2/00005.html

Some of those performance gains are insane--twice as fast in some cases. Mounting time does look to be much, much slower--but we are talking about milliseconds here; is 2.2 seconds to mount a big deal? Doesn't seem like it, if you can improve your storage I/O by that much.

It is worth it according to the person who ported it to Galaxy Nexus and his benchmark. I can't tell you who he is and how he did it for some reason, but I think the benchmark (Antutu I think) showed I/O score improved from low 400s to high 500s, and all of the other fields except 2D, which decreased in score, improved at least 10-20% each.

Frankly speaking, I just referred to the mounting time in comarison to ext4, sorry for confusion, so I wasn't saying it's like ol' fashioned computer days. Though, according to the Nexus 5 dev, it took him about 9 seconds to mount system partition. Maybe the reason why it's so slower than the s3 is that it differs by devices or the Samsung developers did an alien job porting it to s3. (Samsung optimization, you know)

Oh, and by the way, the f2fs gnex kernel wasn't released anywhere because he was testing for weeks or months and eventually figured it could be too dangerous, so he created a thread-like thing and asked if anyone wants it and how people thought about releasing it. No one replied, and a few days later, he got bricked, came back to ext4, and another few days later, his computer's hard drive got screwed up without backup, and so he lost the kernel and source.
 

Shidell

Senior Member
Jan 21, 2009
563
85
Hmm. Sucks that he lost his work, that's too bad.

Honestly though, if F2FS is as good as it appears to be, then it seems that it would be a paradigm shift in the ROM community for Android as a whole. For example, F2FS support would be added to each device's kernel (for simplicity's sake, let's imagine CyanogenMod) for each device they support. ClockworkMod Recovery would then be rebuilt for each device (probably snapping to a new main version), which would exclusively format partitions to use F2FS instead of EXT4.

With F2FS support in the kernel for Recovery and Android, all the components are essentially in place, and people could start enjoying the additional performance improvements.

There would be the initial hurdle of porting F2FS support, building Recovery images, and making it clear that the new Recoveries are using F2FS and that a "fresh wipe" would be required to migrate to the new system. Once done, though, everything else should be easy like it is now with ROM updates, backups, etc.

The only other aspect would be a Windows/Mac driver for F2FS.

F2FS is really, really looking good now. If Samsung has even more performance tucked away like they claim they do, it'll really be something.
 
Last edited:
  • Like
Reactions: Zittoro

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
A couple of things that I've got to say on this topic as I've been trying hard to make this fs work , I'm pretty close , got a few critical pointers from the mighty dhacker29 :cool: but still working on getting it all to work together .
A kernel that supports f2fs is the easiest part , it was a pain initially patching it , but it still works just like any other kernel , only it supports another fs . It could be applied to any existing kernel very easily . ( I made it into one single git commit )
As I understand from what I've read in the motoX threads and different sources , twrp adopted f2fs as of twrp 2.6 , so recovery supports it , twrp does anyways and I'm sure I could get cm to work too .
The f2fs mkfs tools are present in 4.3 ROM sources all you have to do is edit boardconfig.mk and device.mk to include said tools
I edited the fstab to use f2fs on /data but when I build a ROM and flash , it goes straight to storage crypto unlock , which my guess is because its still ext4 so the /data isn't being loaded and that's why it jumps straight to unlock storage .
That's pretty much as far as I've gotten .
I'm still working on this , I know its a matter of a combo of how the device formats and partitions the /data.
So far no bricks , I've made my sdcard unmountable , but I just side loaded a ROM and reboot recovery and alls well . I adb pulled my entire sdcard just in case tho lol
If ever this works and its worth people using , not my call , it would be quite painfree . it would require a format of your sdcard , but only once .
And the reason that this is only applied to data and not all partitions is because the only benefits are from the userdata partition , its been tested .
Just sitting here watching my laptop compile yet again .....

Also its more than just a kernel for the gnex. Once all ROMs and kernels support both , it its totally possible , to say in aroma , pick which fs you want formatted , again you would lose your sdcard each time you switch but there's no way around it . just thinking outloud but I need to find out how I can have the install script format the data partition and mount it f2fs. Thats where its at

Sent from my Galaxy Nexus using Tapatalk
 
Last edited:

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
I'm waiting to continue this when I buy a new phone in the next month or so , when I retire my nexus I'll throw everything at it without worry , I am only concerned about partitioning my storage to f2fs , then if my ROM recovery and kernel doesn't work , being stuck with no way to repartition back to ext4 , but I don't think that's a possibility anyways as long as I can get back to recovery or adb I'm OK
Sorry bout the delay , but there's only so much experimentations I can do on my main phone . hopfully I'll have an end product to test soon . everything's just sitting waiting to be flashed . its frustrating waiting so if I get brave this weekend I might just try anyways

Sent from my Galaxy Nexus using Tapatalk
 

Shidell

Senior Member
Jan 21, 2009
563
85
Awesome progress man, you've accomplished a ton!

Is it necessary to partition Recovery as F2FS?

In my mind, it seems like you could stick with an EXT4 Recovery, and simply partition /System as F2FS, and flash a compatible ROM (as this is what the Moto X/G currently do), and that should be enough to see initial gains. Of course, if every partition is F2FS, there would be even more room for improvement--but /System should be enough at first.

Is there concern that partitioning /System could cause a brick? As long as you have a Recovery that can partition EXT4 or F2FS, you could always re-partition it easily from Recovery, right?

EDIT: I do understand your concern, though. It's possible to format via ADB, right? So, for example, if I wanted to be a guinea pig for you and flash my phone, I could do so--and if things go awry, I could repartition and restore from a NAND backup, right? As long as you can ADB in, and you can partition via ADB, seems like you can't really brick a device; that'd be like "bricking" a HDD by partitioning from FAT32 to NTFS to EXT4, wouldn't it?
 
Last edited:

bsmitty83

Senior Member
Apr 22, 2012
3,216
10,353
Detroit
From what I understand , the recovery can stay as is , twrp simply has the ability to recognize f2fs partitions , so once you are using f2fs , your data will be readable.
The actual partitioning tools are located within the ROM . it gets formatted upon flashing.
My concern is that if I repartition the entire /system partition , I could possibly lose the efs data , radio data too . from everything I've read on f2fs , its only beneficial on /userdata , and maybe /cache .
When I did flash an early build of twrp and the aokp ROM I made , when I booted to recovery I couldn't get my data to be read by twrp. So I sideloaded a ROM , then fastbooted a different recovery and all was good .
I don't really think I can brick my phone with what I have made now , its only being used on the data. I should be able to use adb or recovery or a combo to get it back from brick , but for now I really don't think it would be worth you trying just yet. I'll test it soon and if its good I'll post it , but I'm 99% sure it won't work lol . if it was an actual sdcard it would be so simple , but I know its gonna take a few more builds to figure it out . hang tight and I'll report what the outcome is asap ,
I'm still trying to figure out how to actually repartition the sdcard , I've tried modding the updater-script to do it but it status 7'ed on me .
I need to do some more trial and error but again all the pieces are there I think , just need to get it all working together . I'm gonna check out the motoG gits for some inspiration.


EDIT: i was looking in the motoX threads and i noticed that they were in fact formatting through twrp so im gonna explore that
Sent from my Galaxy Nexus using Tapatalk
 
Last edited:
  • Like
Reactions: rtfpessoa

DerTeufel1980

Inactive Recognized Developer
Jul 31, 2011
10,368
27,668
As soon as I get a new phone and no long have to worry about damaging this one , I'll test my last build out and update this .

Sent from my Galaxy Nexus using Tapatalk
If there is something you cant solve, feel free to pm me. I have patched my cwm based recovery to read and format f2fs. This way i can format one or the other easily.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    The Moto X (and more importantly, the Moto G) are using F2FS on their /data partitions and are seeing great I/O performance--even the Moto G, which is using essentially MicroSD eMMC is performing very well, and it's attributed to F2FS.

    Is it possible to merge the patches required for F2FS support into the currently GNex kernel and produce a Recovery image built using that kernel that could clean /data and create a F2FS partition on it? Further, could that same kernel then be used in conjunction with an Android image to provide support for F2FS in Android, as the Moto X and G do?

    The benchmarks for F2FS performance on NAND is incredible, and the GNex's is seeing new life with KitKat's memory and process optimizations. I'd like to start a discussion on bringing F2FS support to the GNex, in the interest of furthering it's potential.

    I'm not sure but I'm very interested in this , if you can find these commits , I'll add this to my to do list . :thumbup:


    Edit I found some , thanks for this topic I'll start seeing if it's possible

    Sent from my Galaxy Nexus using Tapatalk
    7
    The Moto X (and more importantly, the Moto G) are using F2FS on their /data partitions and are seeing great I/O performance--even the Moto G, which is using essentially MicroSD eMMC is performing very well, and it's attributed to F2FS.

    Is it possible to merge the patches required for F2FS support into the currently GNex kernel and produce a Recovery image built using that kernel that could clean /data and create a F2FS partition on it? Further, could that same kernel then be used in conjunction with an Android image to provide support for F2FS in Android, as the Moto X and G do?

    The benchmarks for F2FS performance on NAND is incredible, and the GNex's is seeing new life with KitKat's memory and process optimizations. I'd like to start a discussion on bringing F2FS support to the GNex, in the interest of furthering it's potential.
    6
    we shoud w8 to cyanogen add in rom support for that filesystem,cyanogen developers woring on that be paitent.

    Wait for cm .......

    Why ? I don't even use cm , and I definitely don't need them to do this . what an absurd thing to say man .
    Just for that I'm gonna make f2fs work now .
    But thanks for the vote of confidence or actually helping ....


    Sent from my SCH-I605 using Tapatalk
    6
    Unfortunately, @legolas93 did not reply to my PM. Maybe someone with more experience and clout here on xda will have more success getting through to him. @bsmitty83 did you ever try getting in touch with him?

    Thanks!

    No I haven't personally , but no worries I'll figure it out


    @aosp , [emoji39]

    Sent from my SCH-I605 using Tapatalk
    6
    A couple of things that I've got to say on this topic as I've been trying hard to make this fs work , I'm pretty close , got a few critical pointers from the mighty dhacker29 :cool: but still working on getting it all to work together .
    A kernel that supports f2fs is the easiest part , it was a pain initially patching it , but it still works just like any other kernel , only it supports another fs . It could be applied to any existing kernel very easily . ( I made it into one single git commit )
    As I understand from what I've read in the motoX threads and different sources , twrp adopted f2fs as of twrp 2.6 , so recovery supports it , twrp does anyways and I'm sure I could get cm to work too .
    The f2fs mkfs tools are present in 4.3 ROM sources all you have to do is edit boardconfig.mk and device.mk to include said tools
    I edited the fstab to use f2fs on /data but when I build a ROM and flash , it goes straight to storage crypto unlock , which my guess is because its still ext4 so the /data isn't being loaded and that's why it jumps straight to unlock storage .
    That's pretty much as far as I've gotten .
    I'm still working on this , I know its a matter of a combo of how the device formats and partitions the /data.
    So far no bricks , I've made my sdcard unmountable , but I just side loaded a ROM and reboot recovery and alls well . I adb pulled my entire sdcard just in case tho lol
    If ever this works and its worth people using , not my call , it would be quite painfree . it would require a format of your sdcard , but only once .
    And the reason that this is only applied to data and not all partitions is because the only benefits are from the userdata partition , its been tested .
    Just sitting here watching my laptop compile yet again .....

    Also its more than just a kernel for the gnex. Once all ROMs and kernels support both , it its totally possible , to say in aroma , pick which fs you want formatted , again you would lose your sdcard each time you switch but there's no way around it . just thinking outloud but I need to find out how I can have the install script format the data partition and mount it f2fs. Thats where its at

    Sent from my Galaxy Nexus using Tapatalk