permission denied to write file despite rooted - Android Q&A, Help & Troubleshooting

I'm trying to put some firmware file under /system/vendor/firmware or /system/etc/firmware, it shows the fs is read only, so I remounted /system/ as read/write with
Code:
mount -o rw,remount /system
, and used su, but when I try to create any file under these 2 location, a permission denied error still occurs. I tried to do so in both termux and adb, the same result. What's causing this? Thanks

@kdlsw
Try
Code:
adb shell "su -c 'mount -o rw,remount -t auto /system'"

jwoegerbauer said:
@kdlsw
Try
Code:
adb shell "su -c 'mount -o rw,remount -t auto /system'"
Click to expand...
Click to collapse
Tried it, still the same error.
I'm not sure if this is the remount problem, if I don't remount, the error is different (Read-only file system), after remount it's permission denied.

@kdlsw
I'm pretty sure the MOUNT worked successfully, otherwise you'ld have got an error returned: I guess you got returned "remount succeeded".
It seems to me dm_verity is enabled what blocks writing to /system: Hence disable it and reboot, then run commands as needed
Code:
adb devices
adb disable-verity 2>nul >nul
adb reboot
adb wait-for-device
adb shell "su -c 'mount -o rw,remount -t auto /system'"
<YOUR ADDITIONAL COMMANDS HERE>

jwoegerbauer said:
@kdlsw
I'm pretty sure the MOUNT worked successfully, otherwise you'ld have got an error returned: I guess you got returned "remount succeeded".
It seems to me dm_verity is enabled what blocks writing to /system: Hence disable it and reboot, then run commands as needed
Code:
adb devices
adb disable-verity 2>nul >nul
adb reboot
adb wait-for-device
adb shell "su -c 'mount -o rw,remount -t auto /system'"
<YOUR ADDITIONAL COMMANDS HERE>
Click to expand...
Click to collapse
thank you! I'll try this! I also found a workaround, mounting the directory in recovery, and the problem is gone. Thanks!

Related

Superuser.apk

