[Q] Remount writable by all users? - General Questions and Answers

Hi, this is a blatant crosspost from the android stackexchange site, questions/24081... I posted it there and figured I wouldn't get much help, so I thought I'd try here. Let me know if this is OT or in the wrong place or whatever.
I want to remount a read-only partition in read-write mode, but I want it to be writable for all users.
So far I've got this:
Code:
mount -o bind /someplace /someplace_else
mount -o remount rw /someplace_else
The first command creates a new mount point from a directory. The second one remounts the new mount point as rewritable. This all works.
Problem is, the new mount point has uid=1000,fmask=0222,dmask=0222, so the non-root user still can't write anything, and root can't give it permission.
How do I change the fmask and uid when remounting, or is there something else I can do to make the mount writable for the normal user?
Also, note that the command that worked for me is this:
Code:
mount -o remount rw /someplace_else
...with no comma between "remount" and "rw," as I've seen in almost everything my searches turned up. Does anyone know anything about this discrepancy in syntax?
I'm doing most of this in a terminal emulator on the phone, and in SL4A.

Related

Read-Only Filesystem?

Hello, all!
I'm trying edit a file in /etc/ and adb says 'Failed to copy: Read-only filesystem'
Now, is this actually true? Or is this simply a permissions issue? I'm doing this on a non-rooted phone, so I can't 'touch' anything without permission errors, but is it a futile task if the filesystem is read only anyway?
I'm trying to do this from a non-rooted environment as I had intended on making this into an application, but I imagine that if I can't touch or push these files from an adb shell then I won't be able to from the application space either.
It's frustrating not to be able to edit the filesystem of my own phone, I'll be rooting if this is just a permissions problem and not an issue of a non-writable filesystem. Perhaps I could still make an application for rooted-only phones.. hrm..
Any thoughts on this?
/etc is an alias for /system/etc, and /system is a partition mounted as ro (you can confirm this yourself by running mount)
Ah, bugger. So this is hopeless (without modifying and then reflashing)?
Thanks very much.
you need to mount it read write,
mount -oremount,rw /dev/block/mtdblock3 /system
then it will be read/write
try adb remount. if it failes you need root sorry.
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
Click to expand...
Click to collapse
what is the error message? saying it dont work doesnt provide enough info for us to help....
it says sh: cant open aw.sh
so i still have to put the path or cd to where the file is. Is there a way to make /system my home?
no you cant make system your home, system is system, home is home. you can make a symlink if you are familiar with linux - might want to read up about shell commands
korndub said:
you need to mount it read write,
mount -oremount,rw /dev/block/mtdblock3 /system
then it will be read/write
Click to expand...
Click to collapse
Thanks it really worked!! for me i had the same problem as the other guy.
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Click to expand...
Click to collapse
You *CAN'T* modify the / filesystem. It is part of your BOOT partition, which CANNOT be remounted rw. You would have to read, modify, and write the boot partition.
Rafase282 said:
Hello, i have the same error and I have root. i have tried adb remount and the mount -oremount,rw /dev/block/mtdblock3 /system
still dotn work. I want to move a script to /
so i only have to type sh debian.sh
nvm I figured it out. i just put it on system and then just type sh debian.sh on the terminal and it works
Click to expand...
Click to collapse
Maybe you're typing it in too literally. It should actually read like this:
mount -o remount,rw /dev/block/mtdblock3 /system
There was a typo with -oremount, there should be a space after -o.
Hope that helps.
PS. That command worked for me on a device where everything else failed.
dhkr123 said:
You *CAN'T* modify the / filesystem. It is part of your BOOT partition, which CANNOT be remounted rw. You would have to read, modify, and write the boot partition.
Click to expand...
Click to collapse
actually, / can be mounted rw, but changes are lost on reboot
new user
Firerat said:
actually, / can be mounted rw, but changes are lost on reboot
Click to expand...
Click to collapse
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
egalpr said:
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
Click to expand...
Click to collapse
I would recommended not posting in the g1 section. The Asus forums would be a lot more helpful.
egalpr said:
Hi I have my Asus Prime rooted and installed a virtuous Rom and I tried to put a fonts on the System/ fonts folder using root explorer using a instructions to fix some error on some games that need that tis fonts exist on the tablet but it said it cant because file system is read only I'm new and I don't know how to do this commands any help on how to do in a easy (explained) form.
Click to expand...
Click to collapse
Download EStrong File Manager and within the settings of it, enable mounting of the system as read/write.
Or, download Terminal Emulator and type this in:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
Or, try typing this in terminal/cmd:
Code:
adb remount
Or, if you plan on doing it all from recovery you could do:
Code:
adb shell "mount system"
and then you could do it all from there.
Next time, please post in the proper forum.
Read-Only /system... i just deleted the file, tich push should update/replace and then it worked... only had this bug when i was trying to modify Trebuchet.apk (homescreen)
Hi guys
Not being a linux expert, i'm stuck with the following problem..
i'm using a program who uses low level adb commands to write on the phone extSdCard...
problem: this extSdcard is seen as a readonly filesystem.
What has to be done to make this FS RW instaed of RO ?
This does not happen under windows where I can write to the extSd without problems
thks in advance for the tip

