hosts file and /system related - Droid Incredible Q&A, Help & Troubleshooting

So I decided to fumble around a bit with my incredible, I read about the hosts file for blocking ads here and noticed that I would get permission denied errors, then when i had the phone with the screen on, did adb shell from a command prompt I got the super user permissions screen on my device.
now I was able to run the mount commands successfully, and as far as testing I was able to do mv /etc/hosts /etc/oldmaid and it took. however when I try to mv the other hosts file i get an error about a cross linked device. so i try doing a cat /sdcard/hosts.for.mobile.txt > /etc/hosts and get an error about the device not having sufficient space.
Anyone have any input on this? I know a cooked rom will already have this hosts file in it, but i'm trying to see if i can't get it going now.
Thanks!

I do not have one yet but what commands are available? Can you "locate hosts" or "find / -name hosts"
nm try this file "/system/etc/hosts" <-- stated in xda forums 3772987&postcount=5 Hope this is what you were looking for.

You are getting that error due to the fact that nand protection is still enabled. We need to flash a boot image with ro.secure=0 to be able to write to everything in /system.

ihtfp69 said:
You are getting that error due to the fact that nand protection is still enabled. We need to flash a boot image with ro.secure=0 to be able to write to everything in /system.
Click to expand...
Click to collapse
Ah, that would explain it. Thanks for the info!

Related

help changing boot screen

