• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Magisk Lagging issue [Fix]

Search This thread

Phantom010

Member
Jul 22, 2020
26
1
Birtamod
What to do after input command ?

/system/bin/sh: help: inaccessible or not found
127|:/ # su
:/ # su
:/ # cp /sdcard/magisklagfix.sh
cp: Need 2 arguments (see "cp --help")
1|:/ # cp --help
usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST

Copy files from SOURCE to DEST. If more than one SOURCE, DEST must
be a directory.
-v Verbose
-s Symlink instead of copy
-r Synonym for -R
-n No clobber (don't overwrite DEST)
-l Hard link instead of copy
-d Don't dereference symlinks
-a Same as -dpr
-P Do not follow symlinks [default]
-L Follow all symlinks
-H Follow symlinks listed on command line
-R Recurse into subdirectories (DEST must be a directory)
-p Preserve timestamps, ownership, and mode
-i Interactive, prompt before overwriting existing DEST
-F Delete any existing destination file first (--remove-destination)
-f Delete destination files we can't write to
-D Create leading dirs under DEST (--parents)
--preserve takes either a comma separated list of attributes, or the first
letter(s) of:

mode - permissions (ignore umask for rwx, copy suid and sticky bit)
ownership - user and group
timestamps - file creation, modification, and access times.
context - security context
xattr - extended attributes
all - all of the above

:/ #
 

fawazahmed0

Senior Member
Jan 31, 2015
336
232
/system/bin/sh: help: inaccessible or not found
127|:/ # su
:/ # su
:/ # cp /sdcard/magisklagfix.sh
cp: Need 2 arguments (see "cp --help")
1|:/ # cp --help
usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST

Copy files from SOURCE to DEST. If more than one SOURCE, DEST must
be a directory.
-v Verbose
-s Symlink instead of copy
-r Synonym for -R
-n No clobber (don't overwrite DEST)
-l Hard link instead of copy
-d Don't dereference symlinks
-a Same as -dpr
-P Do not follow symlinks [default]
-L Follow all symlinks
-H Follow symlinks listed on command line
-R Recurse into subdirectories (DEST must be a directory)
-p Preserve timestamps, ownership, and mode
-i Interactive, prompt before overwriting existing DEST
-F Delete any existing destination file first (--remove-destination)
-f Delete destination files we can't write to
-D Create leading dirs under DEST (--parents)
--preserve takes either a comma separated list of attributes, or the first
letter(s) of:

mode - permissions (ignore umask for rwx, copy suid and sticky bit)
ownership - user and group
timestamps - file creation, modification, and access times.
context - security context
xattr - extended attributes
all - all of the above

:/ #

you have entered partial command, enter the complete command:

su
mkdir -p /data/adb/service.d && cp /sdcard/magisklagfix.sh /data/adb/service.d/ && chmod +x /data/adb/service.d/magisklagfix.sh
 

Phantom010

Member
Jul 22, 2020
26
1
Birtamod
No response ?*♂️
 

Attachments

  • Screenshot_20200904-125143.jpg
    Screenshot_20200904-125143.jpg
    61.1 KB · Views: 42

Kindred0527

New member
Aug 1, 2021
4
0
Xiaomi Redmi Note 7
All Praise and All Thanks to God

Explanation:

The lmkd (low memory killer ) was somehow killing the forked init process and that was triggering lagging issue, making the forked init as unkillable solves the problem

Permanent Fix Method:
1. Download and paste the magisklagfix.sh , in your internal sd card (not external sdcard).
2. Execute these commands in terminal emulator app (you can get the app from play store):
Code:
su
mkdir -p /data/adb/service.d && cp /sdcard/magisklagfix.sh /data/adb/service.d/ && chmod +x /data/adb/service.d/magisklagfix.sh
3. Reboot your phone for fix to start working

Old Method Temporary Fix: (Need to do after every reboot)
Code:
su
for i in $(pgrep -x init); do echo -1000 > /proc/$i/oom_score_adj && echo -17 > /proc/$i/oom_adj; done

Download Link:
https://github.com/fawazahmed0/Magisk-lagfix-realme3/releases/latest/download/magisklagfix.sh

Refer here for more details:
https://github.com/topjohnwu/Magisk/issues/2099

Also thanks to @XPr1d3 for reporting this lagging issue to me and @kapmino269 for trying to help me
After execute and reboot , it's okay to uninstall the Terminator Emu. ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    All Praise and All Thanks to God

    Explanation:
    The lmkd (low memory killer ) was somehow killing the forked init process and that was triggering lagging issue, making the forked init as unkillable solves the problem

    Permanent Fix Method:
    1. Download and paste the magisklagfix.sh , in your internal sd card (not external sdcard).
    2. Execute these commands in terminal emulator app (you can get the app from play store):
    Code:
    su
    mkdir -p /data/adb/service.d && cp /sdcard/magisklagfix.sh /data/adb/service.d/ && chmod +x /data/adb/service.d/magisklagfix.sh
    3. Reboot your phone for fix to start working

    Old Method Temporary Fix: (Need to do after every reboot)
    Code:
    su
    for i in $(pgrep -x init); do echo -1000 > /proc/$i/oom_score_adj && echo -17 > /proc/$i/oom_adj; done

    Download Link:
    https://github.com/fawazahmed0/Magisk-lagfix-realme3/releases/latest/download/magisklagfix.sh

    Refer here for more details:
    https://github.com/topjohnwu/Magisk/issues/2099

    Also thanks to @XPr1d3 for reporting this lagging issue to me and @kapmino269 for trying to help me out
    2
    Thank you for updating sir keep it up
    can i do this in termux?

    yes, you can use that
    1
    All Praise and All Thanks to God

    If someone is having lagging issue after flashing magisk, this might help (after every reboot, you have to do this):

    Explanation:
    The lmkd (low memory killer ) was somehow killing the forked init process and that was triggering this lagging issue, you can make the forked init as unkillable by using below commands in terminal emulator or adb shell:
    Code:
    su
    for i in $(pgrep -x init); do echo -1000 > /proc/$i/oom_score_adj && echo -17 > /proc/$i/oom_adj; done


    Refer here for more details:
    https://github.com/topjohnwu/Magisk/issues/2099

    Also thanks to @XPr1d3 for reporting this lagging issue to me and @kapmino269 for trying to help me out

    Thank you for updating sir keep it up
    can i do this in termux?
    1
    It works sir thank you so much but yeah after reboot i need to do this again but its ok now i can use my phone with root access
    Im still waiting for official fix
    Can you make it magisk module?
    When I get some time, I will release script which will automatically execute these commands on reboot.
    So, you won't have to do it again.
    And yeah one more thing, there won't be any official fix release, the github issue is already closed by @topjohnwu
    1
    When I get some time, I will release script which will automatically execute these commands on reboot.
    So, you won't have to do it again.
    And yeah one more thing, there won't be any official fix release, the github issue is already closed by @topjohnwu

    Thank you so much for your awesome work
    Your so great God bless you master :)