[KERNEL] Nexus 5 F2FS

Search This thread

francescobabbaro

Senior Member
Nov 20, 2012
136
13
Salerno
Hi guys, sorry, but this is the first time I read about F2FS, and I would change my formattation to this one. I have searched, but I haven't found anything, and I ask to you:
1) The OP guide is usable with lollipop?
2) Which kernel should I use?
3) Could I come back to EXT4 if I would?
Thanks a lot, and sorry again for these stupid questions.
 

Pretoriano80

Senior Member
Jun 9, 2010
3,259
2,950
Hi guys, sorry, but this is the first time I read about F2FS, and I would change my formattation to this one. I have searched, but I haven't found anything, and I ask to you:
1) The OP guide is usable with lollipop?
2) Which kernel should I use?
3) Could I come back to EXT4 if I would?
Thanks a lot, and sorry again for these stupid questions.
First make sure you have latest official TWRP installed, it supports F2FS by default.
Then on the previous page you can find an explanation on how to start using F2FS (by dechronic).


You can switch back to EXT 4 anytime but make sure you backup your data first because the internal partition will be completely wiped.
 
  • Like
Reactions: francescobabbaro

francescobabbaro

Senior Member
Nov 20, 2012
136
13
Salerno
First make sure you have latest official TWRP installed, it supports F2FS by default.
Then on the previous page you can find an explanation on how to start using F2FS (by dechronic).


You can switch back to EXT 4 anytime but make sure you backup your data first because the internal partition will be completely wiped.
Ah, thanks. A final question, more in general: I have to format in F2FS /system too, to have a better result? Or /data and /cache are enough? Thanks a lot.
 

dechronic

Senior Member
Dec 7, 2013
601
582
Ah, thanks. A final question, more in general: I have to format in F2FS /system too, to have a better result? Or /data and /cache are enough? Thanks a lot.

I have been told and seen test scores that show that there is no real advantage to changing the /system partition to f2fs as it used only for reading and not writing too. All the writing is usually done on the /cache and /data partitions. In addition, if you do change to the /system to f2fs you may find out like I did that the stock Lollipop rom will no longer fit on the partition, only custom roms with smaller than full GApps package.
 
  • Like
Reactions: francescobabbaro

davidshen84

Senior Member
Dec 11, 2010
104
5
I have a Nexus 5, oem unlocked.

I flashed the latest TWRP: http://techerrata.com/file/twrp2/hammerhead/openrecovery-twrp-2.8.5.2-hammerhead.img
Wipe data, and format both system and data to F2FS
And flashed CM nightly: cm-12-20150302-NIGHTLY-hammerhead.zip
Then I flashed you CM_F2FS.zip
Reboot the system...

My phone will show the Google logo, then reboot into recovery boot...can you help?


Thanks,
David

---------- Post added at 02:18 PM ---------- Previous post was at 01:36 PM ----------

This is odd...when doing sidelide, I saw this:

detected filesystem f2fs .../by-name/system
(after some time)
detected filesystem ext4 .../by-name/system

So installing CM will automatically format /system to ext4. Is it correct? I read some other post, and I think /system should also be f2fs.


Thanks,
David
 

dechronic

Senior Member
Dec 7, 2013
601
582
I have a Nexus 5, oem unlocked.

I flashed the latest TWRP: http://techerrata.com/file/twrp2/hammerhead/openrecovery-twrp-2.8.5.2-hammerhead.img
Wipe data, and format both system and data to F2FS
And flashed CM nightly: cm-12-20150302-NIGHTLY-hammerhead.zip
Then I flashed you CM_F2FS.zip
Reboot the system...

My phone will show the Google logo, then reboot into recovery boot...can you help?


Thanks,
David

---------- Post added at 02:18 PM ---------- Previous post was at 01:36 PM ----------

This is odd...when doing sidelide, I saw this:

detected filesystem f2fs .../by-name/system
(after some time)
detected filesystem ext4 .../by-name/system

So installing CM will automatically format /system to ext4. Is it correct? I read some other post, and I think /system should also be f2fs.


Thanks,
David

