Read only file system on Android

I recently rooted my Droid X and everything seems to be working perfectly. I made some changes to build.prop and when I do adb push build.prop /system/ I get the following error: failed to copy 'c:\build.prop' to '/system//build.prop': Read-only file system . How can I fix this?

6,133 14 14 gold badges 33 33 silver badges 59 59 bronze badges asked May 19, 2011 at 23:38 11.7k 16 16 gold badges 68 68 silver badges 117 117 bronze badges have you tried adb remount , what do you get? Commented May 19, 2011 at 23:48 Android is Google's software stack . For non-developer questions, see android.stackexchange.com Commented Dec 16, 2011 at 14:42

Please note that this question should not be confused with the case where Android Application code fails with a read-only file system error. That is usually caused by trying to write a file without specifying a location, ie, trying to write to the root directory. This question is only about modifying the installation of Android itself on rooted/development/engineering devices.

Commented Apr 23, 2016 at 2:02 Is there a way to do this with an android emulator?? None of these solutions work for my emulator. Commented Dec 21, 2016 at 17:38 Just use adb shell mount -o rw,remount /sys (instead of /system). Works for me. Commented Oct 8, 2020 at 7:48

23 Answers 23

Not all phones and versions of android have things mounted the same.
Limiting options when remounting would be best.

Simply remount as rw (Read/Write):

# mount -o rw,remount /system 

Once you are done making changes, remount to ro (read-only):

# mount -o ro,remount /system 
answered Dec 16, 2011 at 13:10 CurtisLeeBolin CurtisLeeBolin 4,504 2 2 gold badges 14 14 silver badges 11 11 bronze badges You can do this on your PC too. adb shell mount -o rw,remount /system Commented Jul 26, 2012 at 0:47 Use in conjunction with adb root or you'll get a Permission Denied when pushing the file. Commented Aug 18, 2013 at 9:06 If I use adb root I get adbd cannot run as root in production builds Commented Jun 8, 2016 at 16:59

Doesn't work for me: Balazss-MBP:tools varh1i$ adb shell generic_x86_64:/ # mount -o rw,remount /system '/dev/block/vda' is read-only

Commented Feb 8, 2017 at 13:58 It is not worked for me.It showed "mount: Read-only file system" Commented Aug 9, 2017 at 6:50
adb remount 

works for me and seems to be the simplest solution.

answered Apr 23, 2012 at 21:06 1,685 2 2 gold badges 13 13 silver badges 13 13 bronze badges

"adb remount -- If you've gotten errors trying to push files to /system due to it being in read-only mode, adb remount will remount /system into read-write mode--- provided that the shell has the correct root permissions to do so. This replaces having to type a longer command by hand such as mount -o rw,remount /system (as root) or something." (source). If you have any issue with root permissions, try "adb root" before.

Commented Feb 1, 2014 at 9:13

I've got Not running as root. Try "adb root" first. . And then adbd cannot run as root in production builds .

Commented Aug 31, 2017 at 14:44

On newer devices it looks like we also need to $ adb disable-verity and then reboot the device before we can run $ adb remount

Commented Dec 11, 2018 at 18:43 $ adb disable-verity give : disable-verity only works for userdebug builds Commented Jun 11, 2019 at 18:29

it doesn't work: Not running as root. Try "adb root" first. . I entered adb root and then again adb remount but still the same error: Not running as root. Try "adb root" first.

Commented Aug 7, 2019 at 11:20

While I know the question is about the real device, in case someone got here with a similar issue in the emulator, with whatever tools are the latest as of Feb, 2017, the emulator needs to be launched from the command line with:

-writable-system 

For anything to be writable to the /system . Without this flag no combination of remount or mount will allow one to write to /system .

After the emulator is launched with that flag, a single adb remount after adb root is sufficient to get permissions to push to /system .

Here's an example of the command line I use to run my emulator:

./emulator -writable-system -avd Nexus_5_API_25 -no-snapshot-load -qemu 

The value for the -avd flags comes from:

./emulator -list-avds 
answered Feb 16, 2017 at 16:53 12.8k 4 4 gold badges 36 36 silver badges 52 52 bronze badges

