17
Guide Formatting EXT4 to F2FS without losing internal storage & data

  1. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 3, 2016

    niTe_RiDeR_Pro , Apr 3, 2016 :
    Hi everyone,
    This is a simple & easy guide on how to format ext4 to f2fs without losing any of the internal storage & data.
    Cuz, most of the MM and Nouga ROMs are having F2FS support. And F2FS has much better I/O perfomance when compared to Ext4 (it drastically boosts your read & write speeda and increases your Benchmark scores)
    Also, I did some benchmarks in cm13, with data & cache as f2fs (the results turned out pretty amazing): https://forums.oneplus.net/threads/...o-perfomance-after-formatting-to-f2fs.441177/

    IMPORTANT: F2FS is useful only if the ROM & Kernel which you are using supports F2FS (it should be written in the description in the thread of the ROM & kernel).

    Code:
    /*
    * Your warranty (may) be void.
    *
    * I am not responsible for bricked devices, dead SD cards,
    * thermonuclear war, or you getting fired because the alarm app failed. Please
    * do some research if you have any concerns about steps included in this guide
    * before formatting the phone! YOU are choosing to make these modifications, and
    * if you point the finger at me for messing up your device/losing your files,
    * I will laugh at you. :D
    *
    */
    First of all what is F2FS?
    Why F2FS is better than Ext4?
    Because, it has much better I/O perfomance when compared to Ext4. It also has much higher write speeds. It is specially meant for eMMC card & to use its full potential. See various benchmarks & comparison of Ext4 & F2FS here: http://forum.xda-developers.com/showthread.php?t=2697069

    I even got very high UX I/O Perfomance Score in AnTuTu Benchmark (much higher than my old ext4 exodus cm12 ux score) (UX Score 29513 out of total score 56581) (Sultanxda CM13 build 4.4.2016, lightning kernel, /data & /cache formatted as F2FS): https://forums.oneplus.net/threads/cm13-what-is-your-antutu-score-in-cm13.440380 (see screenshot). :D :) :cool:

    Also, I did some benchmarks in sultanxda's cm13, with data & cache as f2fs (the results turned out pretty amazing):https://forums.oneplus.net/threads/...o-perfomance-after-formatting-to-f2fs.441177/

    Why am I making a seperate guide? Isnt this very easy?
    Cuz, many people (even I before) dont know that formatting /data to f2fs would wipe the internal storage too, and at later would end up crying after losing their precious internal storage files (its very difficult to recover the lost files after formatting to f2fs). This had happened to me a few weeks ago. And this involves some other steps too. So I am making this guide so that others wont lose their precious files.
    Pre-Requisites:
    • TWRP 3.0.2/latest version (even twrp 3.0.0 would do)
    • ROM & Kernel that supports F2FS
    • Laptop/PC with ADB Drivers & ADB 1.0.32 installed (how to install adb driver & adb is given in Steps 4 & 5) & with atleast 60GB Space.
    • Working bootable OnePlus One (lol) :p & working usb cable.
    • 70% battery in your bacon atleast.
    Procedure:
    1. If you are gonna wipe /system & /data for flashing new ROM (like a new cm13 rom), then first take titanium backup of all the required stuff.
    2. Take a deep breath & Reboot to recovery mode (TWRP)
    3. In TWRP, Go to Backup >> Tick all the partitions >> Go to options tab & enable compression (this will make the backup process slower but will make the backup files smaller, optional) >> Swipe to backup >> Wait until backup gets over. Dont cancel.
    4. After the backup process is complete, go to twrp home >> Mount >> Enable MTP (if the button shows Disable MTP, that means MTP is already enabled) >> Now connect your opo to computer/laptop. In My Computer or This PC, it should show up as A0001 >> Now open the device A0001 in This PC/Computer >> Internal Storage >> Select everything (dont miss anything) >> Right click > Copy >> Now make a folder anywhere (I made it in root of C: drive) >> paste everything. This will take some time, wait till everything gets over. MTP is too slow & sometimes some files do not copy properly. Instead, do this failproof ADB method (for windows user): Install Universal ADB Driver from here (ignore if you have already installed adb)
    5. Now download minimal adb & fastboot from here >> Open the downloaded file (Its a setup wizard) >> when it asks for installation path, change the default path to "C:\adb" (without quotes) & install it.
    6. Now open command prompt & type the following one by one:
      Code:
      cd c:\adb
      adb pull -p /sdcard c:\bacon_full_backup
    7. The full backup is gonna take several minutes. When it is completed, the command prompt window at the end, should now show like this: C:\Users\{your username}>_ (blinking cursor).
      Relax, be calm, steady your heartbeats, drink some water, energy drink or some refreshments. :p :D
    8. Take a deep breath :D. Now you are ready to go! WARNING: This step will wipe your /system. But dont worry. Everything is safe in your PC. Now go to TWRP Home >> Wipe >> Advanced Wipe >> tick system (verify if your ROM & kernel supports /system as f2fs, else skip this step) >> Repair or Change File System >> Change File System >> F2FS >> Swipe to change. Now your system partition is cleanly formatted to F2FS. [@Sultanxda's CM13 does not support /system as f2fs]
    9. WARNING: This step will wipe your /data & internal storage!! (very scary). But dont worry. Everything is safe in your PC. Now go to TWRP Home >> Wipe >> Advanced Wipe >> tick data (verify if your ROM & kernel supports /data as f2fs, else skip this step) >> Repair or Change File System >> Change File System >> F2FS >> Swipe to change. Now your data partition is cleanly formatted to F2FS, & internal storage is empty (dont get freaked out, everything is in your PC!). [@Sultanxda's CM13 supports /data as f2fs, I have tested.]
    10. This step will wipe your /cache. Now go to TWRP Home >> Wipe >> Advanced Wipe >> tick cache (verify if your ROM & kernel supports /cache as f2fs, else skip this step) >> Repair or Change File System >> Change File System >> F2FS >> Swipe to change. Now your cache partition is cleanly formatted to F2FS. [@Sultanxda's CM13 supports /cache as f2fs, I have tested.]
    11. Now plug your opo into your PC & copy everything of the internal storage, which you copied erlier to your PC, back into the internal storage of OPO. This will take several minutes. MTP transfer is little slower & could give unknown errors. Instead, do the ADB method: Open a command prompt & type these commands one by one:
      Code:
      cd c:\adb
      adb push -p c:\bacon_full_backup /sdcard
    12. If you are flashing new ROM after wiping data & system, then skip the steps 13 & 14.
    13. Now go to TWRP Home >> Settings >> tick use rm -rf instead of formatting, (else while restoring the twrp backups, twrp will reformat the partitions as ext4 again)
    14. Now go to twrp home >> restore >> select the latest backup (see the date & time in the name of the backup if you have multiple backups) >> tick every partitions >> tick enable md5 verification >> Swipe to restore.
    15. Done.
    Voila! Now your device is formatted as F2FS! Enjoy the faster I/O read & write speed. :cool: :)

    I copy-pasted this guide in XDA Forum also: http://forum.xda-developers.com/oneplus-one/general/guide-formatting-ext4-to-f2fs-losing-t3352116 :)
     
    Last edited: Feb 21, 2017

    #1
  2. lokesh3440
    Honeycomb Apr 3, 2016

    lokesh3440 , Apr 3, 2016 :
    Title is misleading buddy. Switching from one file system to other still formats internal storage if you need your /data partition on fs other than earlier. I still appreciate your great efforts on writing this guide.
     

    #2
  3. nirmoyal10
    Gingerbread Apr 3, 2016

    nirmoyal10 , Apr 3, 2016 :
    i cant find in exodus, do u know if its F2FS?
     

    #3
  4. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 5, 2016

    niTe_RiDeR_Pro , Apr 5, 2016 :
    I know, but result at the end is the same. (no data & internal storage is lost) ;)
     

    #4
  5. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 5, 2016


    #5
  6. lolrepeatlol
    Jelly Bean Apr 5, 2016


    #6
    niTe_RiDeR_Pro likes this.
  7. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 5, 2016

  8. Yaznas
    Gingerbread Apr 5, 2016

    Yaznas , Apr 5, 2016 :
    Exactly
     

    #8
  9. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 5, 2016

    niTe_RiDeR_Pro , Apr 5, 2016 :
    I know, but result at the end is the same. (no data & internal storage is lost) ;)
    Anyways I cannot change the title. ;)
    Now leave that & enjoy the guide :p
     

    #9
  10. arvindautar
    Eclair Apr 11, 2016

    arvindautar , Apr 11, 2016 :
    What benefit does having /system as f2fs have over ext4 /system? -Most rom developers that recommend f2fs do not say to do it over /system....

    As far as I know this is best for performance:

    cache --> F2FS
    Internal Data -->F2FS
    System --> EXT4
     

    #10
  11. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 11, 2016

    niTe_RiDeR_Pro , Apr 11, 2016 :
    Its recommended not to format system as f2fs, cuz, most of the ROMs & kernels dont support system as f2fs, and if formatted, the OS would not boot. So Data & cache are best for f2fs.
    BTW I did some benchmarks of f2fs here: https://forums.oneplus.net/threads/...o-perfomance-after-formatting-to-f2fs.441177/
     

    #11
  12. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 11, 2016

  13. arvindautar
    Eclair Apr 11, 2016

    arvindautar , Apr 11, 2016 :
    It seems you did not answer my question. The right answer would be no benefit. Also, it would be fair to include this in your guide. There are quite some benchmarks floating around XDA which already proved this....
     

    #13
  14. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 11, 2016

    niTe_RiDeR_Pro , Apr 11, 2016 :
    I have already included a famous benchmark in xda, in my thread. Read carefully.
     

    #14
  15. cnl
    Honeycomb Apr 12, 2016


    #15
  16. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 12, 2016

    niTe_RiDeR_Pro , Apr 12, 2016 :
    It supports /data & /cache as f2fs (@Abdel-1993 tested this in COS12.1 & said that it works), but I highly doubt whether the/system partition supports too. Thats highly expiremental.
    But its OK formatting system as f2fs, cuz anyways you are taking a full nandroid backup & copying the internal storage to your PC. So just try, if it fails to boot (if it bootloops, or gets stuck in logo, etc.) then DONT TICK / untick use rm -rf instead of formatting & restore system partition. :)

    @Abdel-1993 Could you please tell us once more whether /data & /cache worked for you, & also, did you format system as f2fs & it worked? Thanks BTW.
     

    #16
    cnl likes this.
  17. cnl
    Honeycomb Apr 12, 2016

    cnl , Apr 12, 2016 :
    Thanks for the info mate :)
     

    #17
  18. myworld122
    Eclair Apr 13, 2016

    myworld122 , Apr 13, 2016 :
    i got "remote object '\sdcard' does not exist" error when trying to execute the adb pull... weird cos i can clearly see the folder in file manager on the phone.. any help?
     

    #18
  19. Nicodoc
    Gingerbread Apr 13, 2016

    Nicodoc , Apr 13, 2016 :
    Remove the "/" on the line, only write "sdcard". That worked for me
     

    #19
  20. niTe_RiDeR_Pro
    Ice Cream Sandwich Apr 13, 2016

    niTe_RiDeR_Pro , Apr 13, 2016 :
    Its not \sdcard, its /sdcard. Theres a difference. Please read carefully ;)
     

    #20