[DEPRECATED] [Module/Tool] [2018.10.9] F2FS Loopback Bug Workaround -- No Kernel Patch Needed

Worked?

  • Yes

    Votes: 53 58.2%
  • No

    Votes: 38 41.8%

  • Total voters
    91
Search This thread

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
THIS PROJECT IS NO LONGER SUPPORTED.


# F2FS Loopback Bug Workaround
## README.md
### Copyright (C) 2017-2018, VR25 @ xda-developers
#### License: GPL v3+



---
#### DISCLAIMER

This software is provided as is, in the hope that it will be useful, but without any warranty. Always read/reread this reference prior to installing/upgrading. While no cats have been harmed, I assume no responsibility under anything which might go wrong due to the use/misuse of it.

A copy of the GNU General Public License, version 3 or newer ships with every build. Please, read it prior to using, modifying and/or sharing any part of this work.

To prevent fraud, DO NOT mirror any link associated with this project; DO NOT share ready-to-flash-builds (zips) on-line!



---
#### DESCRIPTION

Some kernels from devices with F2FS-formatted data partition (i.e., Motorola) have a bug which prevents loopback devices (.img files) from being mounted read-write. This limits systemless modifications that can otherwise be achieved with Magisk.

This module works by moving magisk.img to the cache partition (EXT[2-4]-formatted) and linking it to its actual location (i.e., /data/adb/magisk.img). The other half of the process consists on automatically recreating magisk_merge.img shortly after boot and handling it the same way as magisk.img.

With this workaround, a patched kernel is dispensable.

Cache partition's size is essentially the only limiting factor -- and that's pretty much self-explanatory.

/cache/magisk_.img is automatically backed up to/data/adb on boot (only if modified) & restored on install. Thus, whenever cache is wiped, magisk_.img and its respective symlink can easily be restored by simply reinstalling the module.



---
#### PRE-REQUISITES

- Magisk v15+
- F2FS-formatted data partition
- EXT[2-4]-formatted cache partition



---
#### SETUP STEPS

Fist time
- Install from custom recovery as a regular flashable zip.


Upgrades
- Install from Magisk Manager or custom recovery.
- Reinstall after cache wipes to restore magisk.img backup.



---
#### NOTES/TIPS

Always install large modules from custom recovery only. In fact, I recommend installing every module from recovery if your device's cache partition has a very small size (i.e., only a few Megabytes).

To revert changes, uninstall the module, boot into custom recovery and delete </data/adb/magisk.img> & <magisk.img.bkp>. Lastly (while still in custom recovery), move </cache/magisk_.img> to </data/adb/magisk.img>.

Updates and reinstalls can be carried out from Magisk Manager as well.



---
#### ONLINE SUPPORT

