yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Original Android Development] drac0:
Sure bud no problem, glad you got it all set up and working! :good:

Regarding the update, well I'm also wondering how to set it up cos there's already a word that Google is pushing 5.1 in Feb, so thats my next focus, how to update system so my f2fs partitions dont suffer. I'm guessing you can just dirty flash your ROM, then the dummy kernel and then your f2fs kernel. :confused:
[Nexus 5 Original Android Development] Wakamatsu:
For f2fs data/cache only, yes, you have to reflash the kernel each time you update. You won't lose f2fs formatting, the non-f2fs kernel of the stock rom simply won't find the proper mount points.

For f2fs-all, updating is a little bit more complicated.
[Nexus 5 Original Android Development] dechronic:
For flashing a custom ROM to a f2fs partition there are two ways.

1. Using the ROM Converter I have in my thread to change a few lines in the updater-script so it mounts a pre-formatted /system as f2fs so it can install correctly. Then flash your preferred kernel that has f2fs support with the ramdisk modified to mount the partitions as f2fs, ext4 or f2fs-all.

2. If you ROM is already running on /system using EXT4, backup using TWRP, rename the backup file part from ext4 to f2fs and restore so it will format the /system partition as f2fs and restore the system data and then flash your preferred f2fs supported kernel with the ramdisk to match your f2fs and ext4 partitions.
[Nexus 5 Original Android Development] drac0:
1. Link to Linux version or how to manually edit the updater-script?

2. How is this done manually with stock image Lollipop if the /system is already configured with f2fs? (5.0.1 > 5.1)

3. For F2FS-ALL system needs selinux to permissive? Any system-wide hiccups, bugs, reboots?
[Nexus 5 Original Android Development] dechronic:
1. I provide some instructions in the first post of my thread found here: http://xdaforums.com/google-nexus-5/development/nexus-5-f2fs-tools-t2801977

Thanks to [MENTION=4668017]NABENDU1[/MENTION] for the orignal for the Script Tool to convert a ROM's updater-script to mount the /system and /data for installation.

I believe there is a Linux version in his thread as well. Check it out here: http://xdaforums.com/showthread.php?t=2731666

If not, make the following changes in the updater-script:

Change mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system"); to run_program("/sbin/busybox", "mount", "/system");
and change mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data"); to run_program("/sbin/busybox", "mount", "/data");

2. The problem with this (at least on my Nexus 5) is that /system partition does not have enough space to convert to f2fs and to place the stock Lollipop image on it as f2fs uses a bit of space which will require the removal of 100MB of apps, etc. to make it fit.

If it did fit, all that would need to be done was to flash the system image back up the /system partition in TWRP, rename the part of the backup file that says EXT4 and change it to F2FS then restore it. TWRP will then format the partition to F2FS and restore the files to the /system partition. Then all you would need is a kernel (boot.img) with f2fs to mount it correctly.

3. SELinux is not affected or nor does it affect the type of file system used. The kernel mounts the file system based on what is in the ramdisk and provided the required files to read and write the file system are present. Technically, if a kernel supported it, it could mount the partition as F2FS, EXT4, EXT3, EXT2, NTFS, FAT, exFAT, HPFS+, etc.. As Android is Linux based it has usually used EXT based file systems and FAT.

F2FS was created by an employee of Samsung named Jaegeuk Kim. He is still improving upon it. Howver, not all custom kernel developers always provide the latest updates. It may have to be requested.

To know more about why it was created anyone can read Jaegeuk Kim's write up about it here --> https://github.com/torvalds/linux/blob/master/Documentation/filesystems/f2fs.txt

or on Wikipedia here --> http://en.wikipedia.org/wiki/F2FS
[Nexus 5 Original Android Development] drac0:
Wow man thanks a lot for your extensive reply! :good:

I have read most of the stuff you've mentioned, thanks for the links and the code, also did a bit research on F2FS and saw even [MENTION=4668017]NABENDU1[/MENTION] said F2FS its not really helpful on the system partition since /system is a RO partition, so if you format /data into F2FS you'll be at the same performance level as with the /system one. And that's more than helpful to me.

