Android mounts the system partition and executes mount and remount

The first one, mount via adb, requires root privileges;

adb root //adb obtains root authority;

adb remount /system //Remount the system directory or partition

The second method: mount through the Linux command under Android, root privilege is required;

adb shell //Enter the Android command

su //Obtain root authority, otherwise the mount command cannot be executed

mount -o rw,remount /system //rw and remount line selection sequence may lead to errors;

chomd 777 /system

Introduction to the mount command

mount [-afFrsvw] [-t TYPE] [-o OPTIONS...] [[DEVICE] DIR] //Through the adb shell, you can view it after executing mount --help

I generally use [-o OPTIONS...] [[DEVICE] DIR] to implement the mount directory with these two parameters;

-o OPTIONS can choose parameters

async: asynchronous mode;

sync: synchronous mode;

atime/noatime: contains directories and files;

diratime/nodiratime: access timestamp of the directory

auto/noauto: whether to support automatic mounting

exec/noexec: Whether to support running the application on the file system as a process

dev/nodev: Whether to support the use of device files on this file system;

suid/nosuid: Whether to support special permissions on this file system

remount: remount

ro: read only

rw: read and write

user/nouser: Whether to allow ordinary users to mount this device

acl: enable the acl function on this file system

Note: The above options can be used in multiples at the same time, separated by commas;

the case

mount -o rw,remount /system

In fact, in the environment of the adb shell, executing the cat /proc/mounts or mount command can also find the device file corresponding to the /system file.

mount system

mount -o rw,remount /dev/block/bootdevice/by-name/system /system

Mount other usage rules

In-depth study of the use of the mount command on the Android system - take a look

Note: When executing mount -o rw, remount /system appears mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy exception, you can try to exchange the rw and remount parameters order;

What is the function or meaning of the adb shell command?

The PC remotely logs in to the linux system of your mobile phone through the adb shell command. After successfully logging into the android phone system, you can run some simple linux commands, such as 'ls' to view files in the directory, 'cd xxx' to enter the xxx directory, 'exit' to log out and so on.

 

Guess you like

Origin blog.csdn.net/ezconn/article/details/128188583