I used to format my /system to f2fs when the OS could still fit with all the GApps. However some further reading and seeing test results there is no noticeable improvement to a read only partition like /system so it is not necessary but a preference to convert it to f2fs and only if your OS and system apps have the available space.
Most, if not all custom ROMs usually format the /system partition to their desired file system for the particular device. For the Nexus 5 it is EXT4. To get around that the procedure was to edit the updater-script to format the partition(s) to f2fs and to mount them with busybox so the files could placed in the relevant partitions. However, while using a ROM (Beanstalk) based on CM12 that didn't always work because on the first boot the /cache partition was formatted as EXT4 which caused crashes on first boot.
To get around that I left all partitions as EXT4 for the first or until everything was setup the way I wanted and then made a Nandroid backup, copied it to my PC, formatted the /data and / cache partitions to f2fs, copied back the nandroid backup to the SD card and restore everything, which just gave a warning from TWRP that the previous data was from a EXT4 partition.
It will then boot and run normally without crashes.
Note: For f2fs is recommended that the /data and /cache partitions be formatted as f2fs as f2fs speed improvements are seen with writing, exactly what those two partitions do a lot of.
 
  • Like
Reactions: Mattymat

davidshen84

Senior Member
Dec 11, 2010
104
5
Hi dechronic,

Thanks, but my real problem is that my system won't boot if any partition is F2FS format. I tried a lot situations, and here's what I got:

- format /data to f2fs
- format /cache to f2fs
- install official CM 12
- DO NOT install CM_F2FS.zip
- **system boot to CM logo and stay forever**

- format /data to f2fs
- format /cache to EXT4
- install official CM 12
- DO NOT install CM_F2FS.zip
- **system boot and ask me for password**, according to what internet says, it is because it cannot read /data and think it is encrypted

- format /data to f2fs
- format /cache to EXT4
- install official CM 12
- install CM_F2FS.zip
- **system auto reboot to recovery**

What am I missing?


Thanks,
David
 

cocchiararo

