For info
adb remount
returns "remount failed: Operation not permitted"
adb shell 'su -c mount -o rw,remount /system'
returns unknown option -- o
My device is rooted.
Probable cause that remount fails is you are not running adb as root.
Shell Script should be as follow.
# 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 /;
If this fails, you could try the below:
# List the Devices.
adb devices;
# Run adb as root
adb root;
adb remount;
adb shell su -c "mount -o rw,remount /";
To find which user you are:
$ adb shell whoami
I could not get the mount command to work without specifying the dev block to mount as /system
#cat /proc/mounts returns ( only the system line here )
/dev/stl12 /system rfs ro,relatime,vfat,log_off,check=no,gid/uid/rwx,iocharset=utf8 0 0
so my working command is
mount -o rw,remount -t rfs /dev/stl12 /system
Otherwise... if
getenforce
returns
Enforcing
Then maybe you should call
setenforce 0
mount -o rw,remount /system
setenforce 1
The following may help (study the impacts of disable-verity first):
adb root
adb disable-verity
adb reboot
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.
Get "adbd insecure" from google play store, it helps give write access to custom roms that have it secured my the manufacturers.
In addition to all the other answers you received, I want to explain the unknown option -- o error: Your command was
$ adb shell 'su -c mount -o rw,remount /system'
which calls su through adb. You properly quoted the whole su command in order to pass it as one argument to adb shell. However, su -c <cmd> also needs you to quote the command with arguments it shall pass to the shell's -c option. (YMMV depending on su variants.) Therefore, you might want to try
$ adb shell 'su -c "mount -o rw,remount /system"'
(and potentially add the actual device listed in the output of mount | grep system before the /system arg – see the other answers.)
mount -o rw,remount $(mount | grep /dev/root | awk '{print $3}')
this does the job for me, and should work for any android version.
Background Information:
Nexus 5
Have rooted permission on device
pull sqlite3 from my emulator
ADB pull /system/bin/sqlite3
push this sqlite3 onto my device
ADB push sqlite3 /sdcard/
adb shell
su
move sqlite3 into /system/xbin/ directory
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/xbin/sqlite3
# chmod 777 /system/xbin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
Keep getting error when I try to use sqlite3. For example:
# sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db
The error I got is:
CANNOT LINK EXECUTABLE: cannot locate symbol "sqlite3_enable_load_extension" referenced by "sqlite3"...
Does anyone know how to get sqlite3 running successfully on Nexus 5 device ? Any help is greatly appreciated.
i had the same problem. I found this Version working for Jelly Bean http://bit.ly/sqlite3-for-jb on my N5 4.4.2.
adb push sqlite3-for-jb /sdcard/sqlite3
adb shell
su
mount -o remount,rw /system
cp /sdcard/sqlite3 /system/xbin/sqlite3
chmod 755 /system/xbin/sqlite3
mount -o remount,ro /system
Simply use "SQlite Installer For Root" from the play shop.
How to root Android 4.1.2 is, as I said in the title?
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
adb push su /system/xbin/su
adb shell chmod 06755 /system
adb shell chmod 06755 /system/xbin/su
this code works Android 2 but doesn't work on 4.1.2.
Change and Try using the following line:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
I am using this command
$ adb shell
$ su
-shows permission denied..
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
But it shows some permission problems
ie. Usage: mount [-r] [-w] [-o options] [-t type] device directory
Thanks!!
You must root your device or unlock your bootloader (if possible) to use mount command
I have an HTC HERO and
I need to push my application.apk
to the /system/app/ folder.
I've followed some tuts on rooting the device
and that is fine, but when I try to push my package to the system/app
folder, I get: "permission denied":
$ push /sdcard/myApp.apk /system/app/
push: permission denied
I also try:
$ su
su
# push /sdcard/myApp.apk /system/app/
push: not found
Is this possible in a device that is not a developer intended device?
Thank you all!
Firstly, running push from the device doesn't work as it's not a built-in command. Ideally you would use the copy command cp, but I don't think it's included by default (I've added it to my device via busybox).
Anyway, your problem is that the /system partition is mounted as read-only when the device boots.
But if you have root access to the device, you can remount the partition as read-write:
host$ adb shell
hero$ su
hero# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
hero# cat /sdcard/myApp.adk > /system/app/myApp.adk
hero# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
Alternatively, after doing the remount, you can use adb push from the host as normal.
How I do it:
adb shell
#su
#mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
open a second terminal and use:
adb push myApp.apk /system/app/
in first terminal:
#reboot
What I add more then the others is the reboot - it's a must when doing a remount operation on the Android devices.