Why does my /system & /etc mount as R/W on boot? How to fix? - AT&T Samsung Galaxy Note I717

Of the 20+ Android phones I have had, and each being rooted and ROM'd, this is the first that I have seen.
On the TPC ROM, when my phone boots, my /system & /etc are mounted by default as Read/Write rather than Read Only. I have no such problem when I flash SAUROM.
I can set it to R/O, reboot, it becomes R/W again.
I asked the question in the ROM thread but got no help. It seems that others don't have this problem.
Why is this and how do I fix it?
Thanks.
Edit: The mount point is /dev/block/mmcblk0p24 for /system and /etc. There are some remount commands in a file located in init.d. Could that be the cause?

I'm no dev, but have you looked at the superuser logs to see what app might be changing r/rw modes? You say when you reboot it changes back. So that makes me think an app you have auto starting is mounting the system rw to make a change and failing to mount back to R.
Go in SuperUser.. clear the logs, set it to R, make note that it saved that change in the log using whatever program you use it to set with... Reboot, check Superuser logs to see what gained root and changed it back.
snovvman said:
Of the 20+ Android phones I have had, and each being rooted and ROM'd, this is the first that I have seen.
On the TPC ROM, when my phone boots, my /system partition is mounted by default as Read/Write rather than Read Only. I have no such problem when I flash SAUROM.
I can set it to R/O, reboot, it becomes R/W again.
I asked the question in the ROM thread but got no help. It seems that others don't have this problem.
Why is this and how do I fix it?
Thanks.
Click to expand...
Click to collapse

jb0nd38372 said:
I'm no dev, but have you looked at the superuser logs to see what app might be changing r/rw modes? You say when you reboot it changes back. So that makes me think an app you have auto starting is mounting the system rw to make a change and failing to mount back to R.
Go in SuperUser.. clear the logs, set it to R, make note that it saved that change in the log using whatever program you use it to set with... Reboot, check Superuser logs to see what gained root and changed it back.
Click to expand...
Click to collapse
Thanks for the suggestion. I removed all the apps that requested SU on boot, but the ROM still had /system as R/W. I don't think it's an app doing it.
Is there a way for me to add something into a boot script to set it as R/O?
Thanks.

I'm still trying to track down this problem.
I noticed that /etc also mounts as R/W by default. I see that both /system and /etc share the same mount point: /dev/block/mmcblk0p24.
I look in init.d and found one file which contained these lines:
#mount fs for faster IO speeds
mount -o remount,nodev,noatime,nodiratime /dev/block/mmcblk0p24 /system
mount -o remount,noauto_da_alloc,nodev,noatime,nodiratime /dev/block/mmcblk0p25 /data
mount -o remount,noauto_da_alloc /dev/block/mmcblk0p26 /cache
Would the first line cause this?
Is there something I can add to init.d to re-mount as R/O?
I'm still curious as to what is causing this. Thanks for any help.

Through trial and error, I found this command works to set /system and /etc to RO:
mount -o remount,ro /dev/block/mmcblk0p24 /system
I added it to init.d, and it works. Once the phone completes the boot, those directories are RO. It's just a patch.
But nevermind that--I am still very interested in the "why" and if there is some other script/boot command somewhere that is causing this.
I'd appreciate some guidance. Thanks.

Related

can't mount RW system/app in root explorer

it does it everywhere else except for the system folder. i really want to get this version of pandora off, but it's not doing anything. it worked with my other android devices, not sure why it's happening with this
Do you have the latest version of Root Explorer?
yeah what version of root explorer???
Generally if you can mount R/W in other folders you should also be able to do so in the system folder. You may have already tried this but you may want to boot into recovery and wipe cache and try again. If you have ADB set-up you should also be able to mount the device in R/W by doing the following command: su [enter] mount -o remount,rw -t /dev/block/mtdblock5 /system [enter] if that goes out without a hitch you should be able to delete in the system folder. You can also put that command in to terminal (if you have it) and that also should put the system into R/W. To remount the device in R/O just replace rw with ro. Hope this helps.
2.9.3...wow i'm restarted...i updated and it works now
I have had this issue a couple of times and a simple reboot has fixed it.
Sent from my B.A.M.F. Thunderbolt

[Q] HELP: how do you SAVE your file system setting?

