Hello everyone,
I’ve a problem with my system folder as I can’t write to it anymore.
Phone: HTC Desire with Android 4.1.1;
rom: https://forum.xda-developers.com/showthread.php?t=2183281
My story: I wanted to try a model specific soft and I made a change of model in the build.prop in the system folder. Everything was ok, but when I edited back the build.prop with ES file editor, it saved the file as a blank file. I then moved the blank file to the SD card with success and tried to copy the build.prop from a backup I’ve done; and I get permission denied…
So far I’ve tried:
- Re-mounting the system folder
- Clearing ES file explorer data to give a SU access again
- Trying the same thing with Terminal Emulator but I’m not familiar with android command line
So now I’ve a phone without build.prop in the system and I suppose it will not be happy about it the next reboot.
My question: How I lost the capacity to write to the system folder, from a theoretical point of view, and how I can clean this mess as a personal matter. As the phone is still up I hope that it’s still possible to solve the problem without having to re-install everything.
If someone is interested by this, I will welcome any help.
Kuroneko
Try
mount -o remount rw system
In terminal.....And then try to copy with terminal itself...Use CP command
Thank for the help but sadly it didn’t make the trick.
I use Terminal Emulator
After several trials with the command I think that I’ve found the correct syntax but at the end it didn’t worked.
Working in the root folder where I put a copy of build.prop:
su
mount –o remount,rw /system
cp build.prop /system/build.prop
>can’t create “/system/build.prop”: Out of memory
I also tried to create a text file in the system folder with Total Commander without success.
I fear that there is a serious **** up in the system, probably with the file handling. Under windows (and dos) I could find my way but I’m not familiar with Linux system, and even less with Android. Under normal circumstance I would reboot the system but without a build.prop in the system directory I fear that it will go even worse.
Any other suggestion?
Kuroneko
PS: I’ve nothing again command line but with a 3.7” touch panel it’s far from fun…
This is due to HTC's read/write protection that is built into the boot.img. You might see if there is a custom kernel for your device that has this flag disabled.
Thank for your answer,
But I’m not sure that I follow you.
If the problem was due to an r/w protection of the boot image, how I was able to modify my build.prop, and later erase it?
If you could explain this it would help greatly as it means that I could re-boot without worry.
Related
Hey there?
I've got a question which I can't seem to find anywhere else and YES I have searched this forum and google. However, I may miss it.
Anyway, I've mapped my android phone as a network drive using Samba and changed the smb.conf file to show the System Root directory as well. However, system root is default set as R/O so to mange files USING my computer I need to change the permission to R/W using a file manager (such as root explorer). This is annoying, as I have to keep doing this in order to write to certail directories.
What I wish to do is create a massive guide on all of this to help out the community, however I need one little bit of information.
I would like the / directory (root) to be mounted as R/W as default so that I can quickly edit files on my PC without having to constantly change it to R/O.
If this has been answered before, I do apologize.
Thanks in advance.
Regards,
xxSHABSxx
EDIT:
To make things a bit clearer.
I want something that will automatically mount my phone's root dir into rw upon boot, without custom apps/having to manually mount as rw everytime it reboots. And yes I understand there are apps that do this.
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it'll stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
kuisma said:
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it's stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
Click to expand...
Click to collapse
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Anyway thanks for the reply!
xxshabsxx said:
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Click to expand...
Click to collapse
Or do like I did, move the root to a real ext3 non-volatile file system instead.
Does anyone know how to use linux to push an original sh file or even just the whole bin folder?
I am unable to use the shell command in adb because I really messed that up by replacing my bin folder with another phones bin folder (same phone make and model - Samsung Proclaim).
(whoops, as you can tell I don't understand much about the system files and therefore I shouldn't be messing with them but my phone was stuck in a bootloop and I got google happy and desparate)
But I've read a few things about possibly using linux to get in there and put the originals back. I have been using linux for a short while but I lack the skills necessary to do this.
Does anyone know if this is something that I can learn to do in a few days or is this something that only years of experience can accomplish?
I'm willing to search and read whatever is necessary I just need a push in the right direction.
Download Stock ROM
Open and decompress zip file (or whatever)
not just adb push the sh executable but all /system folder
remount /system
Code:
adb remount
Code:
adb push ./STOCK_DECOMP/system /system
if you get errors on copying app, just copy each internal folder one by one
at least i got internal shell on a Kindle doing this way (just copying an original sh didn't resolve my problem), but all environment was a little messy.
good luck.
Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
nasenstueber said:
Hello everybody,
i have gained root access to my phone via backup/restore method through adb where local.prop is stored in /data/. So when i log onto my phone with adb i have root access. I copied busybox, su and the superuser.apk to the right place and removed the local.prop file again. After a reboot I was hoping to remove some crapware off my phone but to my surprise the binaries i copied vanished from the filesystem. So the phone reverted the changes by itself. I did this process several times copying busybox and su to various places referred to by $PATH, but it´s everytime the same after i reboot. The files are gone.
After the first attempts failed i tried to make changes to my phone while logged in as root. I wanted to uninstall unnecessary packages with "pm uninstall" but that failed also. The command just responds "failed". Even when /system is mounted rw (it remounts itself to ro after a while though). I´ve also made changes to /init.rc but they are also gone after a reboot as other changes i´ve made. Basically i wasn´t able to accomplish anything with root access no matter what i did.
So what i want to know is how this black magic works andy why i cant do anything with root. I know how to achieve real root through htc dev and various other methods.
Thanks for reading!
Click to expand...
Click to collapse
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
mauricio.valladolid said:
is your RECOVERY.img
and beside i dont really think your /system is fully mounted rw
Click to expand...
Click to collapse
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
nasenstueber said:
Thanks for the reply. i use mount -o remount,rw /system as mount command to get read/write permission on /system. If there is something more to do please let me know. And if the behavior i ve seen is caused by the recovery.img is there something i can do about it?
Click to expand...
Click to collapse
why dont you just install ext4 recovery and flash supersu.zip?
I really dont get it why are you trying to do it the hard way
The problem:
I rooted my Samsung Galaxy Ace and went exploring the root directory with Root Explorer. I renamed the folder "apk" found in /data to "apk_old", thinking that if everything worked, I could just delete it as it contained a handful of stock apks as well as several apps installed from the market. At the time, I though apks were needed just for installation and that by deleting the folder I would save ~30MB of internal memory. Well, I turns out I was horribly wrong. Several stock apps, such as Youtube or Maps and all market apps that were installed in internal memory have stopped working. In the app drawer, their icons have turned into those default apk icons and their names into com.something.blabla. I was getting crashes every 1-2 minutes from those apps. The widgets on my home screen, such as Google search or Homework 4x2 have also stopped working.
What I've tried:
*renaming the folder back to "apk", obviously. That didn't work, it said something like "execution failed"
*making a copy of the folder - failed
*zipping the folder - failed
*thinking there was a problem with Root Explorer, I installed Total Commander and Solid Explorer hoping I could rename the folder back. Total Commander cannot open the /data folder, while Solid Explorer says the /data folder is empty
*"pulling" all of "/data" with ADB - 0 files pulled.
However, as I was trying to clean up my own mess, things changed a bit. At some point the crashes stopped and all of the "corrupt" apps have simply gone away from the app drawer. While I was unable to do anything with the "apk_old" folder in /data, something changed so that right now I can't even access /data anymore.
So yea, I have a bad feeling that somehow everything inside the /data folder has been wiped, though I sure hope I'm wrong. Anyone have anything to advise?
Oh, and I also noticed that Superuser is gone. I tried re-rooting my phone from this link, it worked the first time I rooted, but not now...
http://forum.xda-developers.com/showthread.php?t=1552792
I don't know exactly what you have in /data/apk I guess is the same I have in /data/app all the installed package.apk
Since your system is compromised I would avoid to use programs from it like Root Explorer to change anything, and for the other programs looks like they don't have root access.
I would try with plain adb: http://forum.xda-developers.com/showthread.php?t=2141817
Once you have your phone connected with adb shell you can go root:
Code:
$ su
to list files and directories in /data
Code:
# ls /data
and then to rename the folder
Code:
# mv /data/apk_old /data/apk
then reboot the phone
good luck
I'm assuming those # signs were suppose to be $'s?, Anyways, what I typed into adb:
1. adb shell
2. $ ls data
What I get:
opendir failed, Permission denied
Another atempt:
1. adb shell
2. $ su
What I get:
su, and after a long pause - Permission denied
eh? So, apparently I can't get root access, what now?
the dficua
Ha, made progress. I installed Superuser through adb and it gave me permission to access data and to rename apk_old back to apk. However, the folder has been wiped of all the apps. Luckily, I have a friend who also has a Galaxy Ace, I'll just copy the folder and paste it into /data, hopefully i'll bring back the default apps.
$ is the normal shell
# is root shell
I forgot to tell you to try that on recovery mode to prevent the calling of SuperUser to grant privilegs, su binary itself should be in /system/xbin
When you restore apps remember also to fix permissions, user and group, it should be something like this:
# chmod 0664 /data/apk/*.apk
# chown system:system /data/apk/*.apk
check the right values in your friend's phone.
Hello,
I have Lenovo S720 running on Android 4.0.4 that I recently factory reset because It has only few little internal storage (~1,4 GB), and cannot support many updating apps.
After I do that, whats left in the internal storage is about 500 MB of storage, the rest being taken up by the system (I suppose).
I installed Framaroot to root the device, then System App Uninstaller (ROOT) and ES File Explorer.
First, I try to uninstall any bloatware with the System App Uninstaller -> I didn't get much free internal storage.
Then, I use ES File Explorer to seek, which folder took up the most space.
-> One of the is /system/vendor folder.
-> So, I copied that folder to /mnt/sdcard/backupsys/ (or /sdcard/backupsys/ [little bit forget]), Thinking it would come in handy later.
-> Then, I (foolishly) proceed to delete the folder using the root privileges .
-> It took a moment until all of my app start crashing (including the ES File Explorer!).
-> I turned-off the device, and now it still stuck in the (what I think as) "bootloop" mode.
Fortunately I still can communicate to the phone using adb tools, which I have a little knowledge of. But, the pm and am command cannot function well.
Now, I'm only thinking about moving back the vendor folder from /mnt/sdcard to the /system folder.
But I encounter some problem:
1) I can't (& don't know how to) write to the /system
2) I can't (& don't know how to) read from the /sdcard
- command 'ls' inside this dir returned nothing.
Glad I have the "su" tools from the Framaroot. I searched on the Internet and it seems the problem can be solved with mount tools, but I don't know how.
ls -la tools on root (/) return:
(other dir)
root /system ,,,,,,,,,,other info,,,,,,,
system /sdcard ,,,,,,,,,,other info,,,,,,,
(other dir)
So maybe because I can't gain system account, I can't access the folder and read it...
I try to hard-reset in the recovery mode, but I can't select the options! (I can move the selector with volume up/down) but I cant click it with the power button!
The phone seems to be worse every second.
My main question is: can I recover my phone (copying the vendor folder back) using command tools on my development computer? Or is there any other ways?
I'm willing to install any custom ROM best suited to my phone.
Thanks in advance.
Hello,
Welcome to XDA.
If you have a copy of what you deleted or can get it from somewhere and you want to adb push your missing files and folders back to your device then you need to have the files you want to push stored on your PC and push them from there to the device. For instructions on how to use adb read through the thread linked below and go from there.
http://forum.xda-developers.com/showthread.php?t=2141817
If you have further questions or need further help with using adb then you can post in the Q&A forum linked below:
http://forum.xda-developers.com/android/help