[Q] Can't paste file in /system/etc. after setting permissions to RW - Android Q&A, Help & Troubleshooting

I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.

j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
Theres other apps that use root that are free,just use google or try android/apps on here,the search function is your best friend.ES gives me issues also.

j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
You can use the terminal emulator, this way (assuming the host file is located in your sdcard):
Code:
su
mount -o rw,remount /system
cp /sdcard/hosts /system/etc/hosts
--set permissions here if you need
mount -o ro,remount /system
Personaly, I don't face any problem with ES File Explorer, but you can try this one (free, lightweight and useful)

cant is cant
RoberGalarga said:
You can use the terminagoing to be lator, this way (assuming the host file is located in your sdcard):
Code:
su
mount -o rw,remount /system
cp /sdcard/hosts /system/etc/hosts
--set permissions here if you need
mount -o ro,remount /system
Personaly, I don't face any problem with ES File Explorer, but you can try this one (free, lightweight and useful)
Click to expand...
Click to collapse
The problen was defined, he said he is rooted he set the permissions, set the system or as mounted read write... the answer is not just use this app, if you are rooted # not $ and you can not read or write something it is not going to be a standard answer... I have tje same problem, I thonk it is because I used a rooter for chines operating system, and it gained root but has some issues. A hint to this was that I had to run ot 2ce to do the rooting. This is for sure tho, if ypu cant do it in terminal as su, np app is going to be sble to do it for you. I suggest to do as I am going to to do, and that is to hard reset, and find a non chinese tablet rooter.

j0nthn said:
I can't copy the file 'hosts' back to system/etc. after I cut it out of the folder a couple mins ago. When I use ES File Explorer (don't wanna pay 4euros for Root Explorer..) to try and paste it back (with everything set to RW and having root permissions) it says 'permission denied'. I don't know what I'm doing wrong.. Help is greatly appreciated.
Click to expand...
Click to collapse
its due to root permission............try reseting root permission through superuser app.................

Related

[Q] Mounting RW

