Jump to content

Easy /system remount script


Guest flactemnad

Recommended Posts

Guest flactemnad

EDIT NOTE: The standard remount command is accessible via the adb utility. "adb remount" should remount your partition in read write mode. I access via ssh, and remount wasn't found when I entered that command, so I created this script. Thanks Kendon for pointing "adb remount" out in post #2.

Thanks for the great ROM. Been testing away here on my CDMA Hero and just loving it. I've been moving apps from the /system/app directory to the /system/sd/app directory and back as needed to clear space and keep things working properly. That means alot of ssh into the system and remounting of the /system partition.

I read somewhere that there was a remount command on MoDaCo's ROM, but it doesn't seem to be on mine, so I made my own. Maybe someone else here would like to use the script. You can change the mount back and forth between read-write and read-only settings, as well as status the current mode.

Place this file in /system/bin/

filename remount, or whatever you would like to call it.

Don't forget to change the mode to 755, and then reboot the system to get it recognized.

Here's the script body:

#!/system/bin/sh
#
# Remount /system partition

case "$1" in
ro)
echo "Setting /system to RO (read only)"
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
echo ""
echo "Current status of /system mount:"
mount |grep "/system type"
echo ""
;;
rw)
echo "Setting /system to RW (read write)"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo ""
echo "Current status of /system mount:"
mount |grep "/system type"
echo ""
;;
status)
echo ""
echo "Current status of /system mount:"
mount |grep "/system type"
echo ""
;;
*)
echo "Valid input format:"
echo " remount [ro|rw|status]"
echo " ro = read only (default)"
echo " rw = read write (to make modifications)"
echo " status = current mount mode"
echo ""
echo "Current status of /system mount:"
mount |grep "/system type"
echo ""
exit 1
esac[/codebox]

Happy scripting!

Edited by flactemnad
Link to comment
Share on other sites

Thanks for the great ROM. Been testing away here on my CDMA Hero and just loving it. I've been moving apps from the /system/app directory to the /system/sd/app directory and back as needed to clear space and keep things working properly. That means alot of ssh into the system and remounting of the /system partition.

I read somewhere that there was a remount command on MoDaCo's ROM, but it doesn't seem to be on mine, so I made my own. Maybe someone else here would like to use the script. You can change the mount back and forth between read-write and read-only settings, as well as status the current mode.

Happy scripting!

thank you for sharing the script, this is the right thinking!

but actually there is a pretty easy way to remount system rw: connect phone to pc via usb, do NOT mount the sdcard, and then type on command line "adb remount".

i don't know about leaving the system partiton rw, because afaik adb remount has no way of remounting it back ro, but i don't think this is critical. when in doubt restart :) maybe someone who knows could elaborate on this. again thanks for the script, i think i will try it.

Link to comment
Share on other sites

Guest flactemnad
thank you for sharing the script, this is the right thinking!

but actually there is a pretty easy way to remount system rw: connect phone to pc via usb, do NOT mount the sdcard, and then type on command line "adb remount".

Ah... ADB... That's where the remount command works huh?

I access my phone via ssh, and the command didn't seem to work for me there. Been doing command line unix/linux for far too long, and it's just ingrained in me brain!

Link to comment
Share on other sites

Ah... ADB... That's where the remount command works huh?

I access my phone via ssh, and the command didn't seem to work for me there. Been doing command line unix/linux for far too long, and it's just ingrained in me brain!

that is how it works indeed :)

advantage of adb is you can send reboot commands, push files to filesystem, and you can use it while in recovery image. and more nasty stuff, like port forwarding, you should check the documentation.

Link to comment
Share on other sites

Guest flactemnad
that is how it works indeed :)

advantage of adb is you can send reboot commands, push files to filesystem, and you can use it while in recovery image. and more nasty stuff, like port forwarding, you should check the documentation.

Yeah, I do most all of those things via ssh, but of course you need to use adb first to get the images installed, system rooted and MoDaCo ROM initially setup. Now I just ssh to the phone and can do anything in there that you can do under the "adb shell" command. Use scp for file transfers. Reboot commands work just fine too. Not sure why the remount didn't work under shell, but that doesn't matter much.

New to the android world though, so I've got some learning to do about the other functions of adb, which are many. Thanks for the pointers.

Link to comment
Share on other sites

  • 1 year later...
Guest PangOS

thank you for sharing the script, this is the right thinking!

but actually there is a pretty easy way to remount system rw: connect phone to pc via usb, do NOT mount the sdcard, and then type on command line "adb remount".

i don't know about leaving the system partiton rw, because afaik adb remount has no way of remounting it back ro, but i don't think this is critical. when in doubt restart :) maybe someone who knows could elaborate on this. again thanks for the script, i think i will try it.

adb remount does not work for me?

C:\android>adb remount

adb server is out of date. killing...

* daemon started successfully *

remount failed: Operation not permitted

C:\android>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.