11

I can do adb push to /sdcard/ location but not /system on my android device.

sudo adb push lib/audio.primary.gmin.so system/lib/hw/
failed to copy 'lib/audio.primary.gmin.so' to 'system/lib/hw/audio.primary.gmin.so': Read-only file system

I tried some suggestions online

user$ adb remount
dm_verity is enabled on the system partition.
Use "adb disable-verity" to disable verity.
If you do not, remount may succeed, however, you will still not be able to write to these volumes.
remount of /system failed: Read-only file system
remount failed
user$ adb disable-verity
Verity already disabled on /system

Even after this, remount fails

user$ adb remount
dm_verity is enabled on the system partition.
Use "adb disable-verity" to disable verity.
If you do not, remount may succeed, however, you will still not be able to write to these volumes.
remount of /system failed: Read-only file system
remount failed

running below command on PC also does not work

sudo mount -o remount,rw /system
mount: can't find /system in /etc/fstab or /etc/mtab

What should I do?

EDIT.

   which mount
    /bin/mount

adb version
Android Debug Bridge version 1.0.32

The output of mount command is as below

user$ mount
/dev/sda6 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user)
/dev/sda5 on /media/Data type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda2 on /media/OS type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
Robert
  • 20,025
  • 6
  • 47
  • 66
user13107
  • 411
  • 1
  • 3
  • 11
  • What phone model, Android version please? – esQmo_ Nov 24 '16 at 09:39
  • You have to root your device first. – Vahid Nov 24 '16 at 10:06
  • 1
    And it doesn't help to run those sudo mount commands *on your PC* if you want to remount a partition on your Android device (the output from mount as well as sudo mount -o remount,rw /system clearly is not from the Android device, and your Linux machine doesn't have /system). You need to run those via ADB on the device, e.g. adb shell 'su -c "sudo mount -o remount,rw /system"'. As Vahid correctly pointed out, that requires your device to be rooted. – Izzy Nov 24 '16 at 12:30
  • Thanks for help. Yes the device is already rooted. It is working now after I did reboot the device after running adb disable-verity. So a reboot is must it seems. After reboot the adb remount command works fine. – user13107 Nov 25 '16 at 01:37

2 Answers2

19

The sequence of commands that worked for me was

adb root
adb disable-verity
adb reboot
adb root
adb remount

If I don't reboot, remount does not succeed.

user13107
  • 411
  • 1
  • 3
  • 11
0

I was having the same trouble, no access to my Download folder from TWRP. BUT I did realize a folder that for me was not read-only. Try pushing to /data/local/tmp: ./adb push fileToPush /data/local/tmp

At first I was able to push to /sideload as well, but then all of a sudden it became read-only, so somehow I found this tmp a post online mentioning this tmp folder, and for me it was writeable. Good luck!

skittlebiz
  • 101
  • 1