my command prompt becomes extremely slow until cannot continue with adb root and adb remount after launch emulator with -writable-system, anyone can help ?

Commented May 17, 2018 at 1:20

Note that in some old kernel versions there is a bug in the ext4 driver that causes the remount to immediately revert to read-only. Check dmesg for error messages like "Inode table for bg 0 marked as needing zeroing". This is fixed by commit 8844618

Commented Sep 2, 2021 at 1:21 What if I want to write to /product directory? Commented May 21, 2022 at 13:46

In case you are on windows, Right-click the Bluestacks icon on Desktop > Properties > Target (And add flags there)

Commented Jan 7, 2023 at 1:13

Got this off an Android forum where I asked the same question. Hope this helps somebody else.

On a terminal emulator on the phone:

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system 

Then on the cmd prompt, do the adb push

answered May 20, 2011 at 0:15 11.7k 16 16 gold badges 68 68 silver badges 117 117 bronze badges adb shell can be used from the computer (if you lack a terminal on your phone) Commented May 19, 2014 at 8:38 this comments results in mount: '/system' not in /proc/mounts Commented Mar 5, 2021 at 3:07

@임정섭 I am also facing the same issue, did you find any solution? nothing is working for me. if I am doing adb remount, I am getting remount of the / superblock failed: Permission denied remount failed and with this answer, I am getting '/system' not in /proc/mounts . Please help.

Commented Sep 18, 2021 at 21:11

@HackRx I kind of gave up and found other proxy methods. Overall, what I wanted to was pushing some data to the phones and I did this by pushing to /data/local/ . Here didn't raise permission error.

Commented Sep 22, 2021 at 15:23
adb disable-verity adb reboot adb root adb remount 

This works for me, and is the simplest solution.

answered Jul 25, 2018 at 0:12 byInduction byInduction 465 1 1 gold badge 6 6 silver badges 13 13 bronze badges adb disable-verity -- this was the key solution in my case. Commented Jul 15, 2020 at 14:41 verity cannot be disabled/enabled - USER build Commented Apr 26, 2022 at 22:10

This is the right answer. I just had to push "adb root" as the very first command, otherwise I'm getting "Error getting verity state. Try adb root first? Overlayfs setup failed with error Permission denied Maybe run adb root?" on Android Emulator SDK 29.

Commented May 31, 2023 at 13:17

I think the safest way is remounting the /system as read-write, using:

mount -o remount,rw /system 

and when done, remount it as read-only:

mount -o remount,ro /system 
answered Dec 21, 2011 at 19:50 1,090 11 11 silver badges 7 7 bronze badges

Welcome to SO! Your answer is technically useful, but essentially a duplicate of curtlee2002's prior answer. This might have been better as a comment on his answer saying "I agree it is safest to switch back to read-only after monkeying around in read-write mode." We have millions of questions, so there will always be another question where you are the first to come with a great solution or a fresh perspective!

Commented Dec 21, 2011 at 20:09

this only worked for me once I removed the "," from the statement. i.e. "" mount -o remount rw /system ""

Commented Apr 6, 2013 at 18:51 @TechnikEmpire, he does not refer to the accepted answer. Commented Oct 26, 2015 at 13:20

On my Samsung galaxy mini S5570 (after got root on cellphone):

Fist, as root, I ran:

systemctl start adb 

as a normal user:

adb shell su 

Grant root permissions on touch screen

mount 

list all mount points that we have and we can see, in my case, that /dev/stl12 was mounted on /system as ro (ready only), so we just need do:

mount -o rw,remount /dev/stl12 /system 
answered Feb 4, 2013 at 0:37 7,151 1 1 gold badge 49 49 silver badges 55 55 bronze badges

Thank you for this answer. For some reason I never looked at the screen on my phone to grant root permissions and was getting access denied no matter what I tried.

Commented May 10, 2013 at 3:18 saying "You must specify a filesystem type with -t.", whats does this mean? Commented Mar 27, 2018 at 10:17

mount -o rw,remount -t ext4 /dev/block/vda /system , -t mean the type of file system in my example ext4

Commented Mar 27, 2018 at 17:23