programming ON my android phone (etc)

Greetings gentlefolks.
This forum has been an absolute godsend. I managed to get the latest JF os installed and as such am thoroughly enjoying my G1.
In the past, I had a Windows Mobile phone from HTC. One of my favorite applications on it was Pocket Scheme because it enabled me to write code ON my phone. I'd love to eventually spend time working on software FOR my G1, but right now I'm interested primarily in writing code while on the train, in line, etc.
As far as I know, Pocket Scheme is not available on the Android. I also came across Ruby for Android [2], but so far it force closes as soon as I open it.
So:
1. Are there any languages that are available for writing code on the android? Something with either an included editor AND repl (like Pocket Scheme) or even just an editor (?) or a repl (like Ruby for Android) would be fine.
2. What editor for making "plain text" files with any extension do you use?
3. In desperation I tried using echo to create a new shell script file the other day, and Android OS complained that the file system was read only. Can I make it r/w from within the android, or do I need to use ADB?
Thanks in advance. I tried googling for answers, but to no avail.
[1] http://www.mazama.net/scheme/pscheme.htm
[2] http://code.google.com/p/android-ruby/
Well you could flash Debian to a JF build and go from there.
You can remount it as r/w from the device. I can't remember exactly what the command is but it is something along the lines of "mount -oremount,rw /dev/block/mtdblock0 /system" anyone care to correct me if that is wrong? You can also use DroidSans Tweak Tools available free in the market, just don't use the lite version
Geniusdog254 said:
You can remount it as r/w from the device. I can't remember exactly what the command is but it is something along the lines of "mount -oremount,rw /dev/block/mtdblock0 /system" anyone care to correct me if that is wrong? You can also use DroidSans Tweak Tools available free in the market, just don't use the lite version
Click to expand...
Click to collapse
almosst correct on the command there, there is actually a space between the "-o" and "remount" so it should read
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
that would make your system partition read write, but if you wanna run shell scripts i would go grab gscript and just write them in there.
oops i typed it wrong i switched the rw and remount, it's fixed now sorry
tubaking182 said:
almosst correct on the command there, there is actually a space between the "-o" and "remount" so it should read
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
that would make your system partition read write, but if you wanna run shell scripts i would go grab gscript and just write them in there.
Click to expand...
Click to collapse
Haha that's funny. Ive been typing: "mount -o rw, remount -t yaffs2 /dev/block/mtdblock3 /system"
But. That's just what works for me. Found it when I first rooted my phone.

[Q] Simple adb question (or perhaps not?) Permission Denied

