[Q] how to modify the /etc/hosts file - Galaxy Tab 10.1 Q&A, Help & Troubleshooting

hi, folks
i need to add some ip address to /etc/hosts since a lot of google services blocked here
i tried with root explorer, open the /system/etc/hosts file in editor, but it looks like can not permently save the changes
i also tried with command line under ""better terminal, but failed with error permission denied
any ideas, thanks

In root explorer, are you pressing the "Mount R/W" button in the top left corner before making your edits?

el3ctrik said:
In root explorer, are you pressing the "Mount R/W" button in the top left corner before making your edits?
Click to expand...
Click to collapse
yes, I did it, but no luck at all, is it a bug of "root explorer"?
i'm using version 2.16

it's done, with "Better Terminal":
# su
# cat myhosts >> /system/etc/hosts

Related

[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...

Hosts file

I am trying to update my hosts file and have done so on CM7.1RC1 (the best Rom so far), its proporly formatted as I do this all the time on my linux boxes but for some reason on my gtab it does not work. With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
brwatters said:
With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Click to expand...
Click to collapse
Try both pings (the android one in /system/bin and the busybox one in /system/xbin--you may only have one on some firmwares) to check.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
Click to expand...
Click to collapse
Yes--but programs have to use it. The busybox utilities all use it and the stock browser also; don't know about openvpn.
Are the permissions set correctly on /etc/hosts (actually, /system/etc/hosts)? It should be readable for all users.
The issue is that the hosts file (/etc/hosts) in GTab is readonly and the device has to be rooted to edit the file. Now I have not been able to root my GTab running Gingerbread. This makes it impossible to effectively use VPN to access the corporate network. I tried to create another hosts file in /system/bin folder but it would not let me save anything in that folder. Without being able to edit the /etc/hosts file VPN seems to be of limited value in GTab.
Any ideas?
There is no need to "root" a gTab running a custom ROM. If an "adb shell" command works, then you have root permissions. Same thing if you download and install the Superuser app from Market.
To edit /system/etc/hosts, install Root Explorer from the Market. This will let you remount /system read-write easily. Once remounted, just edit the hosts file.
To edit the hosts file on the command line:
Code:
C:\> [B]adb pull /system/etc/hosts .[/B] [I]Get the hosts file[/I]
[I]Edit the file on the PC[/I]
C:\> [B]adb remount[/B] [I]Remount /system read-write[/I]
C:\> [B]adb push hosts /system/etc/hosts[/B] [I]Put the file back[/I]
C:\> [B]adb shell chmod 644 /system/etc/hosts[/B] [I]Set the correct permissions[/I]
Reboot the tablet after this.

Killing Capacitive Button lights on CM10?

Does anyone have a flash able zip that would kill these lights?
Sent from my Amaze 4G using xda app-developers app
jcjackjay said:
Does anyone have a flash able zip that would kill these lights?
Click to expand...
Click to collapse
Do the below - I posted it in the bug thread yesterday, its easy and works great.
This combination of Killing the Button Lights & Screen Dimming is the Shizzle
Try it if you have not done so yet, thanks to blast0id & dcacklam
blast0id said:
put this in a text file and name it "55killsoftbuttonlights" or whatever the hell you want to name it, just don't put an extension on it. then place the file in /system/etc/init.d and it will be killed on every boot... if you want them back then just delete or move the file out of that folder...
Code:
mount -o rw,remount /dev/block/mmcblk0p29 /system
chmod 777 /sys/devices/platform/leds-pm8058/leds/button-backlight/brightness
echo 0 > /sys/devices/platform/leds-pm8058/leds/button-backlight/brightness
chmod 444 /sys/devices/platform/leds-pm8058/leds/button-backlight/brightness
sysro
Click to expand...
Click to collapse
dcacklam said:
Settings -> Display -> Brightness -> Auto (Change to 'Checked')
Settings -> Display -> Auto Backlight -> Use Custom
Screen Dim Level -> 1
Edit Other Levels, set the middle collumn to:
2
10
20
30
40
50
80
120
200
The far-right (the buttons on the bottom) can either be on or off. 0 is off, any other number is on (So for all you guys who hate the 'light leak', you should be able to just set the far-right column to 0 for all options. Unfortunately though, this does not work.
Click to expand...
Click to collapse
I am using it on AOKP and it really is like a new screen.
I've attempted the creating the 55killsoftbuttonlights and placing it in /system/etc/init.d but for some reason its locked as read-only. I have ES File Explorer all root settings checking including mounting system rw. Hmmmm I rebooted to recovery & "fix permission" to no avail also.
rfunderburk39 said:
I've attempted the creating the 55killsoftbuttonlights and placing it in /system/etc/init.d but for some reason its locked as read-only. I have ES File Explorer all root settings checking including mounting system rw. Hmmmm I rebooted to recovery & "fix permission" to no avail also.
Click to expand...
Click to collapse
I use root explorer did not set permissions (he did not say to)....and it worked
Got it. Here is what I did originally.
I used my laptop and copied the info into notepad++ named the file. Then transfered the file via Bluetooth to my phone. Using ES file explorer attempted to copy the file to /system/etc/init.d and received " permission not allowed". So I checked the permission of the folder it was set to read-on, it would not allow a change to "writeable" once again getting "permission not allowed". Rebooted to recovery and "fix permission". Reboot and same issue. Tried a second root file browser, and same problem.
At this point I get an idea to check permission of the file. It was set to read-only also. Attempted to change the permission on 55killsoftbuttonlights I get the "permission not allowed".
So I downloaded jota editor used the xda app>view as web page copied and pasted into jota. Saved as 55killsoftbuttonlights and copied it to /system/etc/init.d
Rebooted and all functions as it should.
Stupid questions are better than stupid mistakes.
Japanese proverb

[Q] I need to put two files back into system/lib but I'm limited on what I can use

To start with, I have a rooted Pantech Pocket that was running Carrier IQ and that is where the problem started.
I found there were 3 files that were associated with Carrier IQ. One in system/bin and two in system/lib and I moved the one from system/bin without any problem but when I moved the two from system/lib I ended up with a phone that gives me error message after error message after error message and all the errors say: "The process com.android.phone has stopped unexpectedly. Please try again."
To make a long story short those error messages pop up so quickly I can not use the "MENU" or a "Long press" anymore and I have to use "Button Savior" to use the "Back" or the "Home" buttons. Note: even though Button Savior is given superuser access the "Menu" key still does not do anything.
I can not use ES File Explorer because I can't get into the menu to set it up as a "Root Explorer" since there is no way I can get the "MENU" key pressed and I tried several different programs too.
I can not use Root Explorer because I can not use a long press since that error message cuts the long press short.
I also tried the following set of commands to try and push the two files into the lib folder but ended up with an error message there too.
adb devices
adb push psneuter /data/local/tmp
adb shell
$ cd /data/local/tmp
$ chmod 777 psneuter
$ ./psneuter
Then the error message I received was:
failed to set prot mask (inappropriate ioctl for device)
UPDATE AFTER PUTTING THE TWO FILES BACK INTO /system/lib
Turns out because my Pantech Pocket was still rooted all I had to do was type "adb shell" on one line and then after getting the '$' type "su".
After that I had to use the following command so I could copy two files back into /system/lib:
mount -o remount,rw -t rfs /dev/block/st19 /system
Then after changing the permissions the cp (copy) worked without any errors and I put the two files I had moved out of /system/lib back into /system/lib.
I learned a lot from trying to get rid of Carrier IQ and had to put carrier IQ back on the Pantech Pocket to make it usable. Dang AT&T but maybe there is something else I can do about Carrier IQ.
Roger

[Q] Can't paste file in /system/etc. after setting permissions to RW

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.................

Categories

Resources