For now I'm using franco.Kernel with both data/cache turned to F2FS and its really smooth and blazing fast, one can clearly see the difference in app opening and working, battery life is also amazing, so for now will stay with it and test for some time and just see what happens. Then maybe I will try Code_Blue kernel and try to compare both kernels. Regarding F2FS updates I guess we just have keep our fingers crossed or to request our dear custom kernel devs to implement them! :D

Cheers!
[Nexus 5 Original Android Development] Pretoriano80:
Hey mate, which mount options you are using for f2fs is fstab (discard, error=panic or something else)? Also i heard that in current development state fsck.f2fs can only detect errors but still no error repair capability, is that true?

Btw, thx for porting f2fs to N5, not sure if it's needed with this device but at least we have more to choose.
[Nexus 5 Original Android Development] dennes544:
If you are active using OmniROM, wait please ;) Very soon i release OmniRom's(AOSP) kernel with f2fs
[Nexus 5 Original Android Development] dennes544:
https://github.com/dennes544/androi...mmit/a947b29ed4fead6618e358cdc0314916639fa024 that fstab

Actually i don't know about fsck.f2fs, sorry
[Nexus 5 Original Android Development] dennes544:
AOSP kernel released :victory: :laugh:
[Nexus 5 Original Android Development] ed2975:
Not wrong just two ways of doing the same thing right? I find on those rare occasions when TWRP can't format properly the fastboot erase is the nuclear option
[Nexus 5 Original Android Development] memnoc:
To be clear, the recovery in op will work as a normal twrp recovery plus it has the patch to use f2fs, or you forced to reflash a normal twrp to use any other rom as usual?

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 Original Android Development] dennes544:
You can install now any another rom (with kernes for cm(based) and aosp(based)), but if you don't wanna use f2fs you should reflash twrp
[Nexus 5 Original Android Development] memnoc:
Gotcha

Flashify would do the job right?

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 Original Android Development] juntulis:
What does this patch do to us mortals?
[Nexus 5 Original Android Development] memnoc:
More dynamic and fast file system for your data partition

Inviato dal mio Nexus 5 utilizzando Tapatalk
[Nexus 5 Original Android Development] juntulis:
How can it still be faster then fast :eek:
[Nexus 5 Original Android Development] CrypticRook:
Any tips for mounting to Windows?
[Nexus 5 Original Android Development] dennes544:
No. Just connect to PC and browse your files)
[Nexus 5 Original Android Development] CrypticRook:
Probably just my old pc bugging out then. I'll keep trying
[Nexus 5 Original Android Development] willybarca:
faux just made an aosp kernel based on your patches but it doesnt work with any rom yet and his saying its due to the roms that are not compatible with f2fs yet, so my question is how could your kernel work with aosp roms if they are not yet compatible with f2fs
[Nexus 5 Original Android Development] dennes544:
OmniRom based on AOSP and using AOSP kernel! And I now using it. Also my AOSP kernel works with stock. If you don't trust me, you can check yourself
[Nexus 5 Original Android Development] Luigi_2:
+1 side load rom + faux kernel and it booted, told me to enter password to decrypt :(. Had to format, wipe then sideload again with ur kernel and it's good now.
[Nexus 5 Original Android Development] CrypticRook:
I'm using the aosp based kernel on PA 4.1 and all is running good. Tested faux kernel and sure enough asked for the password. Re flashed the base kernel and I'm up and running again. Gotta be a problem on his end.
[Nexus 5 Original Android Development] chrone:
Can someone care to post androbench app score for ext4 vs f2fs random read and write performance? :)

Sent from my Nexus 5
[Nexus 5 Original Android Development] Pretoriano80:
For those having issues with Faux kernel, imo it's a kernel issue (most likely a mounting issue), Roms have nothing to do with the /data partition, only /system (wich is still ext4).

Does Faux released two kernels, one with f2fs and one without it? If not he must release a separate kernel with f2fs suport and modified ramdisk (fstab.hammerhead must have the correct values for the /data partition).

Btw, flashing back a working kernel should be enough to fix the encryption issue, no need to format /data.

Sent from my Nexus 5
[Nexus 5 Original Android Development] radicspeter:
How can a go back to stock image (full ext4 as well) if i now convert my data and cache to f2fs and use optipop..
[Nexus 5 Original Android Development] nmlssit:
For data/cache only, If i want to perform a factory reset in order to clean flash a custom rom, data/cache will be formatted as ext4 or they keep f2fs?