Hi all--in need of some help here--have been crusing the forums for three days and still hitting a brick wall...
Have a rooted (and minimally modded) Atrix 4g in serious need of a hard reset and all the pain that comes with as nearly every app force closes on startup.
Hoping to backup some of my data (contacts, SMS, etc), but unable to do so my usual way (an app, root explorer, or the like), so I'm attempting to use ADB pull to grab the .db files. I'm relatively comfortable with linux, but running into a problem with ro/rw permissions (I think).
have tried the following:
adb pull /data/...../mmssms.db (yields Permission Denied)
# cp /data/....mmssms.db (appears to copy, but no file in destination, and can't copy out of shell)
have been able to remount /system as rw, but not /data where the files are located.
Anybody have suggestions? I'd be most apprecative!
Copy the the files as superuser to your sdcard first and adb pull them from there.
Unfortunately, the whole reason I'm needing to reset is that every app (incl superuser accesses) force closes on start--no chance to move through the phone itself. Since the .db files are not in the usb-accessible file structure I'm thinking that ADB is the only way to access.
Does that make sense?
Hi, OP here--anybody else have a suggestion? Getting a little desperate here... Any thoughts would really be appreciated!
im assuming your accessing ADB via recovery?
You should be able to use su without superuser.apk's permission in that case - however, theoretically, you should not need to use su in recovery anyway.
you can try running
Code:
adb shell ls -l /data/data/*tele*/databases/mmssms.db
and see what you get permissions wise, maybe a chmod could fix it?
Otherwise you could try
Code:
adb shell mount -o remount,rw /data
Another alternative to cp and adb pull is cat
Code:
adb shell cat /path/to/mmssms.db > /path/to/destination-file.db
might copy remote mmssms.db to a local file, while
Code:
adb shell
cat /path/to/mmssms.db > /path/to/destination-file.db
exit
would copy remote to remote
Is /data mounted at all?
This is strange, you should have read access to everything, especially in recovery.
What phone and what recovery?
Its not something as simple as geting the URIs the wrong war round ('cmd local remote' vs 'cmd remote local')?
So, still tinkering... Will give it one last try before I call it quits and just wipe the bloody thing. So, your thoughts were spot on--its probably me missing something.
Quick data dump on progress to data:
Phone: Rooted Motorola Atrix running 2.2
no trouble accessing shell or via ADB
/data is mounted, though only in Read Only mode--can't seem to change, have tried several ways in various modes (shell, su, etc)
Permissions for mmssms.db are: -rw-rw---- radio radio
chmod 777 of the file yields: "Read-only file system," which makes sense since I can't seem to change /data... to rw
Tried to remount rw:
adb shell mount -o remount,rw /data
and
mount -o remount,rw -t yaffs2 /dev/block/mmcblk0p11 /system (for systeem
but get "Operation not permitted" in both cases.... UGH!
Hadn't thought of cat--great idea. Still no real joy however.
I seem to have managed a copy to /system, but can't seem to get it off the device or onto the SD card.
Thanks much for your help so far. Any final thoughts?
SO CLOSE!!!! (and yet...)
crags said:
Hadn't thought of cat--great idea. Still no real joy however.
I seem to have managed a copy to /system, but can't seem to get it off the device or onto the SD card.
Click to expand...
Click to collapse
SO FRUSTRATING!!!! so close, but not quite there--HELP!!!
As noted at the end above, have been able to copy the mmssms.db file to /system/ after remounting as RW
Can't seem to copy or pull off the device--still getting "Permission Denied" no matter which course I try!?!?!
It sounds as if your doing this while booted into the ROM, and (maybe) without su (root)?
su-ing might help, just type su and hit return to enter a root shell
alternatively, going in through recovery ('adb shell reboot recovery') might help as most recoveries ignore permission rules - make sure to mount the partitions your using though.
It almost sounds like the sdcard has no write permissions - you can get the NAND partitions to mount rw, but cant copy to the sdcard.
On my Desire, there is (at least) two mount points: /sdcard and /mnt/sdcard - maybe on your phone only one of your mount points has write permissions?
Otherwise i suggest going in via recovery. You can still use adb (will have to manually mount - 'mount /system' 'mount /date' and 'mount /sdcard' usually work, otherwise use the menu item in recovery )
When in recovery, and after mounting partitions/card, try adb pull, cp /sdcard and cat > sdcard (and if possible cat > computer) plus anything else i forgot (quite tired )
if these dont work something is messed up somewhere in the ROM, or likely kernel and so without ideas a reflash would be the only real solution :/
I did have a bare-minimum+apps recovery script (attached) which might be worth a read to see if your forgetting something obvious - it works on my desire

Can't remount /system in read-write mode.

Yes, my phone is a chinese Hero H2000+.
I have managed to stick su and busybox into /system/bin using debugfs, but there's absolutely no way I could find to make /system get into read-write mode.
If I type "mount -o rw,remount /system" it seems to work for about 1 second, but then it's remounted read-only. All the changes will be reverted (files I add/remove via script). If I try to run the same command again, it will show me a message saying filesystem is read only.
Does anyone know what might be causing this?
Thanks in advance.

Troubles Mounting System R/W

For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Nvm found it. I guess it's same as Pixel C.
Code:
mount -o rw,remount /system
Geofferey said:
For some reason I have never been able to mount my system r/w through adb or terminal emulator. I'm not quite sure what I'm doing wrong since I've been doing it for years now. I imagine it has to do with root. I can use ES file explorer and modify system to my hearts content just not through adb or terminal emulator. I am on 7.1.1 Pure Nexus with ElementalX 1.08 and SuperSU with 2.79 binaries. I've tried to mount multiple different ways and all result in same error.
Code:
sailfish:/ # mount -o remount,rw /system
mount: '/dev/block/bootdevice/by-name/system_b'->'/system': Device or resource busy
Click to expand...
Click to collapse
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Also, if you check the magisk thread there is a way to use the mount remount command inside root browser
mate9-109 said:
Same here but with Oneplus 3T.
I think its kind of encripted "new way" in Android 7.1.1
Click to expand...
Click to collapse
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Geofferey said:
Nope just a different mount syntax not encrypted at all. I was kinda thinking same at first like a security feature or root keeping you from so you don't accidentally modifying system.
mount -o rw,remount /system
Instead of
mount -o remount,rw /system
Click to expand...
Click to collapse
Sadly I tried your new syntax, adb did some stuff, but it does not work either.
Anyway thank you very much, your solution almost got it.
:good::good::good::good::good:

Categories

Resources