Hey all, ive been trying to change my boot screen to the haters gonna hate one for a few days now but cant seem to get it to work at all, i have full root and tried to the fastboot method and recovery/adb method. no matter what it stays the same as the one i had originally, i never get errors when trying to push the files if someone can give me instructions for dummies haha or another method id really appreciate it sorry for being a noob at all this.
I had the same problem
First of all, what rom are you using? Different rooms pull from different places. I might be able to help you out. If you are running cyan6, try this:
Adb reboot recovery
Adb remount (make sure it remounts. Maybe also do adb root to make sure.)
Adb push blahblah.zip /system/customize/resource/bootanimation.zip
Adb push blahblah.zip /system/media/bootanimation.zip
Adb push blahblah.zip /data/local/bootanimation.zip
If you want sound, push that to the same locations. Make sure there is only one of each file in each folder. Then, to check,
Adb reboot
Hope this helps
oh yeah sorry i should have included that i am on evios 1.2 beta 2 rom
I'm not familiar on where to place boot on this rom. Try all three locations I suggested. System customize resource. System media. Data local. Tell me if it works out.
I had this animation on EViO. I just pushed it from my desktop to system/media. Worked fine for me.
how do you push it from the desktop? i tried all 3 methods posted above and none worked. i had the file in the android sdk tools folder though...also whenever i try to do adb remount i get "remount failed:invalid argument" and adb root gives me "error:closed" i tried killing adb and restarting but no luck
This might be an obvious question, but do you have USB debugging enabled on your phone? Under Setting>Applications>Development
You arent going to be able to push anything if you can't get ADB running first.
yeah debugging has been enabled the whole time
ok have you been in recovery mode?
try typing
adb shell
su (make sure #comes up.)
exit (retype until you get back to the tools directory)
then do the push commands to system media, system customize resource, and data local.
Just use this program. Its as easy as it gets.
http://forum.xda-developers.com/showthread.php?t=701295
dkdude36 said:
First of all, what rom are you using? Different rooms pull from different places. I might be able to help you out. If you are running cyan6, try this:
Adb reboot recovery
Adb remount (make sure it remounts. Maybe also do adb root to make sure.)
Adb push blahblah.zip /system/customize/resource/bootanimation.zip
Adb push blahblah.zip /system/media/bootanimation.zip
Adb push blahblah.zip /data/local/bootanimation.zip
If you want sound, push that to the same locations. Make sure there is only one of each file in each folder. Then, to check,
Adb reboot
Hope this helps
Click to expand...
Click to collapse
Putting sound in boot animation doesn't work with cm6. Just to clarify. No one has been able to get it to work unless you found something out to make it work please share as I have hates going to hate also and want to use haters everywhere mp3 and is perfect for it.
Sent from my PC36100 using XDA App
yeah i have also been in recovery mode every time i tried to run a command prompt for adb...i tried that when i hit adb shell i get # but when i type su after the # it says "/sbin/sh: su: not found"
mount: mounting /dev/block/mtdblock4 on /system failed: Device or resource busy
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
thats what i get when in command prompt when i try to use the program you just posted above
Want a easier way? Use root explorer and copy and paste. Works for my every time. It's in the market. And root explore you can manually turn writeable on and off to move it into system. It's on the top right of screen in root explorer when you go into system folder.
Edit: the command you are tying to put in enables you to push and pull in the system folder. Root explore you can just click a button.
Sent from my PC36100 using XDA App
Good idea
Root explorer works most of the time. If you have the cash, go ahead. You should make site out posted though.
/sbin/sh: reboot: not found
been trying to use adb and i keep on getting that....any of you know a fix?

[Q] How to change Bluetooth MAC Address

Is it possible to change it using root or adb please?
Why would you want to?
Nope. Impossible
NeoTechni said:
Why would you want to?
Click to expand...
Click to collapse
just wanted to clone my wife's one for the hands free in the car to avoid having to switch through the menu in the car.
I was unable to locate /pds as per http://pocketnow.com/tweaks-hacks/motorola-atrix-4g-how-to-change-wi-fi-and-bt-mac from http://forum.xda-developers.com/showthread.php?t=992326. I suspect every phone maker puts Bluetooth address where they wish...
However I was able to locate a zero byte bt_mac_addr file with no extension in /proc folder. It is empty both when bluetooth is on and off.
I hope someone more technically skilled than me can figure out if it can be populated to change the bluetooth address succesfully.
Thanks in advance
I looked at the '/proc/bt_mac_addr' file again using root explorer this time and can see my bluetooth mad address in it and could edit the address and change permissions to it but the modifications don't stay saved even after reboot though the root explorer says changes saved successfully. Can someone help me modifying the file please.
I'm on rooted 2.3.3
/proc is a virtual Filesystem provided by the Linux Kernel. The changes you made there won't persist a reboot cause it only gets saved in Ram.
Thank you. Does it mean I need a script of some type? Is it possible to achieve a change some other way? The pocketnow article seems to do it for the motorola phone but by modifying text file in another folder which I cannot find.
I followed the same process as follows using below commands
C:\Program Files\Android\android-sdk\platform-tools>adb push C:\APK\bt_mac_addr /sdcard/download/bt_mac_addr
1 KB/s (18 bytes in 0.015s)
C:\Program Files\Android\android-sdk\platform-tools>adb shell
$ su
su
# cp /sdcard/download/bt_mac_addr /proc/bt_mac_addr
cp /sdcard/download/bt_mac_addr /proc/bt_mac_addr
cp: can't create '/proc/bt_mac_addr': File exists
Is there another file I can change for it maybe?
Thanks again for all the help.
If you really want to do it then you can (On stock rom) use the same trick that is used for adb remount (Put an echo whatever into into /etc/install-recovery.sh)
You need to make sure it runs as root as well
Have a play around.
Installing the insecure adb apk (From Paul Modaco).
and
adding to the end.
/system/xbin/echo 8D:64:22:01:E2:A9 > /proc/bt_mac_addr
looks like it should work.
(If you have an unlocked bootloader then you can just do it from init.semc.rc in the initramfs)
Or you can look at the method (I posted the manual method in the rooting/insecure adb thread).
This presumes that this is actually working (Its possible you might have to restart a service to actually change it).
just make a simple init.d script
Thank you both. I Will look at it when i'm at the pc. A bit scared having never done anything similar. I Appreciate your guidance very much
Sent from my R800i
Thanks again for your previous replies. I tried "/system/xbin/echo 00:01:02:03:04:05 > /proc/bt_mac_addr" using script manager with superuser permissions granted and running in root mode but it gives the following error: "echo: write error: Input/output error". Same problem in gscript unfortunately.
Would you please tell me what this means and kindly suggest what I should do. I have not figured out yet how to do adb insecure or init.d but hope you could suggest the best way after seeing the above error.
Thanks in advance
ps3taker said:
Thanks again for your previous replies. I tried "/system/xbin/echo 00:01:02:03:04:05 > /proc/bt_mac_addr" using script manager with superuser permissions granted and running in root mode but it gives the following error: "echo: write error: Input/output error". Same problem in gscript unfortunately.
Would you please tell me what this means and kindly suggest what I should do.
Thanks in advance
Click to expand...
Click to collapse
You probably have to remount /system writable
Atarii said:
You probably have to remount /system writable
Click to expand...
Click to collapse
Thank you - I tried this but still same error
ps3taker said:
Thank you - I tried this but still same error
Click to expand...
Click to collapse
try this:
Code:
echo "00:01:02:03:04:05" > /proc/bt_mac_addr
DooMLoRD said:
try this:
Code:
echo "00:01:02:03:04:05" > /proc/bt_mac_addr
Click to expand...
Click to collapse
Thanks - I tried this but it still gives the same input/output error unfortunatelly
Besides mounting system as rw via script manager option I also enabled run at boot, run on network change, run as root but still no change before and after reboot.
I hope you could think of something please. Maybe /proc folder needs to be mounted rw but i'm not sure how or if it is not rw already - root explorer has no problem openning it rw straight away...
Thanks again for everybody's help in advance
ps3taker said:
Thanks - I tried this but it still gives the same input/output error unfortunatelly
Besides mounting system as rw via script manager option I also enabled run at boot, run on network change, run as root but still no change before and after reboot.
I hope you could think of something please. Maybe /proc folder needs to be mounted rw but i'm not sure how or if it is not rw already - root explorer has no problem openning it rw straight away...
Thanks again for everybody's help in advance
Click to expand...
Click to collapse
It won't work as that interface is read only
Sent from my R800i using XDA App
Thanks for trying to help.
I wonder if there is another file somewhere. Any idea what Play's equivalent of Motorola's Atrix 4G folder called "/pds" is - as it it seems to work for them: http://pocketnow.com/tweaks-hacks/motorola-atrix-4g-how-to-change-wi-fi-and-bt-mac
Thanks again for all the help - it was exiting to try scripts and other things you pointed me to.

[Q]

This is a follow-up of the thread " [Q] can't locate /mnt/sdcard/ ". That thread is now locked.
I was able to get ES File Explorer to display /mnt/ in the path to /sdcard/. But now, while in /mnt/sdcard/, I do not see /system/bin/. The routines that root the A100 require access to /system/xbin/.
I looked in ES File Explorer - Settings - File Settings - for an obvious solution but found none. "Show Hidden Files" is already checked.
I suspect that maybe the lines entered via the command prompt (like /system/bin/cmdclient ec_micswitch '`mount -o remount,rw /system`' or /system/bin/cmdclient ec_micswitch '`cat /mnt/sdcard/su >/system/xbin/su`') will somehow unlock or allow access to /system/xbin/ but I'm not sure. I guess I could just plow ahead and see what happens but I much prefer to anticipate and prevent problems beforehand rather than try to fix things after I've screwed it up.
So 3 questions:
1. Will the command line entries automatically be able to write to /system/xbin/?
2. If yes, will I then be able to read and write to /system/xbin/ using ES File Explorer?
3. If not, how do I gain access to /system/xbin/?
I think your trying to make things more complicated for yourself than what they really are, of course it helps to know a little Linux when doing things like this.
1. Will the command line entries automatically be able to write to /system/xbin/?
Yes, that's what the mount -o remount,rw /system does in the command you run.
2. If yes, will I then be able to read and write to /system/xbin/ using ES File Explorer?
No, this is not needed as the commands handle this for you.
3. If not, how do I gain access to /system/xbin/?
You don't... just run the commands for rooting via the terminal and everything is done for you.
The ONLY thing you need to do with ES is to extract the downloaded su file and put the su file itself in /mnt/sdcard. Once you've done that, open the terminal emulator and run those 3 commands.
I do tend to over think things! haha But as I said, I much rather spend extra (possibly useless) time anticipating problems while my piece of equipment works than scratching my head with a brick in my hand.
Thanks for the tutoring, I shall plow ahead with confidence! ... right after I fix my water heater. Now there's a non-working piece of equipment one really can't do without!
ricknau said:
This is a follow-up of the thread " [Q] can't locate /mnt/sdcard/ ". That thread is now locked.
I was able to get ES File Explorer to display /mnt/ in the path to /sdcard/. But now, while in /mnt/sdcard/, I do not see /system/bin/. The routines that root the A100 require access to /system/xbin/.
I looked in ES File Explorer - Settings - File Settings - for an obvious solution but found none. "Show Hidden Files" is already checked.
Click to expand...
Click to collapse
Just a quick note for future reference: the /system/xbin directory isn't located under /mnt/sdcard.... its located under root.
Sent from my A100 using Tapatalk
Crap! Didn't work for me
I did all the steps ...
Extracted the su file (using Winzip on my PC), copied it to /mnt/sdcard/, then entered the commands lines with a terminal emulator. But the program Root Checker says I am not rooted. The Busybox installer program says the same.
I figured out how to display /system/xbin/ (in root ). And I can see the su file in /system/xbin/. It is 25.71 KB. So I figure my command lines ran OK. What could be wrong?
I've tried the process several times. I used a signed su (whatever that means). After each attempt the "modified" date and time stamp of the su file in /xbin/ matches the date and time of the attempt.
Busybox error screen said if I think I am rooted to "go into Superuser app and click on Busybox installer and then click "Forget" and restart this app". I guess I could try that even thought Root Checker agrees with the "not rooted" condition. Is it OK to attempt to install Superuser if you aren't rooted?
The good news is that so far the tablet is still working fine.
Any ideas anybody?
Im having this exact same problem, and havnt found a fix yet for it.
I finally got it!
Oh man I got it! I'm such a dumbass! I wasn't reading carefully enough. The Superuser app from the market is the key. Superuser must be installed first and opened before Busybox can even be installed. Now I have Busybox installed and Root Checker says I have root!
Thanks to all the smart and helpful people who provide the great info here and in the other forums to help us less learned ones make full use of these great tools!

[Q] How to delete files/folders from /sdcard?

After rooting my Galaxy Nexus with Wug's Root Toolkit and sim unlocking with the Docomo hack, and then restoring my apps/data (can't recall if I restored from GN Toolkit or Root Toolkit), my camera app was messed up--could snap pix but they didn't save; and video always fc'ed. The solution turns out to be to rename or delete the DCIM folder. I couldn't delete--so I renamed. Now I am trying to delete that DCIM.old folder and contents (eating up 1+G on my storage), but cannot delete either individual files or the folder. I'm sure there is a simple solution, but I can't find it. Help (even with a condescending attitude ) much appreciated!
zzcat
If you use a file explorer, that has it's standard directory at / then all you need to do is navigate to /mnt/sdcard/ then make sure it's mounted as R/W and not R/O, if all that is the way I said it, you shouldn't have problems deleting anything, if so, use the ADB and type:
Code:
adb shell rm /mnt/sdcard/<Folder>
That should then do the trick
You could also try the following Apps:
- Rootexplorer (paid)
- Astro File Manager
familyguy59 said:
If you use a file explorer, that has it's standard directory at / then all you need to do is navigate to /mnt/sdcard/ then make sure it's mounted as R/W and not R/O, if all that is the way I said it, you shouldn't have problems deleting anything, if so, use the ADB and type:
Code:
adb shell rm /mnt/sdcard/<Folder>
That should then do the trick
Click to expand...
Click to collapse
FamilyGuy, thanks for the suggestion, the problem seems to be bad permissions and I can't figure out how to fix them. Tried the "fix permissions" from recovery, as well as when booted, to no avail.
Typing
adb shell rm -rf /[directory]
gives me "permission denied"
So tried
chmod 666 /sdcard/.../*
but get an "operation not permitted" message.
So I'm really stuck here...
familyguy59 said:
If you use a file explorer, that has it's standard directory at / then all you need to do is navigate to /mnt/sdcard/ then make sure it's mounted as R/W and not R/O, if all that is the way I said it, you shouldn't have problems deleting anything, if so, use the ADB and type:
Code:
adb shell rm /mnt/sdcard/<Folder>
That should then do the trick
Click to expand...
Click to collapse
Update: solved
boot into recovery mode
mount /data
adb shell
rm, rmdir etc. all work as expected from here, no need to chown or chmod anything
zz
I see you've solved this, but i thought i would throw this in anyway...
The easy way is to delete the files from /data/media
The sdcard directory is a symlink, so go to the true folder and you should have more success...
Sometimes the file ownerships get messed up after a cycle of recovering the OS and restoring files.
http://forum.xda-developers.com/showthread.php?t=1515291&page=2
If you have any other directories/files that you can't modify or delete, then boot into CWM recovery, plug in the USB cable, go into adb shell. Also make sure that /data is mounted in the CWM mounts menu. Then:
cd /data/media
chown -R media_rw.media_rw *
This fixed it for me and others.
cmstlist said:
Sometimes the file ownerships get messed up after a cycle of recovering the OS and restoring files.
http://forum.xda-developers.com/showthread.php?t=1515291&page=2
If you have any other directories/files that you can't modify or delete, then boot into CWM recovery, plug in the USB cable, go into adb shell. Also make sure that /data is mounted in the CWM mounts menu. Then:
cd /data/media
chown -R media_rw.media_rw *
This fixed it for me and others.
Click to expand...
Click to collapse
Thanks for this and other suggestions--my solution was trial and error, thrashing around in the dark (my unix command line chops are really, really rusty), and these are far more elegant. It's good to understand the underlying problem, your wisdom is appreciated.
Yes, permissions were messed up after rooting and applying a sim unlock hack, wiping and restoring from pre-unlock backup set. I see it so clearly now...
Problem can somebody help me?
Hello. I have a problem with my motorola defy+ running on gb 2.3.6 and is not ROOTED. Still he has an annoyng problem. After installing an aplication (not from the market) i saw that it didn't save data on the sd card. I uninstalled it and after a data factory reset i install apps such as temple run and Brother in Arms 2. At temple run it gave me this mesage
"File Access Problem Caution, unable to write files. This means your game progress can't be saved! Reason: Access to the path "/mnt/sdcard/Android/data/com.imangi.templerun/files/spaceholder.dat" is denied."
Also at Brother in Arms 2 the game didn't save. I rest the phone abouat 7-8 times.I changed the sd card. Note that the card was a 16 gb kingmax class 6 and put the 2 gb card that came with the phone. It all work smoothly. So what is the problem the sd card or the phone's software. Please answer i'm desparate and tired of wasting time.
This thread is about the Samsung Galaxy Nexus which has no external SD and uses a very different storage structure. I'm afraid we can't really help you here. Try the Defy forum.
Sent from my Galaxy Nexus using Tapatalk 2
zzcat said:
FamilyGuy, thanks for the suggestion, the problem seems to be bad permissions and I can't figure out how to fix them. Tried the "fix permissions" from recovery, as well as when booted, to no avail.
Typing
adb shell rm -rf /[directory]
gives me "permission denied"
So tried
chmod 666 /sdcard/.../*
but get an "operation not permitted" message.
So I'm really stuck here...
Click to expand...
Click to collapse
Before chmod the folder, you needed to be root by entering 'su' after 'adb shell' .
It worked from cwm, because cwm gives root access.
Linux/Android are all about permissions.
Sent from my i9250
cmstlist said:
Sometimes the file ownerships get messed up after a cycle of recovering the OS and restoring files.
http://forum.xda-developers.com/showthread.php?t=1515291&page=2
If you have any other directories/files that you can't modify or delete, then boot into CWM recovery, plug in the USB cable, go into adb shell. Also make sure that /data is mounted in the CWM mounts menu. Then:
cd /data/media
chown -R media_rw.media_rw *
This fixed it for me and others.
Click to expand...
Click to collapse
I tried your theory, and it didn't work, still get the message" unable to change ownership permission denied, in recovery mode.
we are still trying to find a solution, here is the discussion: http://www.slatedroid.com/topic/32434-i-got-my-smartq-t20/page__st__260 on Post # 277
rocketero said:
I tried your theory, and it didn't work, still get the message" unable to change ownership permission denied, in recovery mode.
we are still trying to find a solution, here is the discussion: http://www.slatedroid.com/topic/32434-i-got-my-smartq-t20/page__st__260 on Post # 277
Click to expand...
Click to collapse
Sorry to hear that. It sounds like the problem you are having is with a completely different device, so I can't really say why this may be occurring - I don't know how your device's file system is structured. This advice is specifically for the Galaxy Nexus. If a version of CWM exists for your smartQme device, I can't speak to whether it works properly and interprets commands the same way ours does.
cmstlist said:
Sorry to hear that. It sounds like the problem you are having is with a completely different device, so I can't really say why this may be occurring - I don't know how your device's file system is structured. This advice is specifically for the Galaxy Nexus. If a version of CWM exists for your smartQme device, I can't speak to whether it works properly and interprets commands the same way ours does.
Click to expand...
Click to collapse
it's a 9.8 inches tablet branded named called "LePanII'. it has ICS now, before we had Honeycomb 3.2.1.
The manufacture of this tablet did such a bad partitioning that the /system partition was left only with merely 4MB of free space in it.
rocketero said:
it's a 9.8 inches tablet branded named called "LePanII'. it has ICS now, before we had Honeycomb 3.2.1.
The manufacture of this tablet did such a bad partitioning that the /system partition was left only with merely 4MB of free space in it.
Click to expand...
Click to collapse
Good luck with your issue. I doubt it's related to the one we were having on the GNex though.
cmstlist said:
Sometimes the file ownerships get messed up after a cycle of recovering the OS and restoring files.
http://forum.xda-developers.com/showthread.php?t=1515291&page=2
If you have any other directories/files that you can't modify or delete, then boot into CWM recovery, plug in the USB cable, go into adb shell. Also make sure that /data is mounted in the CWM mounts menu. Then:
cd /data/media
chown -R media_rw.media_rw *
This fixed it for me and others.
Click to expand...
Click to collapse
Sorry if my question is dumb.
Does this command solve the problem for all the folders and sub-folders in sdcard? Thank you for your help!
Sent from my Galaxy Nexus
/data/media # chown -R media_rw.media_rw*
BusyBox v1.20.2-jb static (2012-10-25 21:29 +0100) multi-call binary.
Usage: chown [-RhLHP]... OWNER[<.|:>[GROUP]] FILE...
Change the owner and/or group of each FILE to OWNER and/or GROUP
-R Recurse
-h Affect symlinks instead of symlink targets
-L Traverse all symlinks to directories
-H Traverse symlinks on command line only
-P Don't traverse symlinks (default)
I got this after giving the commands from recovery in adb shell.
What does that mean?
Jar3112 said:
/data/media # chown -R media_rw.media_rw*
BusyBox v1.20.2-jb static (2012-10-25 21:29 +0100) multi-call binary.
Usage: chown [-RhLHP]... OWNER[<.|:>[GROUP]] FILE...
Change the owner and/or group of each FILE to OWNER and/or GROUP
-RRecurse
-hAffect symlinks instead of symlink targets
-LTraverse all symlinks to directories
-HTraverse symlinks on command line only
-PDon't traverse symlinks (default)
I got this after giving the commands from recovery in adb shell.
What does that mean?
Click to expand...
Click to collapse
OK solved, I forgot the space before the *!
Worked like a charm!!
Sent from my Galaxy Nexus

[advice needed] ADB ROOT

Let me start by first saying that "adb root" is not related to or the same thing as running adb shell then su. adb root is a way to run adb directly in root mode enabling to be able to push/pull files directly to /system, or other write protected directories. So please, lets not get into the whole "just copy to sdcard, mount system and cp file with adb shell." This is not what I am trying to accomplish. Now that that's out of the way, here is my situation. HTC10 Viper 4.4.0 US unlocked firmware. Generally speaking, in the past you could modify the boot.img and edit default.prop and set ro.debuggable=1 and/or ro.secure=0 and repack and flash. Problem solved. This does not seem to be the case now, with this device. I also tried compiling from source adbd from aosp, modified to ignore ro.secure etc... Packed it in the boot.img and reflashed. I get the same results. I get a message on boot about slow charging, and debugging mode is not running on the phone. Tried stopping and starting it, same thing. Can anyone please help me figure out what is going on? I assume HTC has some built in security check that disallows this modification, but im not sure. Thank you in advance.

Categories

Resources