I just used the ROM converter with Cataclysm, if i am not mistaken it converts the kernel and the updater script, and now i have this F2FS_ROM.zip.

Is this zip enough or i still need your dummy kernel?

How do i know the kernel it replaces is good for me? the "boot-f2fs-data.img" inside f2fs_kernels\hammerhead\aosp is dated 10 April 2014 :eek:

Sorry for the many questions!
[Nexus 5 Original Android Development] dechronic:
I haven't tried it yet with Cataclysm but I will try it this weekend maybe even tonight but the kernel you will definitely need to use a different kernel. You can use that as a dummy and then flash EX on top of it to see of it will boot properly.
[Nexus 5 Original Android Development] Wakamatsu:
A factory reset just blanks your data/cache so the formatting shouldn't change. Even if it did, it's a simple matter to reformat in recovery since you wanted to clear those partitions by factory reset anyway.

You're right to take notice of that kernel. That particular kernel is for KitKat so you'll need to flash the dummy kernel or use one from here:

Kernels: https://s.basketbuild.com/devs/Cl3Kener/HAMMERHEAD/F2FS/

Explanation of the different versions: https://plus.google.com/+ChetKener/posts/jgGGnRsuQiy
[Nexus 5 Original Android Development] nmlssit:
You're right. Plus i remembered there's the option "use rm -rf instead of formatting" in TWRP :)

Thanks! Bookmarked :)

I've been told updater-script only touch /system, so with f2fs-data configuration, the only thing i need to do to flash or dirty flash custom rom is to remember to flash the dummy and the f2fs compatible kernel too EDIT: Without converting the ROM. Is that correct?
[Nexus 5 Original Android Development] dechronic:
You may or may not need to. If the ROM writes to the /data partition during installation then you will need to change the line in the updater-script to mount it with busybox otherwise what you said is correct.
[Nexus 5 Original Android Development] drac0:
[MENTION=5594433]dechronic[/MENTION] can you help, I was looking at fstab flag handles, comparing various fstab handles in N5 kernels, such as dummy hammerhead F2FS cache+data fstab, franco.Kernel fstab, your modified F2FS variant and the Code_blue fstab. It turns out that /cache flags are different for hammerhead and Code_Blue kernels which are using F2FS mount flags for /cache and those are using latest F2FS handles which EXT4 cant utilize.

My question. did you changed those specific fs flags when modifying for data/cache yourself, or the kernel itself after its mount flag was recognized as F2FS?

dummy hammerhead kernel

/cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait,check

your modfied franco.Kernel

/cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check

Code_Blue kernel

/cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,inline_data,errors=recover	wait,check

Hope you're following me here, thing is I want to know which latest F2FS fs handle flags are used in various kernels, such as inline_xattr, inline_data or flush_merge, so I may check up on Kims work and suggest it to kernel devs to update if needed for testing. Does it all makes any sense? :D
[Nexus 5 Original Android Development] dechronic:
You are right the franco kernel code for the /cache partition is EXT4 for /cache to be f2fs it should be:

/cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait,check

I think I uploaded on the franco forum, two versions of the kernel. One was f2fs-data only and the other was f2fs-data+cache.

---------- Post added at 02:40 PM ---------- Previous post was at 01:57 PM ----------

F2FS Troubleshooting for Nexus 5

Causes of phones not booting when try to use f2fs is as follows.

Problem 1: Stuck on Google logo

Cause 1: The kernel does not have f2fs support or does not have the correct lines in the ramdisk to mount the /system partition. (for the correct line see below)

Cause 2: The /system partiton is not f2fs

Cause 3: There are no files in the /system partition.

Problem 2: Boots to Android but starts the setup wizard and may ask for the password to unencrypt the data

Cause 1: The kernel does not have f2fs support or does not have the correct lines in the ramdisk to mount the /data partition. (for the correct line see below)

Cause 2: The /data partition is not f2fs.

Problem 3: Stuck on the boot animation.

