ADB (11)-Re-mount the system partition as writable

Source: Internet
Author: User

Note: Root privileges are required.

The/system partition is mounted as read-only by default, but some operations such as adding commands to the Android system, removing the own app, and so on need to write to the/system, so it needs to be re-mounted to read and write.

Steps:

  1. Enter the shell and switch to root user rights.

    Command:

    adb shellsu
  2. View the current partition mount condition.

    Command:

    mount

    Output Example:

    Rootfs/rootfs ro,relatime 0 0tmpfs/dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0devpts/dev/pts devpts Rw,seclabel , relatime,mode=600 0 0proc/proc proc rw,relatime 0 0sysfs/sys sysfs rw,seclabel,relatime 0 0selinuxfs/sys/fs/selinux SE LINUXFS rw,relatime 0 0debugfs/sys/kernel/debug debugfs rw,relatime 0 0none/var Tmpfs rw,seclabel,relatime,mode=770,gid  =1000 0 0none/acct cgroup rw,relatime,cpuacct 0 0none/sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0tmpfs/mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0tmpfs/mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0none/dev/memcg cgroup rw,relatime,memory 0 0NONE/DEV/CP Uctl cgroup rw,relatime,cpu 0 0none/sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0none/sys/fs/cgroup/ Memory cgroup rw,relatime,memory 0 0none/sys/fs/cgroup/freezer cgroup rw,relatime,freezer 0 0/dev/block/platform/msm_ Sdcc.1/by-name/system/system Ext4 Ro,seclabel,relatime,data=ordered 0 0/dev/block/platform/msm_sdcc.1/by-name/userdata/data Ext4 Rw,seclabel,nosuid,nodev , relatime,noauto_da_alloc,data=ordered 0 0/dev/block/platform/msm_sdcc.1/by-name/cache/cache ext4 Rw,seclabel, nosuid,nodev,relatime,data=ordered 0 0/dev/block/platform/msm_sdcc.1/by-name/persist/persist Ext4 Rw,seclabel, nosuid,nodev,relatime,data=ordered 0 0/dev/block/platform/msm_sdcc.1/by-name/modem/firmware Vfat ro,context=u:o Bject_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1, Shortname=lower,errors=remount-ro 0 0/dev/fuse/mnt/shell/emulated Fuse Rw,nosuid,nodev,relatime,user_id=1023,group _id=1023,default_permissions,allow_other 0 0/dev/fuse/mnt/shell/emulated/0 Fuse rw,nosuid,nodev,relatime,user_id= 1023,group_id=1023,default_permissions,allow_other 0 0

    Find the line of/system with which we are concerned:

    /dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
  3. Re-mount.

    Command:

    mount -o remount,rw -t yaffs2 /dev/block/platform/msm_sdcc.1/by-name/system /system

    Here /dev/block/platform/msm_sdcc.1/by-name/system is the file path we get from the output from the previous step.

If the output does not prompt the error, the operation succeeds, you can do whatever you like with the file under/system.

ADB (11)-Re-mount the system partition as writable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.