Q:

how to mount /system as read/write in android?

cannot mount /system in android with following command, anyone has a solution for this?
root@hwG7-UL20:/ # mount -o rw,remount,rw /system
mount: Invalid argument

255|root@hwG7-UL20:/ # mount -o remount rw /system
mount: Invalid argument

root@hwG7-UL20:/ # mount|grep system
/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0

the full output for mount is:
255|root@hwG7-UL20:/ # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=970220k,nr_inodes=155384,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,size=970220k,nr_inodes=155384,mode=750,gid=1000 0 0
none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
none /dev/frz cgroup rw,relatime,freezer 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,size=970220k,nr_inodes=155384,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,size=970220k,nr_inodes=155384,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
/dev/block/bootdevice/by-name/log /log vfat rw,nosuid,nodev,relatime,uid=1000,gid=1007,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,relatime,noauto_da_alloc,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/modem /firmware vfat ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/data/media /mnt/shell/emulated sdcardfs rw,nosuid,nodev,relatime,uid=1023,gid=1023 0 0
/dev/block/bootdevice/by-name/cust /cust ext4 ro,seclabel,relatime,data=ordered 0 0

thanks a lot!

A:

Solution is simple. To remount a mounted system you need to have root privileges. Do an su. You will enter root mode. Then run the below command. It will work, I did it many a times.
So here are the steps:
 adb shell  
 su  
 mount -o rw,remount -t ext4 /system

Edit: Found a better solution
From host machine(Linux or windows PC), execute the following commands.
>> adb root  
>> adb remount

remount will by default remount the /system partition with rw, if you have the permissions.
Note 1: To do su or adb root, your device must be rooted and have su executable on it. When you do an su, if it is executed properly, your terminal prompt will change from $ to #. Thanks..
Note 2: In recent mobiles, few of acer and samsung that i know, Security has been tightened, and even after rooting the phone, adb remount wouldn't work. As of i know, there is no solution available for it so far.