- [Facebook Support Page](https://facebook.com/VR25-at-xda-developers-258150974794782/)
- [Git Repository](https://github.com/Magisk-Modules-Repo/f2fs-loopback-bug-workaround/)
- [XDA Thread](https://forum.xda-developers.com/apps/magisk/guide-magisk-official-version-including-t3577875/)



---
#### RECENT CHANGES

**2018.10.9 (201810090)**
- Bug fixes
- Latest module template, with added sugar.
- Magisk 15-17.2 support
- Updated documentation

**2018.9.2 (201809020)**
- Improved compatibility
- Major optimizations
- Updated documentation

**2018.8.1 (201808010)**
- General optimizations
- Striped down (removed unnecessary code & files)
- Updated documentation

**2018.7.24 (201807240)**
- Fixed modPath detection issue (Magisk V16.6).
- Updated documentation
 

Attachments

  • Screenshot_20170322-183845.png
    Screenshot_20170322-183845.png
    84.9 KB · Views: 11,518
  • f2fs-loopback-bug-workaround-2017.12.31.zip
    17.2 KB · Views: 2,991
  • f2fs-loopback-bug-workaround-2018.1.1.zip
    18 KB · Views: 886
  • f2fs-loopback-bug-workaround-2018.1.14.zip
    19.2 KB · Views: 603
  • f2fs-loopback-bug-workaround-2018.1.24.zip
    19.3 KB · Views: 571
  • f2fs-loopback-bug-workaround-2018.1.31.zip
    20 KB · Views: 9,843
  • f2fs-loopback-bug-workaround-2018.7.24.zip
    20.3 KB · Views: 973
  • f2fs-loopback-bug-workaround-2018.8.1.zip
    18.7 KB · Views: 6,485
  • f2fsfix-2018.9.2.zip
    20.3 KB · Views: 5,133
  • f2fsfix-2018.10.9.zip
    20.5 KB · Views: 10,513
Last edited:

mhp1995

Senior Member
Jan 5, 2014
481
476
New Delhi
Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...
 

ErwinP

Senior Member
Oct 6, 2010
602
865
33
DISCLAIMER
Not taking responsibility for any thermonuclear war or cat harm. Do it at your any risk.

NEEDED
[Unlocked Bootloader] https://youshouldknowthisbynow.com
[Latest TWRP] https://forum.xda-developers.com/mo...recovery-unofficial-twrp-moto-z-play-t3495629 credits @Alberto97
[Latest FSFS patched Kernel] https://forum.xda-developers.com/moto-z-play/development/kernel-stock-kernel-f2fs-patched-t3546732 credits @tomparr
[Latest Magisk zip] https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 credits @topjohnwu
[Latest Magisk Manager app] https://play.google.com/store/apps/details?id=com.topjohnwu.magisk&hl=en credits @topjohnwu

PROCEDURE
0. reboot bootloader
1. fastboot boot twrp.img
2. adb sideload fsfs patched kernel
3. adb sideload magisk
4. reboot system
5. install magisk manager from play store
6. reboot bootloader [yes, again]
7. fastboot boot twrp.img [yes, again]
8. adb sideload magisk [yes, again]
9. reboot system [yes, ag... you get the point]
10. open magisk manager settings, enable "magisk hide"
11. reboot, done

Works like a charm.
I however did not temporarly boot into TWRP, I flashed it as such.

does this work on nougat update or only on MM?
I'm on Android 7.0 Nougat.


Thanks!
Erwin
 
  • Like
Reactions: lolifer and mhp1995

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
My cat lost two and half lives because of this thread. Sadly, the disclaimer is in order, so I can't sue. :(
Hopefully your cat is ok now :p

Is this for Nougat or Marshmallow?
does this work on nougat update or only on MM?
Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...
It should work on both Marshmallow and Nougat, as long as you pick the appropriate kernel for your system version (6 or 7). @mhp1995, I don't think the software channel matters. It should work across all (retus, retin , reteu, etc.).

Anybody know how to fix notifications without breaking safety net?
No idea at this point, man. I've never had to fix mine. Perhaps only some people have it...? :confused:

@erwin, I chose not to touch the stock recovery to keep OTA installations straightforward. Easy for everyone. :cowboy:
 

mhp1995

Senior Member
Jan 5, 2014
481
476
New Delhi
one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks :)
 
Last edited:

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks :)
There are specific versions of these modified for systemless root. DO NOT install the standard versions. You should follow the instructions given in Magisk Manager app to download and install.
 
  • Like
Reactions: mhp1995

mhp1995

Senior Member
Jan 5, 2014
481
476
New Delhi
There are specific versions of these modified for systemless root. DO NOT install the standard versions. You should follow the instructions given in Magisk Manager app to download and install.

Ok :good: I think xposed is not available at the moment for nougat ..Its WIP....If possible when the time comes try to include installing xposed via Magisk tutorial in this thread too.... Coming to the posts, u mind if i add this rooting tutorial in my all-in-one thread? Of course credits will be given :)
 

VR25

