Jump to content


Photo

Easy /system remount script

- - - - -

  • Please log in to reply
5 replies to this topic

#1
flactemnad

flactemnad

    Newbie

  • Members
  • Pip
  • 3 posts
  • Devices:HTC HERO (Sprint CDMA)
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:
[codebox]#!/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, 11 November 2009 - 05:37 PM.

  • 0

#2
kendon

kendon

    Addict

  • Members
  • PipPipPipPipPip
  • 923 posts
  • Devices:HTC Hero, ZTE Blade

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.

  • 0

#3
flactemnad

flactemnad

    Newbie

  • Members
  • Pip
  • 3 posts
  • Devices:HTC HERO (Sprint CDMA)

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!

  • 0

#4
kendon

kendon

    Addict

  • Members
  • PipPipPipPipPip
  • 923 posts
  • Devices:HTC Hero, ZTE Blade

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.

  • 0

#5
flactemnad

flactemnad

    Newbie

  • Members
  • Pip
  • 3 posts
  • Devices:HTC HERO (Sprint CDMA)

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.

  • 0

#6
PangOS

PangOS

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:Treo 650 - Treo 750

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>

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users