Try the following on the command prompt:

>adb remount >adb push framework-res_old.apk /system/framework-res.apk 
8,845 2 2 gold badges 28 28 silver badges 40 40 bronze badges answered Aug 4, 2012 at 15:00 121 1 1 silver badge 2 2 bronze badges It should be adb root remount Commented Oct 2, 2018 at 20:45

Here is what worked for me. I was running an emulated Android 7.1.1 (Nougat) device.

On a terminal, I hit the following command. One thing to be noticed is the -writable-system flag

./emulator -writable-system -avd Nexus_6_API_25 -partition-size 280 
./adb shell su mount -o rw,remount -t ext4 /dev/block/vda /system 

All the changes that you do on the /system contents will survive a restart.

answered Jan 31, 2018 at 16:04 George Garcés George Garcés 159 1 1 silver badge 6 6 bronze badges mount: '/system' not in /proc/mounts Commented Feb 25 at 11:32

I checked with emulator and following worked.

  1. adb reboot
  2. adb root && adb remount && adb push ~/Desktop/hosts /system/etc/hosts

As mentioned above as well, execute second step in single shot.

answered Mar 29, 2019 at 10:27 11.1k 14 14 gold badges 96 96 silver badges 198 198 bronze badges

I had one console open for pushing and one for remounting. Remount, switch to the other terminal where you have the push line ready to submit, and submit it. That's it.

Commented Dec 5, 2022 at 22:03

Open terminal emulator on the phone: then

adb shell 

after that daemon is started

su mount -o rw,remount /mnt/sdcard 

then the read only is converted into the read-Write.

answered May 10, 2015 at 16:18 33 6 6 bronze badges

Adding a little bit more to Jan Bergström's answer: Because Android is a Linux based system, and the path in Linux contains forward slashes(../), while using push command, use "/" to define destination path in the Android device.

For Example, the command goes: adb push C:\Users\admin\Desktop\1.JPG sdcard/pictures/

Notice that here, back slashes are used to define source path of the file to be pushed from windows PC and forward slashes are used to define destination path because Android is a Linux based system. You don't have to act as a root to use this command and also, it works perfectly fine on production devices.

answered Dec 19, 2015 at 0:12 121 5 5 bronze badges

Sometimes you get the error because the destination location in phone are not exist. For example, some android phone external storage location is /storage/emulated/legacy instead of /storage/emulated/0 .

answered Jan 19, 2016 at 11:54 Geng Jiawen Geng Jiawen 9,124 3 3 gold badges 49 49 silver badges 38 38 bronze badges
mount -o rw,remount /dev/stl12 /system 
answered Sep 5, 2013 at 2:37 67 6 6 bronze badges
This worked for me #Mount as ReadOnly su -c "mount -o rw,remount /system" # Change Permission for file su -c "chmod 777 /system/build.prop" #Edit the file to add the property su -c "busybox vi /system/build.prop" # Add now service.adb.tcp.port=5678 # Reset old permissions su -c "chmod 644 /system/build.prop" # Mount as readonly again once done su -c "mount -o ro,remount /system" 
answered Apr 19, 2018 at 20:30 Ashwin Rayaprolu Ashwin Rayaprolu 31 1 1 bronze badge

I found this article from google, and thought I'd add the steps necessary on a Sony Xperia Z (4.2.2).

The Sony has a watchdog process which detects when you've changed ro to rw on / and /system (these are the only ones I was trying to modify) and possibly others.

The following was what I ran to perform the changes I was trying to achieve. I pasted these into a window, because removing the execute bit from /sbin/ric needs to be done quickly in order to stop it restarting itself. (I tried stop ric ; this doesn't work - although it worked on a previous version of android on the phone).

pkill -9 ric; mount -o rw,remount -t rootfs / chmod 640 /sbin/ric mount -o rw,remount /system 

I modified the hosts file here, so this is the place you make the changes you need to the filesystem. To leave things the way we found them, do this:

mount -o ro,remount /system chmod 750 /sbin/ric mount -o ro,remount -t rootfs / 

At which point ric should automatically restart. (It restarted for me automatically.)