![](/img/trans.png)
[英]Cannot remount system (read only) as read/write on my Android TV Box using the adb shell
[英]How can I remount my Android/system as read-write in a bash script using adb?
信息
adb remount
返回"remount failed: Operation not permitted"
adb shell 'su -c mount -o rw,remount /system'
返回unknown option -- o
我的設備已植根。
remount
失敗的可能原因是您沒有以root
身份運行adb
。
Shell腳本應該如下。
# Script to mount Android Device as read/write.
# List the Devices.
adb devices;
# Run adb as root (Needs root access).
adb root;
# Since you're running as root su is not required
adb shell mount -o rw,remount /;
如果失敗,您可以嘗試以下方法:
# List the Devices.
adb devices;
# Run adb as root
adb root;
adb remount;
adb shell su -c "mount -o rw,remount /";
要查找您是哪個user
:
$ adb shell whoami
如果不指定要掛載為 /system 的 dev 塊,我就無法讓 mount 命令工作
#cat /proc/mounts
返回(這里只有系統行)
/dev/stl12 /system rfs ro,relatime,vfat,log_off,check=no,gid/uid/rwx,iocharset=utf8 0 0
所以我的工作命令是mount -o rw,remount -t rfs /dev/stl12 /system
否則……如果
getenforce
返回
Enforcing
那么也許你應該打電話
setenforce 0
mount -o rw,remount /system
setenforce 1
以下內容可能會有所幫助(首先研究disable-verity
的影響):
adb root
adb disable-verity
adb reboot
我遇到了同樣的問題,無法將系統掛載為讀/寫。 它會回來
用法:mount [-r] [-w] [-o options] [-t type] 設備目錄
或者
不允許操作。 拒絕訪問
現在這適用於所有有根設備。
在TERMINAL EMULATOR
或ADB SHELL
$ su
#mount - o rw,remount -t yaffs2 /system
Yaffs2
是系統分區的類型。 將其替換為通過執行以下操作獲得的系統分區類型
#cat /proc/mounts
然后從冗長的結果中檢查/system
出現的位置
我的提取物就像
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
所以我的系統是ext4
。 我的命令是
$ su
#mount -o rw,remount -t ext4 /system
完畢。
從 Google Play 商店獲取“adbd insecure”,它有助於提供對自定義 rom 的寫訪問權限,從而保護我的制造商。
除了您收到的所有其他答案之外,我想解釋一下unknown option -- o
錯誤:您的命令是
$ adb shell 'su -c mount -o rw,remount /system'
它通過 adb 調用 su。 您正確引用了整個 su 命令,以便將其作為一個參數傳遞給adb shell
。 但是, su -c <cmd>
還需要您用參數引用命令,它將傳遞給 shell 的-c
選項。 (YMMV 取決於su
變體。)因此,您可能想嘗試
$ adb shell 'su -c "mount -o rw,remount /system"'
(並可能在/system
arg 之前添加mount | grep system
輸出中列出的實際設備 - 請參閱其他答案。)
mount -o rw,remount $(mount | grep /dev/root | awk '{print $3}')
這對我有用,應該適用於任何 android 版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.