I can change the mount from RO to RW, but the settings never stick. Everytime i reboot, the rootfs return to RO. And i believe this is preventing my to get my xRecovery to work, since the chargemon, and other files would stay as read only and not executables...
Is there a way to make the rootfs RW permanently?
codenamezero said:
I can change the mount from RO to RW, but the settings never stick. Everytime i reboot, the rootfs return to RO. And i believe this is preventing my to get my xRecovery to work, since the chargemon, and other files would stay as read only and not executables...
Is there a way to make the rootfs RW permanently?
Click to expand...
Click to collapse
Why do you want that?.. let it be RO
codenamezero said:
I can change the mount from RO to RW, but the settings never stick. Everytime i reboot, the rootfs return to RO. And i believe this is preventing my to get my xRecovery to work, since the chargemon, and other files would stay as read only and not executables...
Is there a way to make the rootfs RW permanently?
Click to expand...
Click to collapse
You don't need write access to execute a file!

[Q] Mount /system r/w each boot

I would like my phone to mount the system directory r/w each time it boots.
Can I add some code to an init.d script to get my phone to mount /system r/w each time it boots?
--If so, what would I add?
--If not, how can I accomplish mounting /system r/w each boot?
creeve4 said:
I would like my phone to mount the system directory r/w each time it boots.
Can I add some code to an init.d script to get my phone to mount /system r/w each time it boots?
--If so, what would I add?
--If not, how can I accomplish mounting /system r/w each boot?
Click to expand...
Click to collapse
I'm not trying to be mean or anything, but are you sure you know what you are asking for? Mounting /system r/w opens up your phone to a lot of issues including making it trivial for someone to p0wn it, or blow it up (by that I mean your software installation). Just out of curiosity, why would you want /system to mount r/w all the time?
I do alot of theming and use adb to push the apps to my phone. Often I push framework files (while in recovery) and after rebooting I want to push more apps to system, but I must first use root explorer to mount it r/w. Gets pretty tedious.
I guess I could just use adb to mount system r/w, but that could be bothersome.
If you are going to be pushing with adb anyway, you can do "adb remount" before you push any files which will remount /system r/w. Quick and simple, and does not leave your phone wide open to chaos on the /system partition all the time.
shrapnelx said:
If you are going to be pushing with adb anyway, you can do "adb remount" before you push any files which will remount /system r/w. Quick and simple, and does not leave your phone wide open to chaos on the /system partition all the time.
Click to expand...
Click to collapse
Thanks. I didn't realize that remount also mounted /system r/w

Setting system root as RW default

Hey there?
I've got a question which I can't seem to find anywhere else and YES I have searched this forum and google. However, I may miss it.
Anyway, I've mapped my android phone as a network drive using Samba and changed the smb.conf file to show the System Root directory as well. However, system root is default set as R/O so to mange files USING my computer I need to change the permission to R/W using a file manager (such as root explorer). This is annoying, as I have to keep doing this in order to write to certail directories.
What I wish to do is create a massive guide on all of this to help out the community, however I need one little bit of information.
I would like the / directory (root) to be mounted as R/W as default so that I can quickly edit files on my PC without having to constantly change it to R/O.
If this has been answered before, I do apologize.
Thanks in advance.
Regards,
xxSHABSxx
EDIT:
To make things a bit clearer.
I want something that will automatically mount my phone's root dir into rw upon boot, without custom apps/having to manually mount as rw everytime it reboots. And yes I understand there are apps that do this.
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it'll stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
kuisma said:
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it's stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
Click to expand...
Click to collapse
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Anyway thanks for the reply!
xxshabsxx said:
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Click to expand...
Click to collapse
Or do like I did, move the root to a real ext3 non-volatile file system instead.

Cannot get /system to mount as rw in Android Q release build QP1A.

As the title states, I cannot get it to work. Yes, I do have root and my bootloader is unlocked. I've already tried modifying the boot.img and system.img both but to no avail. If anyone out there smarter than me can help that would be greatly appreciated.
If it helps, im on the OG Pixel.
Having the same issue (on the same build, with the same phone). Stock Android + Magisk. Trying to modify my build.prop so that I can enable tethering. Can't figure out how to mount /system as RW (only able to get it mounted as RO). I even tried doing it from TWRP, but for some reason, it won't mount system unless I check the box for "Mount System as Read-Only".
EDIT: Oh and I should mention, I also tried from adb shell.
sailfish:/ $ su
sailfish:/ # mount -o rw,remount -t ext4 /system
'/dev/block/sda33' is read-only
Click to expand...
Click to collapse

Categories

Resources