I have a rooted Android Phone and a native service which detects if the system partition is mounted read-write or read-only.

If I run the mount command in the user shell, the partition is mounted read-only.

mount | grep /system

I can open a different shell, login as root and run the command

mount -o remount,rw /system

In the root shell, the system is mounted read-write, but in the previous opened user shell, the system partition is still mounted as read-only. Even if I switch back in the rooted shell with Ctrl+D to the normal user shell, the system partition is mounted read-only. It is only read-writeable in the root shell.

So it is not possible to detect as non root, if the partition was remounted in a different context. Why is that? As it is of my knowledge, in Linux mount points are handled globally.

Update: Android 5.0.2, Samsung SM-A300FU and SM-A300M

  • 2
    I suppose it is happening because of mount namespaces. – Firelord Apr 13 '16 at 14:25
  • 1
    Device and Android version might be relevant here. I've read about such cases several times, but never experienced them myself. – Izzy Apr 13 '16 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.