A terminal command for a rooted Android to remount /System as read/write

user496854 picture user496854 · Mar 29, 2011 · Viewed 164.9k times · Source

I'm writing an android app that needs to copy a file to the "/system" partition at runtime. I've got the commands to run "su" and can successfully request SuperUser permissions and run commands as root. But I don't know how to make this app universal across multiple devices, because the mount command can differ depending on where the /system is actually mounted. Here's the command that's used most offen:

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

But I know that mtdblock3 could be different on some devices (and for that matter, i guess so could yaffs2). So, my question is: Is there a universal command that will work on all phones? Or is there a way to find out at runtime what the correct parameters are?

Answer

Gussoh picture Gussoh · Feb 8, 2012

I use this command:

mount -o rw,remount /system