I have successfully installed a Superuser.apk but it does not seem to be working properly. Titanium reports that Su does not elevate to root.
I have debugging enabled and I have connected through adb shell but nothing seems to work.
Anyone have any success? If so, which version did you use?
Here is my method
I download 2nd link from here :
http://forum.xda-developers.com/showthread.php?t=682828
After unzip (E:\Android\ROOT\step4\ directory for my example) :
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push E:\Android\ROOT\step4\system\bin\su /system/bin/su
adb shell chmod 6777 /system/bin/su
adb install E:\Android\ROOT\step4\system\app\Superuser.apk
adb reboot
trying this now, will report
thanks a lot works like a charm..
i can confirm this works perfect
very good... spread 30min to install it yesterday night...
Will be included in new version. Sorry just forgotten
Regards
Bin4ry
You make very good job so no problem for that
Thank a lot for your hard work !
gibou13 said:
Here is my method
I download 2nd link from here :
http://forum.xda-developers.com/showthread.php?t=682828
After unzip (E:\Android\ROOT\step4\ directory for my example) :
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push E:\Android\ROOT\step4\system\bin\su /system/bin/su
adb shell chmod 6777 /system/bin/su
adb install E:\Android\ROOT\step4\system\app\Superuser.apk
adb reboot
Click to expand...
Click to collapse
I am trying to do same thing with mediascape , but I get error
"Failure [INSTALL_FAILED_DEXOPT]", I am reading on google that its something related to the .odex file, how can I install/or whatever I have to do in order to be able to put mediascape back.
I know I just could restore and than root again and remove rm command for mediascape from ch file, but I am trying to remove more branding apps of telenor firmware and flash and root again with clean system.
PS: Messing with my phone as I don't have any knowledge in programming...just google.
Thx
Hi
You can try to do this :
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
cd /system/app
cp /sdcard/apps/mediascape* .
cp /sdcard/apps/MediascapePluginManager* .
reboot
gibou13 said:
Hi
You can try to do this :
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
cd /system/app
cp /sdcard/apps/mediascape* .
cp /sdcard/apps/MediascapePluginManager* .
reboot
Click to expand...
Click to collapse
never mind guys Jerpelea posted how to do it.
jerpelea said:
restore mediascape (from step4 folder)
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb shell dd if=/sdcard/apps/MediascapePluginManager.apk of=/system/app/MediascapePluginManager.apk
adb shell dd if=/sdcard/apps/MediascapePluginManager.odex of=/system/app/MediascapePluginManager.odex
adb shell chmod 644 /system/app/MediascapePluginManager*
adb shell dd if=/sdcard/apps/mediascape.apk of=/system/app/mediascape.apk
adb shell dd if=/sdcard/apps/mediascape.odex of=/system/app/mediascape.odex
adb shell chmod 644 /system/app/mediascape*
adb shell reboot
Click to expand...
Click to collapse
I got mediascape back as I did't find better media explorer.
One thing can anyone explain what this lines of code mean(Jerpelea's mediascape restore), each separate if u can, I am trying to understand. As I said I am no programmer but I like to learn.
Thanks.
I've tried doing this 4 times... and it's not working ^^;;
Is it missing a step? Or is this all that I need to do?
I get no errors when doing it yet the program isn't working a shown in the screens realunited... ^^;
taye look into the second post of the guide thread -- it has all the info necessary, else: poke me on irc
gibou13 said:
Here is my method
I download 2nd link from here :
http://forum.xda-developers.com/showthread.php?t=682828
After unzip (E:\Android\ROOT\step4\ directory for my example) :
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push E:\Android\ROOT\step4\system\bin\su /system/bin/su
adb shell chmod 6777 /system/bin/su
adb install E:\Android\ROOT\step4\system\app\Superuser.apk
adb reboot
Click to expand...
Click to collapse
sorry for this very very noob question...
where i try this command?
at windows?
or at my android device with better terminal?
done...
i trying it my self..
sorry for my noob question...
anyway i still don't know how to use superuser lol....
greatermushasi said:
sorry for this very very noob question...
where i try this command?
at windows?
or at my android device with better terminal?
done...
i trying it my self..
sorry for my noob question...
anyway i still don't know how to use superuser lol....
Click to expand...
Click to collapse
It's done from a windows dos prompt. In windows, click on START > RUN > then enter CMD. Next do as mentioned. Happy entering
Confirmed... works for me as well.

[Q] All adb commands saying permission denied

Trying to install Clockwork recovery mod on my LG Optimus V and I am running into a few problems. The version of ROM Manager that I got from the market does not list my phone as a model to choose from when the Confirm your phone window appears. So, to get around this, I decided to try and install another recovery (such as Amon's) using an adb shell. Anytime I try to type a command while in the adb shell it returns the command and says "permission denied" next to it. The $ is there, my phone is rooted, the SD card is unmounted and USB Debugging ot turned on.
I can view my phone from adb devices and even look at the log of its activity with adb logcat.
The first command I type in is "adb shell mount -o rw,remount /dev/block/mtdblock3 /system". After I hit enter, it says mountperation not permitted.
I also can't boot into recovery mode at the moment because I had to choose a phone that is different from mine when I tried to flash Clockwork Recovery mod.
I'd greatly appreciate any help, I'll get some sleep and check back in a few hours.
ironpirat3 said:
The $ is there, my phone is rooted
Click to expand...
Click to collapse
The $ is normal user and not root (#).
Code:
> adb shell
$ su
# mount -o rw,remount /dev/block/mtdblock3 /system
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
On a side note, how do I get out of my phone and back into command prompt after using the adb shell command?
ironpirat3 said:
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Click to expand...
Click to collapse
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
No. You run adb shell only, and then su, and then remount from the phone shell, NOT via adb. Clearly written in the example above.
To exit a shell, type exit.

[Q] Unable to adb remount

"Operation not permitted"
What is causing this? I really want to push some files to my EVO.
Help
I have done it previously on other Roms i have flashed. I am currently on Goodies 1.5.
typhoonikan said:
"Operation not permitted"
What is causing this? I really want to push some files to my EVO.
Help
I have done it previously on other Roms i have flashed. I am currently on Goodies 1.5.
Click to expand...
Click to collapse
I believe the adb binary has to be replaced with one that has permission to do this, it is often disabled in stock builds.
an easy way around this is
adb shell
su
mount -o remount rw, /system
modplan said:
I believe the adb binary has to be replaced with one that has permission to do this, it is often disabled in stock builds.
an easy way around this is
adb shell
su
mount -o remount rw, /system
Click to expand...
Click to collapse
I typed just as you did. No help.
My results as copy and pasted:
c:\Android>adb shell
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount rw, /system
mount -o remount rw, /system
[email protected]:/ # exit
exit
[email protected]:/ $ exit
exit
c:\Android>adb remount
remount failed: Operation not permitted
typhoonikan said:
I typed just as you did. No help.
My results as copy and pasted:
c:\Android>adb shell
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount rw, /system
mount -o remount rw, /system
[email protected]:/ # exit
exit
[email protected]:/ $ exit
exit
c:\Android>adb remount
remount failed: Operation not permitted
Click to expand...
Click to collapse
What I posted remounts the system partition read/write. No need to adb remount after that, you can write to /system at that point.

[help] Mounting Android Emulator System Partition As RW by adb

i need to mount android emulator system partion as rw by adb commands
adb -s emulator-5554 shell mount -o rw,remount
adb -s emulator-5554 shell mount -o rw,remount /system
adb -s emulator-5554 shell mount -o rw,remount /data
adb -s emulator-5554 shell mount -o rw,remount /data/data
and i got always this error
Usage: mount [-r] [-w] [-o options] [-t type] device directory
could not open /proc/mounts
Click to expand...
Click to collapse
also i try to put it into writable system by cmd
or edit file path and add -writable-system next to it but still fail
i hope some one can help me here

how to install su in system ? /Traditional option

i cant install su in system i test all many option and still cant please tell me
stargam said:
i cant install su in system i test all many option and still cant please tell me
Click to expand...
Click to collapse
Try this
Code:
adb devices
adb disable-verity
adb reboot
adb devices
adb shell "mkdir -p /data/local/tmp > 2/dev/null"
adb push c:\su /data/local/tmp > nul
adb shell "chmod 0777 /data/local/tmp/su"
adb shell "-c '/data/local/tmp/su'"
adb shell "setenforce 0"
adb shell "cd /"
adb shell "mount -o rw,remount -t auto /system"
adb shell "cp /data/local/tmp/su /system/bin"
adb shell "mount -o ro,remount -t auto /system"
adb reboot
adb devices
adb enable-verity
adb reboot
Ok I try
jwoegerbauer said:
Try this
Click to expand...
Click to collapse
When I test adb "mkdir-p/data/local/tmp>2/dev/null" he say no such file or directory
stargam said:
When I test adb "mkdir-p/data/local/tmp>2/dev/null" he say no such file or directory
Click to expand...
Click to collapse
1. I think you forgot to type a simple "space" between Command: "mkdir -p" and Dirname: "data/local/tmp > 2 /dev/null"
2. And the last part "> 2 /dev/null" means redirect stdout (or error stream) and ignore it.
Conclusion, maybe just a typo? or err. mssge isn't what you think --> redirection made it dissappear.
Hopefully this works...
otherwise use this code:
adb devices
adb shell "mkdir -p /data/local/tmp" 2>nul >nul
adb shell "chmod 0755 /data/local/tmp"
adb push C:\su /data/local/tmp > nul
adb shell "chmod 0777 /data/local/tmp/su"
adb shell "/data/local/tmp/su -c 'cd / && mount -o rw,remount -t auto /system'"
adb shell "cp /data/local/tmp/su /system/bin"
adb shell "/data/local/tmp/su -c 'setprop ro.build.type user-debug'"
adb reboot
Click to expand...
Click to collapse
Cheerz!
webbex said:
1. I think you forgot to type a simple "space" between Command: "mkdir -p" and Dirname: "data/local/tmp > 2 /dev/null"
2. And the last part "> 2 /dev/null" means redirect stdout (or error stream) and ignore it.
Conclusion, maybe just a typo? or err. mssge isn't what you think --> redirection made it dissappear.
Hopefully this works...
otherwise use this code:
Cheerz!
Click to expand...
Click to collapse
Thanks it work ?

Categories

Resources