Weird folder issue - Nexus 4 Q&A, Help & Troubleshooting

I've been having this weird issue with folders on my N4 for a while now. Just for background, I'm using SimpleAOSP r11 with CWM 6.0.4.7 though I just switched recoveries because I think that was the issue.
Anyways, sometimes when I update my phone, my old folders on /data/media gets put into another location. Like the folders would be there but there would be nothing. Instead there would be an additional /0, /legacy, and /obb in /data/media that would contain the old folders with content. Is there any way to remerge these folders through adb? I thought I saw a post on a topic that I follow but I couldn't find the post when I looked through. Also any idea why this happens?
Sent from my bacon

stab244 said:
I've been having this weird issue with folders on my N4 for a while now. Just for background, I'm using SimpleAOSP r11 with CWM 6.0.4.7 though I just switched recoveries because I think that was the issue.
Anyways, sometimes when I update my phone, my old folders on /data/media gets put into another location. Like the folders would be there but there would be nothing. Instead there would be an additional /0, /legacy, and /obb in /data/media that would contain the old folders with content. Is there any way to remerge these folders through adb? I thought I saw a post on a topic that I follow but I couldn't find the post when I looked through. Also any idea why this happens?
Sent from my bacon
Click to expand...
Click to collapse
If your'e getting weird /0 changes, follow this:
Also, CWM is a bit outdated, PhilZ CWM is an updated + improved CWM, try it out. The latest build says experimental but it's perfectly safe, confirmed by multiple users : http://forum.xda-developers.com/showpost.php?p=58065887&postcount=424
Got "No SDCard" error?
This is because 4.4.x seems to point to: storage/emulated/0 & L points to: data/media/0
Solution:
- Mount system in TWRP/CWM
- Wipe system, dalvik, data, cache
- Unmount system
- Install ROM
- Factory reset
- Reboot
- Go back to recovery & flash SuperSU (link above).
- Reboot
Still not resolved? try:
Open terminal and type
su
restorecon -FR /data/media/0
or type
su
restorecon -r /data/media/0/*
Click to expand...
Click to collapse
Source info : http://forum.xda-developers.com/showpost.php?p=53956158&postcount=2

Related

[Q] Why can I not delete my /sdcard/clockworkmod folder?

So I've installed a custom ClockworkMod recovery and ROM on my Nexus 7 tablet. Life was good. Recently, I was running out of space and decided to delete my CWM backup (after saving it to my computer). And then, I realized I couldn't.
I went into ES File Explorer to try. I couldn't do it there.
I went into the ADB shell as root to try to remove it. No luck again, just the message when I finally DID try to remove one file:
Code:
# rm boot.img
rm failed for boot.img, Operation not permitted
What am I doing wrong?
Edit: This looks like it's ClockWorkMod (5.8.??)'s fault, but besides reading that another backup won't make the current one much larger, I don't actually know how to delete the current one.
Try "rm -rf ddd" (where "ddd" is the directory name) on the directory containing the files.
Sent from my Nexus 7
BillGoss said:
Try "rm -rf ddd" (where "ddd" is the directory name) on the directory containing the files.
Sent from my Nexus 7
Click to expand...
Click to collapse
in the development section there is a cwm flashable.zip that will delete them.. Then upgrade to latest cwm or TWRP.. its a bug from older version of cwm.. its talked about in the dev cwm thread..
good luck..
I did this in a way not mentioned here that still deserves mentioning... First I updated to the latest version of CWM available (via the Nexus 7 Toolkit) and then booted into recovery, opened the backup option, deleted the backup that was there, then cleaned the nandroids.
I could not find the aforementioned flashable zip, and because of the new CWM I had, I wanted to attempt a proper method of removal before running another rm command via the terminal. Therefore I could not verify the other methods mentioned here, my apologies.
erica_renee said:
in the development section there is a cwm flashable.zip that will delete them.. Then upgrade to latest cwm or TWRP.. its a bug from older version of cwm.. its talked about in the dev cwm thread..
good luck..
Click to expand...
Click to collapse
primetechv2 said:
I could not find the aforementioned flashable zip, and because of the new CWM I had, I wanted to attempt a proper method of removal before running another rm command via the terminal. Therefore I could not verify the other methods mentioned here, my apologies.
Click to expand...
Click to collapse
Sorry for re-opening an old thread, but I am having a problem where I have files that I cannot delete from the clockworkmods/blobs folder on my external sd card. So far, I have tried deleting them from a file explorer, deleting them as root from a file explorer, root and non-root deletes from terminal emulator, deleting through windows, adb shell deletes (with system booted).
I also wanted to try adb shell while booted into cwm, but I could not get the adb connection to work from recovery.
I also tried to find the zip file in the developer section and that's the real reason why I revived this thread...Does anyone know where the thread is with the zip file to remove these files?
I think the only way to delete them is through cwm.Boot to recovery and use the menu to delete them.
Sent from my SGH-I927 using xda app-developers app
Kodiack99 said:
I think the only way to delete them is through cwm.Boot to recovery and use the menu to delete them.
Sent from my SGH-I927 using xda app-developers app
Click to expand...
Click to collapse
When I booted to recovery, I am able to delete each of the backups that I created. These all deleted correctly. I then went to Free unused backup files (to delete the files/folders in the blobs folder) and ran that and most of the files are gone. When I boot back into the phone, there are still some files/folders there and they seem to be taking up about 4-5 GB on the card. When I try to delete them through the file manager apps (either as root or not) they will not delete and the manager reports an error (before clicking delete, the manager displays a statistics report that says that the size of the files are over 2TB so obviously something is very messed up about them). I have also tried to delete them through the terminal (again as root and regular user) and they will not delete there either and they totally mess up the terminal window with unprintable characters (the only way to recover is to exit out of the current window and start a new one).
I finally fixed this problem last night by backing up all of my stuff (except the clockworkmod folder) to my computer. I then rebooted into recovery (latest version of CWM non-touch) and formatting the ext SD Card. When I rebooted there were still some folders there (including the clockworkmod folder). I did a format from within the OS and that cleared everything out. I copied all of my stuff back from my computer and I'm now good to go. Not sure how it got messed up to begin with, but the problem is fixed now. I think I'm going to stick with TWRP from now on.

[RECOVERY][CWM] ClockworkMod v6.0.1.4 v1 | custom extras menu (10/12/12)

This is a custom version of clockworkmod 6.0.1.4 (latest version available). See the 2nd post for information on what is in the extras menu.
To install:
- download these 2 files -----> uImage.CWM6 & touchpad_recovery_extras.zip
- boot into your current clockworkmod and mount /boot and /sdcard
- plug into your computer and run these commands
Code:
cd {location of folder where 2 files you just downloaded are}
adb push uImage.CWM6 /boot/uImage.CWM6
adb push touchpad_recovery_extras.zip /sdcard/touchpad_recovery_extras.zip
- go to install zip and choose the touchpad_recovery_extras.zip from your sdcard
- reboot and you will see an option in moboot for CWM6
Notes: The icons on the bottom of the recovery are placeholders for when i get the touchscreen working. I'm working on making this a touch recovery like the ones in my signature.
Click to expand...
Click to collapse
Whats in the extras menu?
- enable/disable one confirm (this makes it so you only have to scroll through one confirm selection when installing something instead of having to go through 10 of them to click yes)
- hide/show backup & restore progress (this makes it so the progress bar when you backup/restore doesnt show up and makes backups/restores a bit faster since it doesnt have to show you the progress and files its backing up)
- aroma file manager (file explorer - to configure properly: when opened the first time select "no" to use alternative touch. then press the back key or enter key to get past the dot part. that works best for me)
create custom zip (this will create a custom rom from the currently installed files you have on your phone. it takes your /system partition and /boot files and makes them into a zip file ready to be flashed. the end product will be in /sdcard/clockworkmod/zips/{DATE}. with date being a timestamp of the time it was created. be sure to run a fix_permissions after installing the zip too just in case. DO NOT DELETE THE FOLDER /sdcard/clockworkmod/zips/files
choose custom openrecoveryscript (read THIS)
- recovery info (shows the version of recovery and the build date)
hi, didn't work for me is saying "no space left on device"
Any idea???
thanks
had the same issue here
deleting old TWRP uImage in /boot after booting into TWRP worked for me
nos2k5 said:
had the same issue here
deleting old TWRP uImage in /boot after booting into TWRP worked for me
Click to expand...
Click to collapse
Yeah I should have explained that more. You can only have space for 2 recoveries. You can adb pull the original clockworkmod off and save it and push the cwm6
Sent from my SAMSUNG-SGH-I727 using xda app-developers app
If you're not fond of ADB like me,
Open terminal emulator
Grant it super user by typing
su
then hitting enter and select 'allow' when the toast pops up
You should now see the '#' symbol
Now type,
mount -o remount,rw /boot
Then hit enter
Now go to your favorite file manager that goes to the root dir. (I prefer ES File Explorer)
Now copy uimage.CWM6 to /boot
Reboot.
Credit goes to reverendkjr for showing us this in his video below.
https://www.youtube.com/watch?v=7iquJvUyOL4&feature=youtube_gdata_player
Sent from my cm_tenderloin using Tapatalk 2
hey sk8erwitskil,
what are the steps to boot into CWM6 from goo.manager?
it only kicks me into moboot, counting down to boot moboot.default
nos2k5 said:
hey sk8erwitskil,
what are the steps to boot into CWM6 from goo.manager?
it only kicks me into moboot, counting down to boot moboot.default
Click to expand...
Click to collapse
You have to edit android.default.recovery to read CWM6 I don't think ES file explorer allows you to do it but ROM Toolbox pro (free version) does .
Hope this helps
sstar said:
You have to edit android.default.recovery to read CWM6 I don't think ES file explorer allows you to do it but ROM Toolbox pro (free version) does .
Hope this helps
Click to expand...
Click to collapse
thanks for your advice, but in which directory can I find this entry
nos2k5 said:
thanks for your advice, but in which directory can I find this entry
Click to expand...
Click to collapse
Its in the boot folder .
sstar said:
Its in the boot folder .
Click to expand...
Click to collapse
thanks!
was not there, had to create it
works
Nice to see this, putting it on when I get home
Will edit post with my opinions and functionality (can't see any bad functionality from this thread)
Sent from my LT30p using xda premium
this works with ameers onlinebackup backup without reboot
Thanks so far so good
http://forum.xda-developers.com/showthread.php?t=1923680
touchscreen controls dont work
tjsooley said:
touchscreen controls dont work
Click to expand...
Click to collapse
please, read the first post!
Notes: The icons on the bottom of the recovery are placeholders for when i get the touchscreen working. I'm working on making this a touch recovery like the ones in my signature.
Click to expand...
Click to collapse
nos2k5 said:
please, read the first post!
Click to expand...
Click to collapse
I feel like Homer Simpson!
Impressive
Sent from my aokp_tenderloin using xda premium
theduce102 said:
If you're not fond of ADB like me,
Open terminal emulator
Grant it super user by typing
su
then hitting enter and select 'allow' when the toast pops up
You should now see the '#' symbol
Now type,
mount -o remount,rw /boot
Then hit enter
Now go to your favorite file manager that goes to the root dir. (I prefer ES File Explorer)
Now copy uimage.CWM6 to /boot
Reboot.
Sent from my cm_tenderloin using Tapatalk 2
Click to expand...
Click to collapse
Thanks for this! Worked great for me, I used the free Android Terminal Emulator from the Play Store and my preferred file manager is Root Explorer. The only thing I had to do differently was first delete the old CWM uimage from the boot file before pasting in the new one.
---------- Post added at 12:17 AM ---------- Previous post was at 12:14 AM ----------
sk8erwitskil said:
This is a custom version of clockworkmod 6.0.1.4 (latest version available). See the 2nd post for information on what is in the extras menu.
To install:
- download these 2 files -----> uImage.CWM6 & touchpad_recovery_extras.zip
- boot into your current clockworkmod and mount /boot and /sdcard
- plug into your computer and run these commands
Code:
cd {location of folder where 2 files you just downloaded are}
adb push uImage.CWM6 /boot/uImage.CWM6
adb push touchpad_recovery_extras.zip /sdcard/touchpad_recovery_extras.zip
- go to install zip and choose the touchpad_recovery_extras.zip from your sdcard
- reboot and you will see an option in moboot for CWM6
​
Click to expand...
Click to collapse
sk8erwitskil said:
Whats in the extras menu?
- enable/disable one confirm (this makes it so you only have to scroll through one confirm selection when installing something instead of having to go through 10 of them to click yes)
- hide/show backup & restore progress (this makes it so the progress bar when you backup/restore doesnt show up and makes backups/restores a bit faster since it doesnt have to show you the progress and files its backing up)
- aroma file manager (file explorer - to configure properly: when opened the first time select "no" to use alternative touch. then press the back key or enter key to get past the dot part. that works best for me)
create custom zip (this will create a custom rom from the currently installed files you have on your phone. it takes your /system partition and /boot files and makes them into a zip file ready to be flashed. the end product will be in /sdcard/clockworkmod/zips/{DATE}. with date being a timestamp of the time it was created. be sure to run a fix_permissions after installing the zip too just in case. DO NOT DELETE THE FOLDER /sdcard/clockworkmod/zips/files
choose custom openrecoveryscript (read THIS)
- recovery info (shows the version of recovery and the build date)
Click to expand...
Click to collapse
Thanks for this! Everything works great and I'm looking forward to the touch controls.
Can't wait for the touch controls!
Recovery rules
This build of CWM 6 is impressive. I've been using TWRP since release for the TouchPad, but it's nice to know I've got a backup recovery now. Hopefully touchscreen controls won't be too much of a pain to get working. Thank you!

Flashing Now Fails

I've been flashing N7 with no issues as recently as over the weekend. Today I tried to flash a new ROM and it failed. Tried a second, different ROM, same result. Do not know what I did. Any thoughts?
Error log would help greatly.
How do I get/generate the log? Haven't had to do it before.
Thanks,
Paul
The logs= errors displayed on the screen provided by the interface you use to flash the rom (recovery, computer...)
Does this help any?
TWRP V2.4.4.0
Updating partition details
E: Unable to open zip file
Error flashing zop
Updating partition details...
do I need to create a partition? Never get more details despite the tease.
Thanks,
First -
Try and download a different (NEWER) TWRP. Re-flash TWRP. Try again
or
Have you tried completely wiping the device? And pushing a ROM from ADB or using a USB OTG and Memory stick?
I had issues with my nexus becoming VERY unstable. Leading to issues.
I completely, and I mean completely, wiped. To the point that all that device basically had was a recovery, and a bootloader.
I proceeded to flash again, BOOM all fixed up.
Is there a new TWRP?
I did a factory restore after wiping everything thing, if that is what you mean?
It was working as expected last week, don't know what I did to screw it up
Boot recovery try the operation, choose advanced then copy log to sdcard. The paste the log results.
sent via electromagnetic radiation.
ibsk8 said:
Boot recovery try the operation, choose advanced then copy log to sdcard. The paste the log results.
sent via electromagnetic radiation.
Click to expand...
Click to collapse
Did this, and it said it copied but I am unable to locate it. It says 0\media\data But that folder structure doesn't exist, at least according to file expert
Will a complete wipe/restore create a partition?
pmgreen said:
Will a complete wipe/restore create a partition?
Click to expand...
Click to collapse
None of the instructions currently found in this forum alters the partitioning of the N7. Not fastboot & not the custom recovery, either.
You are chasing a red herring I think. That message you see is about the recovery performing a scan to check to see if there is a change in file systems (or partitioning of external devices) ... which might have occurred in preceding (custom recovery) operations, but didn't in this particular case.
pmgreen said:
Does this help any?
TWRP V2.4.4.0
Updating partition details
E: Unable to open zip file
Error flashing zop
Updating partition details...
Click to expand...
Click to collapse
Focus your efforts here; it certainly looks like a first-order problem.
bftb0 said:
None of the instructions currently found in this forum alters the partitioning of the N7. Not fastboot & not the custom recovery, either.
You are chasing a red herring I think. That message you see is about the recovery performing a scan to check to see if there is a change in file systems (or partitioning of external devices) ... which might have occurred in preceding (custom recovery) operations, but didn't in this particular case.
Focus your efforts here; it certainly looks like a first-order problem.
Click to expand...
Click to collapse
Think reinstalling TWRP would help? It was working fine so I'm a bit stumped what changed and why
pmgreen said:
Think reinstalling TWRP would help? It was working fine so I'm a bit stumped what changed and why
Click to expand...
Click to collapse
You can also soft-boot a recovery without actually flashing it, e.g.
Code:
fastboot boot custom-recovery.img
I suppose you could then poke around and see if it is having troubles mounting any of the normal partitions (/data, /system, or /cache). Look in the kernel boot log of the recovery (cat /proc/kmsg or "dmesg") to see if anything looks strange, etc.
There have been a couple of reports from folks who developed problems that looked like eMMC flash media errors - loss of partitions, failure to mount /data, et cetera. At the moment though, your symptoms are very generic and non-specific, as in "it doesn't boot".
I suppose you saw no errors at all reported on the screen during that stock-install-via-fastboot procedure?
bftb0 said:
You can also soft-boot a recovery without actually flashing it, e.g.
Code:
fastboot boot custom-recovery.img
I suppose you could then poke around and see if it is having troubles mounting any of the normal partitions (/data, /system, or /cache). Look in the kernel boot log of the recovery (cat /proc/kmsg or "dmesg") to see if anything looks strange, etc.
There have been a couple of reports from folks who developed problems that looked like eMMC flash media errors - loss of partitions, failure to mount /data, et cetera. At the moment though, your symptoms are very generic and non-specific, as in "it doesn't boot".
I suppose you saw no errors at all reported on the screen during that stock-install-via-fastboot procedure?
Click to expand...
Click to collapse
The only error is that it can't open the zip. I've tried downgraded TWRP, then upgrading back. Tried flashing the existing rom.
Nothing has worked. The N7 is functional, just will not allow me to flash
pmgreen said:
The only error is that it can't open the zip. I've tried downgraded TWRP, then upgrading back. Tried flashing the existing rom.
Nothing has worked. The N7 is functional, just will not allow me to flash
Click to expand...
Click to collapse
Well, if the source material can't be opened, then there is nothing to be flashed.
So maybe it is better to call this a "can't open files" problem instead of a "can't flash" problem.
Are there any special characters in the file name ... or spaces? If so, try renaming the file so the name only contains [a-z], [A-Z], [0-9] plus dash, underscore, and dot.
The other thing that can happen is if you drop a file in /data/media/0 as the root user, it will show up under /sdcard, but can't be read by non-privileged users via the /sdcard/ path. I'm not sure what the exact details are here - much less why this would effect the recovery (as you would expect everything to be running as root there) - but you can detect this problem by using a terminal emulator, and looking for differences in ownership or file permission:
Code:
$ su
# cd /data/media/0
# ls -ld *
use chown and chmod as appropriate to fix files as needed
bftb0 said:
Well, if the source material can't be opened, then there is nothing to be flashed.
So maybe it is better to call this a "can't open files" problem instead of a "can't flash" problem.
Are there any special characters in the file name ... or spaces? If so, try renaming the file so the name only contains [a-z], [A-Z], [0-9] plus dash, underscore, and dot.
The other thing that can happen is if you drop a file in /data/media/0 as the root user, it will show up under /sdcard, but can't be read by non-privileged users via the /sdcard/ path. I'm not sure what the exact details are here - much less why this would effect the recovery (as you would expect everything to be running as root there) - but you can detect this problem by using a terminal emulator, and looking for differences in ownership or file permission:
Code:
$ such
# cd /data/media/0
# ls -ld *
use chown and chmod as appropriate to fix files as needed
Click to expand...
Click to collapse
Thanks bftb, you are correct it's a can't open zip. No error than fail and it can't open the zip. It says updating partition but nothing changes
The file names are from the developers, once of which I recently successfully flashed. Tried coping the log to the SD card, but unable to find /data/media/0. Do I need to recreate a partition?
(FYI there was an auto-correct typo in my prior post - "su" not "such". Derp)
pmgreen said:
Do I need to recreate a partition?
Click to expand...
Click to collapse
No. (There is no way to do that with the tools we have anyway)
Unless what you mean by "recreate" is rebuild/reinitialize a filesystem in a partition - that's a possibility.
You need to try and figure out why you can't read files.
As a workaround, you can put files on a USB key (FAT formatted, not NTFS) and using TWRP access them by putting the USB key on the other end of a OTG cable.
Your posts are a bit vague - I can't even tell if you have tried other ROM files, whether you checked them to see if they are the correct size/checksum, etc.
pmgreen said:
Tried coping the log to the SD card, but ...
Click to expand...
Click to collapse
At this point, your best approach is still to follow the initial advice of 'ibsk8'. Look in the log file for any further details about errors that occurred.
The logs are typically in /cache/recovery/ or (while the custom recovery is running) in /tmp
Use "adb pull" to get the log file to your PC and have a look at it. If you can't find anything obvious in there, then cut-n-paste the file to http://pastebin.com and provide the link to us.
bftb0 said:
At this point, your best approach is still to follow the initial advice of 'ibsk8'. Look in the log file for any further details about errors that occurred.
The logs are typically in /cache/recovery/ or (while the custom recovery is running) in /tmp
Use "adb pull" to get the log file to your PC and have a look at it. If you can't find anything obvious in there, then cut-n-paste the file to http://pastebin.com and provide the link to us.
Click to expand...
Click to collapse
I am not familiar using ADB pull. Tried using a root file manager to access the log but don't see.
Greatly appreciate your help, let me know what other info I should paste.
Thanks,

[Q] how to recover data from a phone that will not boot

I have jamal2367's [AOSP] official 4.4.2 - S4 Google Edition ROM installed (final R1.2) a SGH-1337M.
The other day it started getting stuck on boot; the blue, red, yellow, green circles just continually go in and out without anything else happening. I have booted into CWM Recovery (v6.0.4.4) and done a wipe cache partition and wipe dalvik cache but it did not help.
Can anyone provide advice/steps on how to copy the data (mostly pics and WhatsApp history) off this phone? SMS history would also be nice but not necessary.
toggly said:
I have jamal2367's [AOSP] official 4.4.2 - S4 Google Edition ROM installed (final R1.2) a SGH-1337M.
The other day it started getting stuck on boot; the blue, red, yellow, green circles just continually go in and out without anything else happening. I have booted into CWM Recovery (v6.0.4.4) and done a wipe cache partition and wipe dalvik cache but it did not help.
Can anyone provide advice/steps on how to copy the data (mostly pics and WhatsApp history) off this phone? SMS history would also be nice but not necessary.
Click to expand...
Click to collapse
I would make a backup in your recovery and then flash the rom you had installed. See if that helps.
Edit: You didn't try to update. I changed my comment saying you had tried.
1. Download Aroma File Manager
2. Put a external sd into your phone.
3. Boot into the custom recovery and flash the Aroma file.
4. It will boot into a file browser and you can copy all the files from internal to your external.
ps it's possible that your custom recovery already has a filemanager build in. Then all these steps are obsolete.
I boot into AROMA Filemanager but I can't see anything on the internal SD card (see attachment).
Any ideas? Does that folder icon mean the "sdcard" folder is encrypted?
toggly said:
I boot into AROMA Filemanager but I can't see anything on the internal SD card (see attachment).
Any ideas? Does that folder icon mean the "sdcard" folder is encrypted?
Click to expand...
Click to collapse
Is it encrypted? Then probably it won't work. In that case just reflash the rom you are on without wiping.
toggly said:
Does that folder icon mean the "sdcard" folder is encrypted?
Click to expand...
Click to collapse
Lennyz1988 said:
Is it encrypted? Then probably it won't work. In that case just reflash the rom you are on without wiping.
Click to expand...
Click to collapse
I don't know, that's why I am asking what that icon means?
You say CWM is working, so you can just adb pull everything you need. Applications usually save data in a directory under /data/data or /sdcard/Android/data.
You should find the directories you want with adb shell, then you can adb pull them, then if you reflash your rom you can adb push them back into the same locations. Also, depending where they are saved, your pictures will most likely not be deleted when you reflash your rom. Better safe than sorry though.
If you don't have adb you'll have to download the binary, or you can install the entire Android SDK. Which operating system do you use?
toggly said:
I don't know, that's why I am asking what that icon means?
Click to expand...
Click to collapse
The icons means that it's symlinked. If it's not encrypted then you should find the data. It can be in an other place then where you are looking. Try looking in /data/media or some other maps in /data
Or just flash the rom you are currently on without wiping.
soldier9599 said:
You say CWM is working, so you can just adb pull everything you need. Applications usually save data in a directory under /data/data or /sdcard/Android/data.
You should find the directories you want with adb shell, then you can adb pull them, then if you reflash your rom you can adb push them back into the same locations. Also, depending where they are saved, your pictures will most likely not be deleted when you reflash your rom. Better safe than sorry though.
If you don't have adb you'll have to download the binary, or you can install the entire Android SDK. Which operating system do you use?
Click to expand...
Click to collapse
Adb won't work unless he already has authorized adb when his device was booted.
toggly said:
I boot into AROMA Filemanager but I can't see anything on the internal SD card (see attachment).
Any ideas? Does that folder icon mean the "sdcard" folder is encrypted?
Click to expand...
Click to collapse
You need to mount partitions to see the contents.. Go to Aroma File Manager Settings and check the option "Moumt automatically partition on boot".. then restart your recovery and flash again the Aroma File Manager
Lennyz1988 said:
Adb won't work unless he already has authorized adb when his device was booted.
Click to expand...
Click to collapse
I've had devices where the first thing I did with them was unlock bootloader, fastboot flash recovery, and then go into recovery and adb sideload, all without booting the system.
peppe130 said:
You need to mount partitions to see the contents.. Go to Aroma File Manager Settings and check the option "Moumt automatically partition on boot".. then restart your recovery and flash again the Aroma File Manager
Click to expand...
Click to collapse
That did the trick, thanks!!
Nothing
soldier9599 said:
I've had devices where the first thing I did with them was unlock bootloader, fastboot flash recovery, and then go into recovery and adb sideload, all without booting the system.
Click to expand...
Click to collapse
Yes and I believe that. But from version 4.2.2 android forces rsa encryption. So you need to boot into your rom and enable it. Unless the custom rom/kernel has disabled it, but I haven't seen any that have.

[MOD][SCRIPT] Get More Storage by Relocating Dalvik Cache!

DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.

Categories

Resources