Senior Member
Apr 20, 2013
1,930
4,698
github.com
Ok :good: I think xposed is not available at the moment for nougat ..Its WIP....If possible when the time comes try to include installing xposed via Magisk tutorial in this thread too.... Coming to the posts, u mind if i add this rooting tutorial in my all-in-one thread? Of course credits will be given :)
Oh, yes the availability... I forgot to mention that. Hopefully a proper Xposed version will be available for nougat very soon. When that happens, I'll update the thread.

About adding the tutorial to your thread... sure, go ahead.
 

sebx_g1

Senior Member
Nov 6, 2009
2,925
708
I honestly declare I didn't read whole thread - is this method work for stock Nougat rom - I need root for Titanium Backup only for now , since facebook messenger goes crazy on my new phone MZP :-/ . Or maybe there is a way to restore old conversations ,not restored automatically in Facebook Messenger - anybody knows how to do it ? . On every phone I had I used root for two things mainly - Titanium Backup and to block adds - dns66 do block adds very well without root but , Titanium Backup has no alternative for me .
 

tag68

Senior Member
Nov 25, 2014
1,019
360
Moto G 2014
Moto X Play
Just for the records: Magisk 12 release works fine.
@sebx_g1 incredible 2 pages! That are more than 10 postings! Sure nobody can read so much. And nearly all ask or answer your question, but it is just too much ...
 

sebx_g1

Senior Member
Nov 6, 2009
2,925
708
Just for the records: Magisk 12 release works fine.
@sebx_g1 incredible 2 pages! That are more than 10 postings! Sure nobody can read so much. And nearly all ask or answer your question, but it is just too much ...
[emoji4] but voting is only 3 works 2 not, so?

Wysłane z mojego XT1635-02 przy użyciu Tapatalka
 

tag68

Senior Member
Nov 25, 2014
1,019
360
Moto G 2014
Moto X Play
What is expected to be done for next OTA to work? Just restore Nandroid backup of boot partition and everything should be ready for patchlevel newer than January 2017, right? And afterwards f2fs fixed kernel and Magisk again for having root again of course.

(twrp not flashed, no logo modified, system should be untouched)

---------- Post added at 09:14 PM ---------- Previous post was at 09:11 PM ----------

[emoji4] but voting is only 3 works 2 not, so?
Xposed does not work on Nougat by now. Magisk does. The 2 negative votes you counted referred to Xposed ;)
 
Last edited:

sebx_g1

Senior Member
Nov 6, 2009
2,925
708
DNS66 do the same what do adblock, you can use it without root. But yes, there is special version of adblock systemless.

Wysłane z mojego XT1635-02 przy użyciu Tapatalka
 

