I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
T3ntr0 said:
I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
Click to expand...
Click to collapse
Search forum for superrepack tool or SystemRW script. Good luck!
Worked on Android 11 with lineageos: https://www.howtogeek.com/140576/how-to-edit-the-hosts-file-on-android-and-block-web-sites/
Related
hello x10 buddys
srry for my noob question, but i have a problem...
when i go to run - cmd
adb shell
$ su
#
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
i am able to do this.
No i wanna install a theme with the file ****.cmd
I start the cmd file and i will get this error
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mount: Operation not permitted
Why i get this error?
i am not adb shell # at this moment?
You'll only be able to remount while you've root permissions...
If you do SU before doing the .cmd then you should be fine...
(You might also have problems with file permissions, in which case you'll need to run chmod 755 on some directory after remounting. If you've this problem, let us know. Maybe post the .cmd?)
Sent from my X10i using XDA App
i thougt that was the problem ty
but how i get SU before run the cmd file?
when i do adb shell in the directory of the theme
after that i cant run the cmd files or i did something wrong.
Spend the hole night on it ^^
the cmd file will be alright, its from the New theme here
Have u tried
Adb shell su
Then allow it with superuser?
I'm not sure if it will work as I haven't tested it...
Hope it helps
in my Su on the phone
Unkonwn
/system/bin/sh als root (uid: 0)
i wanna run ***.cmd when i am in cmd with su#
wen i start the **cmd i wil not have su#
i need to do....
adb shell
$ su
#
and then put a command to run ***.cmd file of the theme
when the **.cmd file in c:\desktop\newfolder\***.cmd
which command i need to write when i in adb shell # to run the cmd file??
If I don't remember wrong, I had to do this chmod 4755 /system/bin/su to get the "#" prompt (su) as default in Better Terminal.
Perhaps it will help you too ? (allowing the scripts to run as superuser)
Have you tried doing everything with adb shell? Ie
Adb shell su
Hit enter
Adb shell mount blah blah blah
Hit enter
Adb shell run the cmd
I read somewhere u should only chmod as a last resort and if u know what you're doing. For the most part i have no idea what's going on (i feel like Gary busey) so i haven't tried the chmod.
I would have posted the actual script but its a pita to do from my phone
he said run:not found ^^
How about at the beginning before adb shell su move to the directory its in.
Eg.
cd C:\the directory the cmd is saved
hphhaze said:
he said run:not found ^^
Click to expand...
Click to collapse
Adb shell run the cmd does NOT mean you should type in Adb shell run <some command>.
It means you should type in Adb shell <some command> where <some command> can be for example su, cp, dd or something else (unix commands).
tread can closed. I dont get it...
You're giving up that quick? :-(
Come on!!!!
Solution A:
1. Go here and download X10Root1.0.8.apk.
2. Install the apk to your phone.
3. Run the app and use it to "unsecure sh".
4. Run your CMD script.
5. Run the app again to "secure sh".
6. If you skipped #5 (secure), go back and do #5.
Solution B (alternative):
1. Download the Standalone Toggle Secure Shell script.
2. Extract and run it (it's a CMD script).
3. Select "Unsecure" and follow the directions (requires some typing or copy/pasting).
4. Run your CMD script.
5. Run the toggle script again to select "Secure".
6. Don't skip #5 (secure).
tinysu: Compatible "su" command for Root Explorer / for HC images and what not?
So, I just installed HoneyComb to my NC's eMMC. Works well!
Unfortunately apps such as Root Explorer are not too happy because the "su" command provided with these ROMs is too chatty and that confuses them.
So, here is a very quiet, working "su" command. With it, Root Explorer will happily remount partitions, etc.
Note that, like the ROM's "su" command, SuperUser is out of the picture so use with care.
To install, using adb:
Code:
adb shell
mount -o remount,rw /dev/block/mmcblk0p5 /system
exit
adb push su /system/
adb shell
busybox cp /system/su /system/bin/
mount -o remount,ro /dev/block/mmcblk0p5 /system
All done. Note that the "busybox cp" should preserve the application's suid bit.
been there done that... lol
http://forum.xda-developers.com/showpost.php?p=11304464&postcount=46
no worries.
Even the Superuser application works now: http://forum.xda-developers.com/showthread.php?t=953110\
cyansmoker said:
So, I just installed HoneyComb to my NC's eMMC. Works well!
Unfortunately apps such as Root Explorer are not too happy because the "su" command provided with these ROMs is too chatty and that confuses them.
So, here is a very quiet, working "su" command. With it, Root Explorer will happily remount partitions, etc.
Note that, like the ROM's "su" command, SuperUser is out of the picture so use with care.
To install, using adb:
Code:
adb shell
mount -o remount,rw /dev/block/mmcblk0p5 /system
exit
adb push su /system/
adb shell
busybox cp /system/su /system/bin/
mount -o remount,ro /dev/block/mmcblk0p5 /system
All done. Note that the "busybox cp" should preserve the application's suid bit.
Click to expand...
Click to collapse
LOL.
I actually love that our community is so hard at work that this sort of thing happens
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.
Hi guys,
So I'm in a spot of bother with my Android Tablet (Sony Tablet S) - I deleted the default launcher from the /system/app folder and when I power my device on I get a constant stream of force closes. It can't be used, all I can access is the settings menu.
I'm trying to push a launcher across into the system/app folder - it's rooted, and ADB is working.
Now here's the trouble.
I start CMD from platform-tools folder > adb devices > my device is listed.
adb shell > adb devices > no longer listed.
Any commands I enter in the shell, I "su" and its granted permissions, then adb push 1.apk /system/app > error: device not found. If I try the same without adb shell, then it's permission denied.
I'm pretty desperate to get this working, but any ideas please? I've contacted Sony, I hope that they will repair this, at a cost or not.
Thanks.
When you are in the shell, you don't need to type "adb" anymore, maybe that's it. "push" must be used with adb though, but not in adb shell.
For the permission problem, is /system/ mounted writeable? You could try running this line (not in shell):
Code:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
This should mount /system/ writeable. Then, try again with adb push. This might differ from device to device though, I don't know if it will work for you.
Other than that, I recommend you pose your question again in the subforum specific to your Android device: http://forum.xda-developers.com/forumdisplay.php?f=1294
Thanks for the response.
I've just run that, and got mount: operation not permitted.
Ok, try it again as follows:
Code:
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Ok, when I run that it works, but as soon as I push, I get device not found?
Anymore suggestions please?
what exactly do you type in when you push? Do you push after entering "adb shell"?
I've made some progress!
I've mounted the /data partition with busybox and now have GoLauncherX.apk in there. But I'm still getting all of the force closes and I pressing the home button, I can't get to the home, it's almost likes it's not installed....
I'll keep trying but it could be something else at fault.
You might need to reflash the ROM. To find out how that is done, check the subforum appropriate to your device.
If you deleted the stock launcher from the system partition, I would suggest you try to get it back there first.
I noticed on some of the recent AOSP ROMs (AICP and Vanir that I remember for sure) that trying to "adb push <file> /sdcard/" results in a basic permission denied error. I tried "adb push <file> /storage/emulated/0/" and got a slightly more specific error saying that the filesystem was mounted as read only. When I tried "adb push <file> /data/media/0/" it went through as expected. I'm rooted with SuperSU 2.14, enabled USB debugging, and granted root to both apps and adb. I tried doing "adb root" and "adb remount" which should've given root and remounted /system as read-write, but I got the same results (using adb and fastboot from the most recent SDK).
It works fine in recovery (TWRP 2.8.0.2), but is there a way to fix it so that the /sdcard/ path works again?