Cause 1: The kernel does not have f2fs support or does not have the correct lines in the ramdisk to mount the /cache partition. (for the correct line see below)

Cause 2: The /cache partition is not f2fs.

NOTE: The same is true of the above problems if you have a kernel with f2fs lines in the ramdisk and the partition is ext4 you will have the same behaviour.

For example, The kernel's ramdisk has a f2fs line for /data parition but the parition is still EXT4 which will result in Problem 2.

To check which partitions are formatted as f2fs via adb.

From your OS command prompt

adb shell "mount|grep f2fs|grep -oe /userdata -oe /system -oe /cache"

Or from an ADB shell

mount|grep f2fs|grep -oe /data -oe /system -oe /cache

Line(s) required in F2FS supported kernel's ramdisk: e.g. if data & cache are formatted as f2fs then you will only need to replace the lines for the /data and /cache.

/system partition

/dev/block/platform/msm_sdcc.1/by-name/system /system f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait

/data partition

/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,flush_merge,errors=recover wait,nonremovable,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata

/cache partition

/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait,check
[Nexus 5 Original Android Development] drac0:
Exactly the thing I was referring to, also was comparing some F2FS /cache and /data handle flags to see what others use and what benefits goes with them.

Thanks again for kind help! :good:
[Nexus 5 Original Android Development] radicspeter:
Anyone help with instructions?
[Nexus 5 Original Android Development] dechronic:
HOW TO PUT PHONE BACK TO STOCK

WARNING: DOING THIS WILL ERASE ALL DATA ON THE PHONE.

If you want a way in which you don't lose your data, just ask again.

STEP 1: Download a Nexus 5 image from here:

https://developers.google.com/android/nexus/images?hl=de#hammerhead

STEP 2: Extract it. In Windows you can use WinRAR which you can download from here: http://www.rarlab.com/download.htm

STEP 3: You will need to have the platform tools (adb, fastboot, etc.) installed with your path set to that folder or just extract the Nexus factory images into the same folder.

If you don't want to download the SDK Manager to get adb and fastboot, there is a thead with just the required tools.

See here; http://xdaforums.com/showthread.php?t=2317790

STEP 4: Unlock your bootloader, if it isn't already. WARNING: This will erase all data.

fastboot oem unlock

OR

If you have a custom recovery installed, adb sideload or download and install the Nexus Bootunlocker script provided by [MENTION=4544860]osm0sis[/MENTION] found here: http://xdaforums.com/showpost.php?p=40409356&postcount=1

STEP 5: From your bootloader, run the flash-all file based on your operating system.

STEP 6 (Optional): If you want to lock back the bootloader so it looks untouched, download a custom recovery image like TWRP and boot from the bootloader without flashing.

Note: This command can only be run on an unlocked bootloader

fastboot boot openrecovery-twrp-2.8.2.0-hammerhead.img

Adb sideload the same Nexus Bootunlocker script mentioned in Step 4. It will lock the bootloader and remove the tamper flag.

DONE
[Nexus 5 Original Android Development] cocchiararo:
Anyone knows if NXE ROM has f2fs support in the ramdisk? I want to keep using elemental x, but need a 5.0.2 ramdisk with f2fs support

Nexus 5 - Tapatalk
[Nexus 5 Original Android Development] Wakamatsu:
I posted a link to some kernels that have compatible ramdisks earlier in the thread. Flash one over the included kernel of whatever ROM you're using.
[Nexus 5 Original Android Development] dechronic:
You can use the same dummy file I posted as ElementalX uses only the ramdisk from it.
[Nexus 5 Original Android Development] cocchiararo:
It seems it won't work.

I performed a factory reset on stock 5.0 which had elemental x and your dummy file and f2fs enabled in cache and data.

Flashed nxe 7.2.2 (5.0.2 based). Flashed gapps, your dummy file, elemental x, SuperSU.

It seems my phone is now stuck on the boot animation.
[Nexus 5 Original Android Development] dechronic:
Added adb shell command to post http://xdaforums.com/showpost.php?p=57615686&postcount=588 to state which partitions are formatted as f2fs.

---------- Post added at 10:21 AM ---------- Previous post was at 10:18 AM ----------