Top Liked Posts

  • There are no posts matching your filters.
  • 42
    THIS PROJECT IS NO LONGER SUPPORTED.


    # F2FS Loopback Bug Workaround
    ## README.md
    ### Copyright (C) 2017-2018, VR25 @ xda-developers
    #### License: GPL v3+



    ---
    #### DISCLAIMER

    This software is provided as is, in the hope that it will be useful, but without any warranty. Always read/reread this reference prior to installing/upgrading. While no cats have been harmed, I assume no responsibility under anything which might go wrong due to the use/misuse of it.

    A copy of the GNU General Public License, version 3 or newer ships with every build. Please, read it prior to using, modifying and/or sharing any part of this work.

    To prevent fraud, DO NOT mirror any link associated with this project; DO NOT share ready-to-flash-builds (zips) on-line!



    ---
    #### DESCRIPTION

    Some kernels from devices with F2FS-formatted data partition (i.e., Motorola) have a bug which prevents loopback devices (.img files) from being mounted read-write. This limits systemless modifications that can otherwise be achieved with Magisk.

    This module works by moving magisk.img to the cache partition (EXT[2-4]-formatted) and linking it to its actual location (i.e., /data/adb/magisk.img). The other half of the process consists on automatically recreating magisk_merge.img shortly after boot and handling it the same way as magisk.img.

    With this workaround, a patched kernel is dispensable.

    Cache partition's size is essentially the only limiting factor -- and that's pretty much self-explanatory.

    /cache/magisk_.img is automatically backed up to/data/adb on boot (only if modified) & restored on install. Thus, whenever cache is wiped, magisk_.img and its respective symlink can easily be restored by simply reinstalling the module.



    ---
    #### PRE-REQUISITES

    - Magisk v15+
    - F2FS-formatted data partition
    - EXT[2-4]-formatted cache partition



    ---
    #### SETUP STEPS

    Fist time
    - Install from custom recovery as a regular flashable zip.


    Upgrades
    - Install from Magisk Manager or custom recovery.
    - Reinstall after cache wipes to restore magisk.img backup.



    ---
    #### NOTES/TIPS

    Always install large modules from custom recovery only. In fact, I recommend installing every module from recovery if your device's cache partition has a very small size (i.e., only a few Megabytes).

    To revert changes, uninstall the module, boot into custom recovery and delete </data/adb/magisk.img> & <magisk.img.bkp>. Lastly (while still in custom recovery), move </cache/magisk_.img> to </data/adb/magisk.img>.

    Updates and reinstalls can be carried out from Magisk Manager as well.



    ---
    #### ONLINE SUPPORT

    - [Facebook Support Page](https://facebook.com/VR25-at-xda-developers-258150974794782/)
    - [Git Repository](https://github.com/Magisk-Modules-Repo/f2fs-loopback-bug-workaround/)
    - [XDA Thread](https://forum.xda-developers.com/apps/magisk/guide-magisk-official-version-including-t3577875/)



    ---
    #### RECENT CHANGES

    **2018.10.9 (201810090)**
    - Bug fixes
    - Latest module template, with added sugar.
    - Magisk 15-17.2 support
    - Updated documentation

    **2018.9.2 (201809020)**
    - Improved compatibility
    - Major optimizations
    - Updated documentation

    **2018.8.1 (201808010)**
    - General optimizations
    - Striped down (removed unnecessary code & files)
    - Updated documentation

    **2018.7.24 (201807240)**
    - Fixed modPath detection issue (Magisk V16.6).
    - Updated documentation
    7
    Been out for a while due to random internet access issues.

    I skimmed through what's been discussed lately... found something curious: putting Magisk images in /storage/emulate as opposed to /cache. Unfortunately that won't work. The emulated storage is not available early enough to accommodate Magisk -- in fact, it's not even close.

    That's an interesting attempt, though. It may be possible to use ESDFS, SDCARDFS, FUSE or any other mechanism to emulate an alternate path for Magisk images early enough. This would in turn kill the need for F2FS fix and size limits altogether. That has to be done by Magisk itself before the image gets mounted.

    I'll study the possibilities. @topjohnwu, you might find this relevant as well.


    ------------------------
    Will talk about other subjects later. Currently, I don't have much free time.

    P.S., the module automatically checks whether cache is EXT4-formatted.
    7
    **2018.10.9 (201810090)**
    - Bug fixes
    - Latest module template, with added sugar.
    - Magisk 15-17.2 support
    - Updated documentation


    Notes

    I'm on Magisk 17.2 and it's not executing this module's service.sh script.

    How do I know this service.sh thing isn't broken?
    - It does everything it's expected to when executed manually!

    So, until I find out why Magisk isn't working properly (for me at least), install ALL Magisk stuff from custom recovery only!

    Latest systemless Xposed is also misbehaving on Magisk 17.2, whether or not this module is installed.

    I don't need an F2FS-patched kernel, nor this module, BTW. Doing this purely for you guys out there who do. Thanks.
    7
    NOTICE

    Do not use Magisk versions 16.7, 17.0, or 17.1. Recent user reports suggest these have major bugs which prevent several modules from working properly. Stay on 16.6 for now and you'll be fine.
    6
    Everyone,

    Our prayers have been heard - FINALLY!

    Magisk is going image-less. Pre-release builds already deprecated EXT4 images.

    That means the F2FS bug will no longer break Magisk's functionality.

    It has been a nice ride. This module will die soon. If I have time, I'll push one last, R.I.P. update.

    Thanks