I am trying to install TapNTap keyboard in Vegan Ginger. (yeah, I know but I want to anyway). I need to copy two files to /system/app and system/lib. I presently have the files stored in /mnt/sdcard/download. I have terminal emulator installed and when I su I appear to get root (prompt changes to #). I was able to create an empty directory in /. When I try to copy the file to /system/app I get a message that it is a Read-only file system. When I do an ls -l the permissions show drwxr-xr-x for the directory. The owner is root and the group is root. It would seem that as su I should be able to copy the file there. Possibly it is mounted as RO. I tried to use a remount command but it failed. I'm not well versed in that so I may have done something wrong. Long and short - how do I get the file copied into the directory?
http://lmgtfy.com/?q=remount+system+rw+android

[q] problem editting build.prop

cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Copy it to another folder edit the copy and then move the edited file in the correct folder.
tried that already, didnt work. got another error
I use Root Explorer to do any editing.
Any other suggestions? I'd rather not have to pay for it
joshtb86 said:
cannot edit build.prop. i get an error when trying to edit it with es file explorer (there was an error when trying to save this file.)
any help? ive edited it before, but i dont know how. im pretty sure i did it this way but im not sure why its not saving properly this time.
running calk+clemsyn rom/kernel combo.
thanks!
Click to expand...
Click to collapse
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# /system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
joshtb86 said:
Any other suggestions? I'd rather not have to pay for it
Click to expand...
Click to collapse
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
cbay said:
Did you have ES file explorer in Root mode?
In Es file explorer
Settings->Root Options -> both boxes checked, (HiAPK mode for first box)
I usually copy the file to sdcard and modify it, get ES explorer in root mode and copy it back. Do a backup before, in case you mess it up.
I usually use a terminal in su mode for editiing/copying, but that might not be needed.
Click to expand...
Click to collapse
if i use CM Mod, i cant see any files. if i use HiAPK, all the files have -rw and a lot of stuff before it and i cant read anything, but it does mount. CW had problems mounting the drive. im gonna try out the terminal commands
rajeevvp said:
If the build.prop you want to edit is in /system, then you'll have to mount /system read-write before you can modify any files there:
Code:
$ su [I]Become superuser. Prompt will change to '#'.[/I]
# /system/xbin/mount -w -o remount /system
[I]Edit the file[/I]
# /system/xbin/mount -r -o remount /system
You must have the Superuser app from Market and busybox installed on the gTablet for the commands to work. If you can't edit the file in ES File Explorer because of permission errors, copy the file into /mnt/sdcard via the command line, edit it there (or on the PC after removing the card), then move it back into place in /system and restore the old permissions:
Code:
$ cp /system/build.prop /mnt/sdcard/.
[I]a) The build.prop file in /mnt/sdcard should be editable now in ES File Explorer.
Edit the file, then do:
OR
b) Unmount the SD card via Settings > Storage, then remove the SD card and
edit the file elsewhere. Plug it back in, and, after it mounts do:[/I]
$ su
# /system/xbin/mount -w -o remount /system
# mv /mnt/sdcard/build.prop /system/build.prop
# chown root.root /system/build.prop
# chmod 644 /system/build.prop
# /system/xbin/mount -r -o remount /system
All this is much easier through adb if you have that setup.
Note: Do not type the prompts--the '$' and '#' characters--in; they're just there to tell you what the Terminal screen should look like.
Click to expand...
Click to collapse
when i tried the mv command to move it back, i still got errors in moving it and was not able to
joshtb86 said:
when i tried the mv command to move it back, i still got errors in moving it and was not able to
Click to expand...
Click to collapse
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
rajeevvp said:
Try
Code:
/system/xbin/mv /mnt/sdcard/build.prop /system/build.prop
instead of plain 'mv'. The default Android mv command is idiotically implemented. (See this post if you're interested in the details):
http://forum.xda-developers.com/showpost.php?p=13956585&postcount=4
Using 'cp' command instead of 'mv' should also work; this way, you'll also have a backup of build.prop in /mnt/sdcard/.
Click to expand...
Click to collapse
thanks so much again. i finally got it to work, but i just wanted to get netflix to work, and it still doesnt. after all that work. ugh.
JoTeC said:
I use Root Explorer to do any editing.
Click to expand...
Click to collapse
Thanks, I tried two other applications and they didn't work. Was able to edit with Root Explorer. didnt fix the Netflix playback. Bummer.
***** changing the Nexus S to HTC Vision and samsung to HTC did the trick.
Root explorer will work, and is a great app. Worht the money.
Also, ADB from a PC will work as well. Just install the android sdk and use ADB.
From windows cmd prompts the commands are just adb remount (to remount as root) then "adb pull /system/build.prop" (this will pull it to the sdk platform-tools folder that adb.exe is in) and then edit to your hearts delite.
"adb push build.prop /system/build.prop" to send it back.
I was able to use ES File System by unchecking the Mount File System option in the Root options menu and then rechecking it. I imagine that it forced a remount of the file system in a writable mode.
This worked on our nabi big tab hd24
We now have true multiuser, where everyone has their own login, files, emails, bookmarks, web history, etc; as it should be.
I first did a factory reset, then installed kingo root, then another reset, did the build prop edit this suggested (es file explorer did not work) but build prop editor did....
We now have the nabi big tab hd 24 running as our primary desktop workstation computer...
No we just wish for a room update to be made available with the latest version of Android.
4.4.2 is getting old, and as is common little manufacturer long term support...

[Q] Widget.txt Write Permission

Hey all,
I was wondering if there is an easy way to change the file permission on the widget.txt file found in /system/customize. I want to change the sync button on the pull down menu to brightness but can't right now because the file is read only. I have searhed, but have not been able to find the right fix. I am running BAMF stripped 1.8 with one of ZHP's battery icon mods. I tried setting the system to write mode in BAMF toolkit, but that didn't work. I use ADAO file manager for file browsing and unfortunately it doesn't have the ability to long press and change permissions. Is there code I can use in terminal emulator to change the permission? I would like to make the change on the phone but I am not against using adb if I have to.
Thanks
Josh
Up^^^
Need 10
You probably have to remount /system with read/write permissions. Root explorer is the easiest way but if you don't want to pay for the app, you can use terminal emulator.
Something like this:
$ su
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Thanks, I will give that a try. After I set the system to read/write and change the widget file do I need to type something similar in terminal emulator to set the system back to read only?

File copy and replacing in /system directory with root permission programmatically?

Can anyone kind enough show me how to copy files from my app assets folder to /system folder? I know how to get root access and all. For example: I want to copy file from "/assets/lib/libs.so" and check if this file already exist, if it does replace it to new "/system/lib/libs.so".
I think You could create a script (its language should not be too difficult) and make it start on every boot (every scripter Can do this) But I don't know how much time it would take and if You reboot often... Try to look for an app that runs script programmatically
Sent from R'lyeh using Cthulhu app
tsirhcitna said:
I think You could create a script (its language should not be too difficult) and make it start on every boot (every scripter Can do this) But I don't know how much time it would take and if You reboot often... Try to look for an app that runs script programmatically
Sent from R'lyeh using Cthulhu app
Click to expand...
Click to collapse
Sorry I haven't been clearly state that I want to write an app that does this, like in java.
Ooops my fault! I know java for PC but I never studied it for Android (when I tried to program for android the emulator taking twenty minutes to start stopped me). I don't know how to help you but seeing nobody is answering I can suggest you to go on Stack Overflow, it's all about coding, and all the answer I've seen on it where very good (You can also look for file manipulation on some android java tutorial)
Sorry I can't help you more
tsirhcitna said:
Ooops my fault! I know java for PC but I never studied it for Android (when I tried to program for android the emulator taking twenty minutes to start stopped me). I don't know how to help you but seeing nobody is answering I can suggest you to go on Stack Overflow, it's all about coding, and all the answer I've seen on it where very good (You can also look for file manipulation on some android java tutorial)
Sorry I can't help you more
Click to expand...
Click to collapse
can u write java code that wrap around command line that copy file to system folder? this will work, cos i can get su, just need to mount rw /system/lib then copy file from my app assets folder and replace the file in /system/lib
homi3kh said:
Can anyone kind enough show me how to copy files from my app assets folder to /system folder? I know how to get root access and all. For example: I want to copy file from "/assets/lib/libs.so" and check if this file already exist, if it does replace it to new "/system/lib/libs.so".
Click to expand...
Click to collapse
I suppose you're getting Root Permission running su command with Runtime.getRuntime().exec... right?
That's fine, you now need to run another commands:
To check if /assets/lib/libs.so (or any other file) exists:
Code:
ls /assets/lib | grep libs.so
If the file exists, you'll get "libs.so" as output of that command (otherwise, you will not get anything).
To remount /system in RW mode:
Code:
mount -o rw, remount -t yaffs2 /dev/block/mtdblock4 /system
Ok, now you can copy your file (or files, I dunno):
Code:
cp /assets/lib/libs.so /system/lib/libs.so
And finally, remount /system in RO mode again:
Code:
mount -o ro, remount -t yaffs2 /dev/block/mtdblock4 /system
Pretty easy, it isn't? :highfive:
Note: I highly recommend you to use RootTools, it's a lib to run commands as root very easily
RoberGalarga said:
I suppose you're getting Root Permission running su command with Runtime.getRuntime().exec... right?
That's fine, you now need to run another commands:
To check if /assets/lib/libs.so (or any other file) exists:
Code:
ls /assets/lib | grep libs.so
If the file exists, you'll get "libs.so" as output of that command (otherwise, you will not get anything).
To remount /system in RW mode:
Code:
mount -o rw, remount -t yaffs2 /dev/block/mtdblock4 /system
Ok, now you can copy your file (or files, I dunno):
Code:
cp /assets/lib/libs.so /system/lib/libs.so
And finally, remount /system in RO mode again:
Code:
mount -o ro, remount -t yaffs2 /dev/block/mtdblock4 /system
Pretty easy, it isn't? :highfive:
Note: I highly recommend you to use RootTools, it's a lib to run commands as root very easily
Click to expand...
Click to collapse
yes this is what i'm asking for but can you wrap it with RootTools code for me too? it's a bit confusing cos I don't know much about command line.
Ok. It's kinda easy, BTW:
To grant root permissions (If you already have root permissions in other way, you don't need to do this again):
Code:
if (RootTools.isAccessGiven()) {
// your device is rooted!! The fun can begin :)
}else{
// Not rooted... no fun here :(
}
Now, an example using 1 command (you'll need to develop the rest). Checking if /assets/lib/libs.so exists:
Code:
try {
List<String> output = RootTools.sendShell("ls /assets/lib | grep libs.so",-1);
if (output.get(0).equals("libs.so")){ //output.get(0) is the way to read 1 line of the command output
//the file exist... you can continue
}else{
//something is wrong, or the file is missing... =/
}
} catch (Exception e) {
// something went wrong, deal with it here
}
Proceed in the same way to run the other commands. Note that there are ways to run several commands using RootTools, you can check them in the Usage Page (I think will be a bit easy, since you don't need to read the output of the other commands).

[Q] Cannot Get Read/Write Access

I've been really struggling all day trying to adb push a file into my phone, specifically /system/media/audio/ui .
My phone is the Verizon Galaxy S4 - VRUFNC5 - 4.4.2 - Running the HyperDrive ROM v19.0.
I rooted via Towelroot, I'm running SafeStrap Recovery, I have SuperSU v2.16, ES File Explorer 3.2.3.1, and Busybox v1.22.1-Stericson
No matter how I try to achieve read/write through adb shell, nothing has been successful. I have also attempted to go into ES File Explorer>Root Explorer>Mount R/W , however this still does not work. This both doesn't enable me to push files into the /ui folder, and while ES Explorer can try to copy files into it, they end up corrupting.
When I say corrupting, I mean that before copying a .ogg file, it will play via the sound player, but after copying/pasting into /ui, it will not play. Trying to "cp" or "busybox cp" the file from the sdcard into /system/media/audio/ui produces the same corrupted result.
Just an example of a code I've tried to enter in adb shell after su: "mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system" or "mount -o rw,remount /system/media/audio/ui /system" and/or "chmod 777 system/media/audio/ui"
Can someone please help me out? I've never had this much trouble trying to customize my phone before.
Thank you!
_SuperDrewb said:
I've been really struggling all day trying to adb push a file into my phone, specifically /system/media/audio/ui .
My phone is the Verizon Galaxy S4 - VRUFNC5 - 4.4.2 - Running the HyperDrive ROM v19.0.
I rooted via Towelroot, I'm running SafeStrap Recovery, I have SuperSU v2.16, ES File Explorer 3.2.3.1, and Busybox v1.22.1-Stericson
No matter how I try to achieve read/write through adb shell, nothing has been successful. I have also attempted to go into ES File Explorer>Root Explorer>Mount R/W , however this still does not work. This both doesn't enable me to push files into the /ui folder, and while ES Explorer can try to copy files into it, they end up corrupting.
When I say corrupting, I mean that before copying a .ogg file, it will play via the sound player, but after copying/pasting into /ui, it will not play. Trying to "cp" or "busybox cp" the file from the sdcard into /system/media/audio/ui produces the same corrupted result.
Just an example of a code I've tried to enter in adb shell after su: "mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system" or "mount -o rw,remount /system/media/audio/ui /system" and/or "chmod 777 system/media/audio/ui"
Can someone please help me out? I've never had this much trouble trying to customize my phone before.
Thank you!
Click to expand...
Click to collapse
There are some Google Play apps that supposedly fix the issue but I had mixed results with them. For now I'm using an Xposed module on Empty Galaxy that is working well.

Categories

Resources