That sounds like your cache partition is not formatted as f2fs.
[Nexus 5 Original Android Development] cocchiararo:
Ya, I was just coming back to report that cache went back to ext4 somehow, booted already.
[Nexus 5 Original Android Development] gogozx:
Off Topic, but Mega Man for life!
[Nexus 5 Original Android Development] dechronic:
Glad you got it working.

---------- Post added at 10:40 AM ---------- Previous post was at 10:40 AM ----------

+1
[Nexus 5 Original Android Development] Geo2160:
I made the switch yesterday to f2fs with optipop+ uber kernel. I had no idea the differences could be so big. Everything loads almost instantly now. Even the facebook app now loads in 3-4 seconds whereas before it took like 10-15 seconds.
[Nexus 5 Original Android Development] drac0:
Yes differences are amazing, every app is loaded in under 2 sec and instantly if already open, switching among apps too. Actually I cant find anything that even lags everything is really stupidly fast! Another device! :D Hails to F2FS and cheers for [MENTION=5594433]dechronic[/MENTION] !!!
[Nexus 5 Original Android Development] cocchiararo:
Is it worth it to chante also the system partition to F2FS?

[MENTION=5594433]dechronic[/MENTION]

Do you have a dummy file like the one for 5.0.1 on the nexus 5, but for the nexus 7? (i am also using elemental x there)
[Nexus 5 Original Android Development] dechronic:
Nexus 7 flo or grouper?
[Nexus 5 Original Android Development] cocchiararo:
mmm, i gave my brother my old grouper, so my current flo would be enough (tho he might like the boost for the old one too xD)
[Nexus 5 Original Android Development] dechronic:
I can give you the lines of code for the two tablets to modify the ramdisk. Which kernel do you plan to use on grouper & flo? I can give you a dummy file for flo for use with ElementalX but for grouper there is no ElementalX. I modified Xperience 19 kernel for my wife's grouper.

You want the dummy file for the Nexus 7 flo as f2fs-all (/system, /data & /cache) or f2fs-data+cache (self explanatory)??

The same lines are used for Nexus 5 and Nexus 7 (2013) flo. Nexus 7 grouper has a tegra3 chipset.

This is for the Nexus 7 grouper:

/dev/block/platform/sdhci-tegra.3/by-name/APP /system f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait
/dev/block/platform/sdhci-tegra.3/by-name/CAC /cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait,check
/dev/block/platform/sdhci-tegra.3/by-name/UDA /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,flush_merge,errors=recover wait,nonremovable,encryptable=/dev/block/platform/sdhci-tegra.3/by-name/MDA

This is for the Nexus 5 and Nexus 7 (2013) flo:

/dev/block/platform/msm_sdcc.1/by-name/system /system f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,flush_merge,errors=recover wait,nonremovable,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr,errors=recover wait,check

---------- Post added at 05:29 PM ---------- Previous post was at 05:25 PM ----------

I did with some ROMS., some say that it wouldn't be of benefit, but as others have seen that opening apps times are reduced with f2fs, so I figure that should also be true of system apps.

I don't have any stats for or against. Just that it takes up about 140MB for the file system of the 1GB system partition for the Nexus 5. Which means, I cannot use Google's stock system image as it would not fit. There are ROMS out there that most definittely can.

---------- Post added at 05:32 PM ---------- Previous post was at 05:29 PM ----------

Really I got on this track mostly because of the modified kernels [MENTION=4735833]kdh2834[/MENTION] provided in his thread and what he did to modify the kernels. I just read up some more to understand more and help to push it as I wanted others to enjoy the improvements I also got.
[Nexus 5 Original Android Development] cocchiararo:
mm, to much trouble, lets keep my n5 with /system in ext4 XD

I would love the FLO dummy for elementalX, grouper will be for another day.

ps: i have never modified a ramdisk, don even know where to look for it XD
[Nexus 5 Original Android Development] dechronic:
So for the dummy file for flo you want data + cache as f2fs? Or only data?
[Nexus 5 Original Android Development] cocchiararo:
data + cache

Those are easy XD
[Nexus 5 Original Android Development] dechronic:
Actually since the ramdisk is the only thing used and the commands are the same, you can use the same one for the Nexus 5 as ElementalX will only use the ramdisk of the file.