How can I remount my Android/system as read-write in a bash script using adb?

后端 未结 8 1229
半阙折子戏
半阙折子戏 2020-12-23 17:27

For info

adb remount 

returns \"remount failed: Operation not permitted\"

adb shell \'su -c  mount -o rw,remo         


        
相关标签:
8条回答
  • 2020-12-23 18:04

    Otherwise... if

    getenforce
    

    returns

    Enforcing
    

    Then maybe you should call

    setenforce 0 
    mount -o rw,remount /system 
    setenforce 1
    
    0 讨论(0)
  • 2020-12-23 18:05

    I had the same problem and could not mount system as read/write. It would return

    Usage: mount [-r] [-w] [-o options] [-t type] device directory

    Or

    operation not permitted. Access denied

    Now this works on all rooted devices.

    DO THE FOLLOWING IN TERMINAL EMULATOR OR IN ADB SHELL

    $ su
    #mount - o rw,remount -t yaffs2 /system
    

    Yaffs2 is the type of system partition. Replace it by the type of your system partition as obtained from executing the following

    #cat /proc/mounts
    

    Then check where /system is appearing from the lengthy result

    Extract of mine was like

    mode=755,gid=1000 0 0
    tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
    none /dev/cpuctl cgroup rw,relatime,cpu 0 0/dev/block/platform/msm_sdcc.3/by-num/p10 /system ext4 ro,relatime,data=ordered 0 0
    /dev/block/platform/msm_sdcc.3/by-num/p11 /cache ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
    

    So my system is ext4. And my command was

    $ su
    #mount  -o  rw,remount  -t  ext4  /system 
    

    Done.

    0 讨论(0)
提交回复
热议问题