Senior Member
Sep 11, 2007
3,025
429
40
Escobar
Am i blind, or you skipped the correct way (format both to f2fs, install ROM and the f2fs stuff, check partitions are still f2fs, reboot.

Nexus 5 - Tapatalk
 

dechronic

Senior Member
Dec 7, 2013
601
582
Hi dechronic,

Thanks, but my real problem is that my system won't boot if any partition is F2FS format. I tried a lot situations, and here's what I got:

- format /data to f2fs
- format /cache to f2fs
- install official CM 12
- DO NOT install CM_F2FS.zip
- **system boot to CM logo and stay forever**

- format /data to f2fs
- format /cache to EXT4
- install official CM 12
- DO NOT install CM_F2FS.zip
- **system boot and ask me for password**, according to what internet says, it is because it cannot read /data and think it is encrypted

- format /data to f2fs
- format /cache to EXT4
- install official CM 12
- install CM_F2FS.zip
- **system auto reboot to recovery**

What am I missing?


Thanks,
David

Situation 1. No kernel with F2FS support installed.
Situation 2. No kernel with F2FS support installed.
Situation 3. Kernel with F2FS for Android 4.4 and probably cache needs to be f2fs too.

You are missing using a kernel with f2fs support for the correct Android version and the correct entries in the ramdisk.

I have downloaded the lastest CM12 nightly and looked at the updater script. It mounts both the /system and /data during installation (and most likely for the first boot)


To use CM12 with f2fs you need to:
  1. Download the attachement from this post
  2. Download Stock/AOSP (Android 5.0.1/5.0.2) ElementalX-N5-2.10 from here -> http://elementalx.org/devices/nexus-5/ (Yes it works with CM12 as it is still AOSP)
    Thread for ElementalX (linked for info/credit purposes)
  3. Format everything to EXT4 first.
  4. Install the CM12 ROM.
  5. Completely boot the ROM at least once. Make any changes and apply any settings if you wish.
  6. Reboot to TWRP recovery.
  7. Make a Nandroid Backup of the /system and /data partitions (/system is not needed but in case you mess up something you won't have to do Steps 3 -5 again)
  8. Move the Nandroid Backup to your PC.
  9. Format the /data and /cache partitions to f2fs
  10. Copy the Nandroid backup from the computer back to the same TWRP folders (make a Nandroid backup of the boot parition if necessary to recreate the folders)
  11. Restore the /data partition from the backup. You should get a warning that the backup was originally from an EXT4 partition.
  12. Double check that the /data and /cache partitions are sitll f2fs in the Wipe -> Advanced Wipe -> Select Partition -> FS Options -> Current File System
  13. If /data and /cache are still f2fs, sideload the Stock_f2fs_cache+data.zip (a dummy kernel with f2fs entries, necessary for ElementalX kernel). Do NOT reboot the phone yet.
  14. Immediately sideload the ElementalX kernel and follow the Aroma installer to setup the kernel to your liking.
  15. Finally, reboot the phone and it should boot into CM12 with the /data and /cache as f2fs.
 
Last edited:
  • Like
Reactions: Mattymat

davidshen84

Senior Member
Dec 11, 2010
104
5
Thanks dechronic,

I followed your steps and made good progress...but still can not get a working system.

First, I followed exactly your steps. The system booted, but I constantly got this "System UI" stopped error.

Then I tried with a clean /data. This time I got "Setup Wizard" stopped error...

Either way, the system can boot, but some basic apps won't work. Any suggestions?


Thanks,
David
 

dechronic

Senior Member
Dec 7, 2013
601
582
Thanks dechronic,

I followed your steps and made good progress...but still can not get a working system.

First, I followed exactly your steps. The system booted, but I constantly got this "System UI" stopped error.

Then I tried with a clean /data. This time I got "Setup Wizard" stopped error...

Either way, the system can boot, but some basic apps won't work. Any suggestions?


Thanks,
David

When I used Beanstalk which is based on CyanogenMod I had similar issues. That's why I suggested that lengthy procedure.

I am trying to remember which order I installed the GApps in. I think I booted into the OS for the first time then rebooted to recovery and installed the GApps. Booted to OS and then when I knew everything was working as it should, I did a nandroid backup moved to PC, formatted to f2fs, etc., etc.
 

davidshen84

Senior Member
Dec 11, 2010
104
5
ahhh~the order matters? ok, that's complicate. why can't CM just support f2fs by default...thanks a lot. I will try figure out the magic order.
 

Dodgexander

Senior Member
Mar 31, 2013
627
168
The attachement in this post has an unbootable stock 5.1 kernel with f2fs entries in the ramdisk for data + cache for use with ElementalX 2.11 (Android 5.1) for those that use f2fs.

Is this dummy kernel solely for elemental x? Is it possible to add f2fs support to any kernel?

I'm using PA 5 currently and have to choose between Franco (to use themes) and a f2fs specific kernel like uber (to use f2fs). Sadly its one or the other, not both. Asfaik no f2fs kernel currently support the theme engine in aosp ROMs.

Sent from my Nexus 5 using XDA Free mobile app
 

dechronic

Senior Member
Dec 7, 2013
601
582
Is this dummy kernel solely for elemental x? Is it possible to add f2fs support to any kernel?

I'm using PA 5 currently and have to choose between Franco (to use themes) and a f2fs specific kernel like uber (to use f2fs). Sadly its one or the other, not both. Asfaik no f2fs kernel currently support the theme engine in aosp ROMs.

Sent from my Nexus 5 using XDA Free mobile app

It will work for UBER too as it uses the ramdisk of the previous kernel last time I checked. It has been a month or two since I did.

Either way. Backup your current kernel in TWRP before trying so that if you have any issues you can revert back to your backup.
 
  • Like
Reactions: Dodgexander

Dodgexander

Senior Member
Mar 31, 2013
627
168
It will work for UBER too as it uses the ramdisk of the previous kernel last time I checked. It has been a month or two since I did.

Either way. Backup your current kernel in TWRP before trying so that if you have any issues you can revert back to your backup.

Thanks. UBER is working fine with f2fs already, I am hoping to find a kernel with both cm12 theme engine support in aosp and with f2fs support.

Sent from my Nexus 5 using XDA Free mobile app
 

Mohamed Yaser

Senior Member
Nov 29, 2013
1,837
1,526
Can any one simply Tell me what advantage of F2FS

Sent from my Nexus 5 CAF using XDA Premium 4 mobile app
 

Top Liked Posts