How to write file / folder to internal memory on rooted Android device - Android Software/Hacking General [Developers Only]

Hello,
I tried with root explorer, all seems ok, but after reboot created files and folders in internal memory disappear.

Where on the Internal Memory are you placing them? If their in / they will disappear when the phone reboots because the root filesystem is actually a ramdisk with /system, /data and /cache mounted on them and symlinked to fit. (I believe.)

i see so ... i want to write some files in /data/data/com_adobe_flashplayer/lib/ as wrote here http://forum.xda-developers.com/showthread.php?t=1359506 but after reboot they are gone

UN.TIGRU.NET said:
i see so ... i want to write some files in /data/data/com_adobe_flashplayer/lib/ as wrote here http://forum.xda-developers.com/showthread.php?t=1359506 but after reboot they are gone
Click to expand...
Click to collapse
That's because the package for "com_adobe_flashplayer" doesn't exist. It seems that the path might have gotten changed by the board for looking to much like a URL. Replace the underscores with periods and you should be good to go. Sorry it took so long to get back to you.
Hope I solved your problem
Alternatively, the post you linked contains a update you can flash through recovery that should fix your problem easily.

Related

[Q] data folder reverts with restart or remount. No permanent uninstalls.

I was using XXKPQ Gingerbread. Soon my phone started restarting and giving errors.
When I use ODIN I can put new files in to system folders. I installed XXKPE and clockworkmod, then I used adb remount, adb shell to delete everything under data/data, data/app, sdcard, sd-ext. When I do ls it said folders were empty but after restart everything came back!
Is there a way to mount a file system as a volatile memory? It accepts all the changes I say but it reverts back when unmounted and remounted. I thought it might be permission problem but fix_permissions script does not solve it. Also I heard 0 available memory bugs in the forums but my case is not that either.
On recovery menu, I used clockworkmod options to mount the data folder, I erased everything in it via adb shell, and without restarting I unmounted and mounted again using CWM, the files were there again in adb shell!
Since there are files under data/data and data/app folders, I get crashes of those applications all the time when I try to use the phone. If I install the same application from market it works fine but after restart it reverts back to crashing.
snlzkn said:
I was using XXKPQ Gingerbread. Soon my phone started restarting and giving errors.
When I use ODIN I can put new files in to system folders. I installed XXKPE and clockworkmod, then I used adb remount, adb shell to delete everything under data/data, data/app, sdcard, sd-ext. When I do ls it said folders were empty but after restart everything came back!
Is there a way to mount a file system as a volatile memory? It accepts all the changes I say but it reverts back when unmounted and remounted. I thought it might be permission problem but fix_permissions script does not solve it. Also I heard 0 available memory bugs in the forums but my case is not that either.
On recovery menu, I used clockworkmod options to mount the data folder, I erased everything in it via adb shell, and without restarting I unmounted and mounted again using CWM, the files were there again in adb shell!
Since there are files under data/data and data/app folders, I get crashes of those applications all the time when I try to use the phone. If I install the same application from market it works fine but after restart it reverts back to crashing.
Click to expand...
Click to collapse
Exists even after xxkpe + pit flash?
Try converting to ext4 and formatting and then flash xxkpe + pit.
Having read many such issues now, it seems its MoBo issue. Search around a bit. From what i have read, probably service center's the only one who would be able to help you now.
Try VurrutRom , when you install it the rom exchange the internal sd with the external sd.
you will see that your /data folder is now in the external sd. I hope this fix your problem.
@ggclanlord: This phone had motherboard issues before but this looks more like a protection to me. No matter which rom I install the applications and their settings just stay there. I might try ext4 later as well.
reivaj20 said:
Try VurrutRom , when you install it the rom exchange the internal sd with the external sd.
you will see that your /data folder is now in the external sd. I hope this fix your problem.
Click to expand...
Click to collapse
How do I change the internal sd with external sd? I have found this but it does not say it needs to be Vurrut. Is it somehow easier with Vurrut?
http://forum.xda-developers.com/showthread.php?t=1088474
First of all, why are you trying to clear any partition manually ?
Second, /data is a separate partition altogether neither on internal sd nor external.
Flash a full xxkpe with pit and re-partitioned checked. Then flash CF-root. Your phone should return to normal.
Generally you should not need to manually format partition ever but in case you need there are options under Advanced in CWM.
Hope it helps!
Good luck !

[Q] Has anyone found an App to SD solution?

I've looked through the big development thread and haven't found a clear answer but has anyone found an app to sd solution that works?
This stupid SdCard / ExtSdCard arrangement is making me pull my hair out. I just realized my titanium backups weren't really backups since they were being stored on my internal memory.
I managed to change my backup folder and free up some space by moving all my backups to the SD card, but for some reason I cannot move apps to SD through Titanium or any other app I've tried.
Does anyone know how to do this? Is there a setting in titanium I need to change or is this just something we have to deal with forever short of flashing a custom rom?
SDCARD binary
Galahad_Knight said:
I've looked through the big development thread and haven't found a clear answer but has anyone found an app to sd solution that works?
This stupid SdCard / ExtSdCard arrangement is making me pull my hair out. I just realized my titanium backups weren't really backups since they were being stored on my internal memory.
I managed to change my backup folder and free up some space by moving all my backups to the SD card, but for some reason I cannot move apps to SD through Titanium or any other app I've tried.
Does anyone know how to do this? Is there a setting in titanium I need to change or is this just something we have to deal with forever short of flashing a custom rom?
Click to expand...
Click to collapse
I've found the real problem, but not the solution.
My Relay runs ICS. It is rooted, and you have to root to even touch any of this. The phone has a binary, /system/bin/sdcard that controls the internal memory and your SDcard. now, I have found that if you are rooted, you can chmod this binary (or use rooted ES File explorer to remove all executable properties) so that it can no longer run, then reboot. then you can run, as superuser "mount -o rw,bind /mnt/extSdCard /mnt/sdcard"
Seems great... Except vfat doesn't like to be bound in such a fashion, and you quickly lose write access and it starts mangling your files.
vfat just doesn't seem to work for us in this case. I've changed mine back, and reformatted my SDcard to be NTFS and mounted with paragon NTFS/HFS, which has completely stabilized my filesystem. only problem is, I can't get this to mount -o bind worth a damn.
I'm toying with the idea of reformatting my SDCard part vfat and either part NTFS or EXT4. maybe I get get the phone to natively recognize ext4 for the sdcard (even if I have to create a script myself)
keypoints I've found in this process:
1. the sdcard binary only allows access to 1023 files at once on either the SDcard, or the memory block it is using as the SDcard. too many pictures in your gallery? so sorry... can't load them all.
2. the physical device for your sdcard is /dev/block/mmcblk1. the partitions are mmcblk1p* (starting with 1)
3. the phone will not allow the sdcard binary to be killed manually. removing the executable permission and then rebooting the phone seems to be the only way to get it to stop.
4. vfat is prone to errors, and android seems to love screwing with the card. getting off vfat seems to be crucial to this process.
As you've gotten no other replies, and this is a gigantic concern for me as well, I'm going to keep working on this myself, in the hopes that I can get the phone to actually use the SDcard the way we hope it can be used.

[Q] Link2sd relink file not working

Hello,
I have installed a lot of applications on my device and linked them to my sdcard with link2sd.
Those applications have been installed on a specific account (guest account) on my device.
I have changed my sdcard, create a new partition ext2 on it, copy and paste all the files, directories,... of the old partition to the new one, and tried to relink the new card with link2sd.
But -> "no file to link" !! :crying:
And I don't have anymore my old sdcard.
Means, today, I have no more application listed on my screen, no more application listed in the settings, no more application listed in "My applications" of the Google Play Store, but the memory of my device is completly full of specific files of the applications which were previoulsy linked to the previous sdcard.
In other word, it is the mess and I really need to recover my applications with the datas.
Does someone know how to fix this??? (even manually)
Thank you
clecocq1 said:
Hello,
I have installed a lot of applications on my device and linked them to my sdcard with link2sd.
Those applications have been installed on a specific account (guest account) on my device.
I have changed my sdcard, create a new partition ext2 on it, copy and paste all the files, directories,... of the old partition to the new one, and tried to relink the new card with link2sd.
But -> "no file to link" !! :crying:
And I don't have anymore my old sdcard.
Means, today, I have no more application listed on my screen, no more application listed in the settings, no more application listed in "My applications" of the Google Play Store, but the memory of my device is completly full of specific files of the applications which were previoulsy linked to the previous sdcard.
In other word, it is the mess and I really need to recover my applications with the datas.
Does someone know how to fix this??? (even manually)
Thank you
Click to expand...
Click to collapse
Did you try and re-create the mount scripts?
Are the paths exactly the same?
Try installing an app and then linking it with Link2SD. Then check the path of the linked data. Make sure it matches with your backups.
I'd personally go for clean installs when changing SD card, but I think you're brave for trying. Good luck.
tillward said:
Did you try and re-create the mount scripts?
Are the paths exactly the same?
Try installing an app and then linking it with Link2SD. Then check the path of the linked data. Make sure it matches with your backups.
I'd personally go for clean installs when changing SD card, but I think you're brave for trying. Good luck.
Click to expand...
Click to collapse
Yes tried the re-create mount script without success.
One information: The old partition was ext3 and this time I created an ext2. Is it important?
Where can I check the path of the linked data exactly?? Which file?
Thank you for your help.
clecocq1 said:
Yes tried the re-create mount script without success.
One information: The old partition was ext3 and this time I created an ext2. Is it important?
Where can I check the path of the linked data exactly?? Which file?
Thank you for your help.
Click to expand...
Click to collapse
Just so I have this right...
You backed up all the data and file structure from your ext3 partition, re-formatted it to ext2, then copied all the data and file structure back on.
Have a look in root explorer. What are the folder names of your two SDcard partitions under /root ?
Mine looks like this:
/root/sd-ext
/root/sdcard
/root/storage/sdcard0
I used a script from here: http://forum.xda-developers.com/showthread.php?t=1971689 so mine will probably be different to yours.
If your linked app files are in the same place as before, (check this by installing and linking a new app and then finding it's linked data in root explorer) and you get an error/ no result when re-creating mount scripts in Link2SD, then i'm at a loss.
There are a lot more knowledgeable people than me on these forums, so hopefully one of those people will see your post and offer you a solution. Otherwise, it's time to re-install all your apps I suppose.
tillward said:
Just so I have this right...
You backed up all the data and file structure from your ext3 partition, re-formatted it to ext2, then copied all the data and file structure back on.
Have a look in root explorer. What are the folder names of your two SDcard partitions under /root ?
Mine looks like this:
/root/sd-ext
/root/sdcard
/root/storage/sdcard0
I used a script from here: http://forum.xda-developers.com/showthread.php?t=1971689 so mine will probably be different to yours.
If your linked app files are in the same place as before, (check this by installing and linking a new app and then finding it's linked data in root explorer) and you get an error/ no result when re-creating mount scripts in Link2SD, then i'm at a loss.
There are a lot more knowledgeable people than me on these forums, so hopefully one of those people will see your post and offer you a solution. Otherwise, it's time to re-install all your apps I suppose.
Click to expand...
Click to collapse
Effectively, I don't know whether I got the exactly same partition name before and after (before ext3 and after etx2).
I have nothing under /root
Actually it is quite strange. I can see my sdcard (only the FAT partitiion) under:
/sdcard2
or
/storage/sdcard1
this is pointing to my external sdcard. I can see the same files/directories in there.
I don't see the second ext2 partition with RootExplorer.
I can see it only with ESExplorer on the lateral bar. It is named sdext2.
I guess that the old partition ext3 was certainly not named the same.
I've just linked new file on the new partition. It is working correctly.
in the data/app folder I see the icon of the new linked app with the correct icon image (it is a game) and a small arrow in the top left correct (shortcut).
in the same folder, I see all the other icons of the lost linked applications with an android image and also the small arrow in the top left corner. But obviously when I tap on it, it says "analysis error,...". I guess that the shorcut points to nowhere because it is not linked anymore.
But I don't where to check where the shortcut is pointing to !! and how to change.
It should be simple to find back the old partition name and rename the new one with same name...
thank you for your help.
clecocq1 said:
Effectively, I don't know whether I got the exactly same partition name before and after (before ext3 and after etx2).
I have nothing under /root
Actually it is quite strange. I can see my sdcard (only the FAT partitiion) under:
/sdcard2
or
/storage/sdcard1
this is pointing to my external sdcard. I can see the same files/directories in there.
I don't see the second ext2 partition with RootExplorer.
I can see it only with ESExplorer on the lateral bar. It is named sdext2.
I guess that the old partition ext3 was certainly not named the same.
I've just linked new file on the new partition. It is working correctly.
in the data/app folder I see the icon of the new linked app with the correct icon image (it is a game) and a small arrow in the top left correct (shortcut).
in the same folder, I see all the other icons of the lost linked applications with an android image and also the small arrow in the top left corner. But obviously when I tap on it, it says "analysis error,...". I guess that the shorcut points to nowhere because it is not linked anymore.
But I don't where to check where the shortcut is pointing to !! and how to change.
It should be simple to find back the old partition name and rename the new one with same name...
thank you for your help.
Click to expand...
Click to collapse
You could try running the script that I mentioned. It won't do any harm. It may be, like you say, that the partition is named differently, so the paths don't quite match up. Duplicating the SD partition path with the script that I linked to, might (and it's a long-shot) let Link2SD see the partition on the path previously set. Let us know if you figure it out.
What was the reason you changed the partition format type anyway?
tillward said:
You could try running the script that I mentioned. It won't do any harm. It may be, like you say, that the partition is named differently, so the paths don't quite match up. Duplicating the SD partition path with the script that I linked to, might (and it's a long-shot) let Link2SD see the partition on the path previously set. Let us know if you figure it out.
What was the reason you changed the partition format type anyway?
Click to expand...
Click to collapse
I'll give it a try asap.
Concerning the reasons... bad reasons unfortunately. The links sometimes were not working. I had to relink regularly the files (hopefully, it is automatic, but not very convenient). Then I though that it may be better in ext2, and you know what happened
I will keep you informed if your advice works.
Thank you very much
tillward said:
You could try running the script that I mentioned. It won't do any harm. It may be, like you say, that the partition is named differently, so the paths don't quite match up. Duplicating the SD partition path with the script that I linked to, might (and it's a long-shot) let Link2SD see the partition on the path previously set. Let us know if you figure it out.
What was the reason you changed the partition format type anyway?
Click to expand...
Click to collapse
Unfortunately, not possible for me. I don't have a custom ROM and therefore don't have /system/etc/init.d in my device.
I will try to reformat bacl my 2nd partition in ext3 and see if I will be able to relink.
I have reformated my partition in ext3.
But after rebooting my device, the mounted name is still sdext2.
Does someone know how to change a mounted partition name without a custom ROM?
Thank you
The script is named init-recovery.sh in /etc.
Finaly, I reinstalled all the apps and copy/paste all the user files manually then relinked to the new partition with link2sd.
Everything is working now.
Thank you anyway for your help
I too am facing similar problem
but i had been using link2sd before and before doing the process i didnt not unlink back to sd card the applications
so now all the files are in miscellaneous folder
is there any way to re link these
i use stock rom

[Completed] [Question] Writing to external sd card Specifically with ES File Manager!

I have a Sprint Galaxy Note $ Running Stock og5 Rom Rooted via Beast Mode TWRP then Play update, then flashed to Plazma Kernel. I have modified the /etc/permissions/platfom.xml file to include Group Id media_rw in the write to external storage permission and mounted the /mnt/media_rw/estSDcard as r/w in the root explorer portion of ES File Manager and it seemed to work fine for as long as I can remember but now if I try to copy or paste or send something to /storage/extSDcard it is created asychrously and ends up in the LOST.dir folder after a simple unmount remount or reboot or SDcard pull. Other apps are having the same problems like app backup restore and Btitorrent and others when trying to write directly to extSDcard I even went ass far as adding sdcard_all to the aforementioned gid permission set. It seems like such an obvious thing that has been overlooked by develpoers of the rom. I can create masting folders "no asychronously' if I do so buy navigating to /mnt/media_rw/extSDcard rather than /storage/extSDcard and they'll last but not all programs will allow that directory in their settings. Furthermore ES download Manager won't function with either directory and will not allow their app backup file to be saved the /mnt directory. only /0 or /storage/extSDcard.
I have exhausted my abilities with this and have no answer also It seems to be a new problem, and I haven't done anything I can think of to cause this. Partition table is 55000mb Fat32 17009mb ext4 journal partition on the extSDcard. Any Ideas?
Below you can see The before and after of unmounting and remounting my sd card resulting in Populated Lost.dir and loss of created folders also you can see the way that all nav methods resultu in same permission set when checked with a root explorer "total Commander"
wELL i DON'T KNOW WHY BUT REFORMATTING THE SD CARD TO A SINGLE FAT 32 VOLUME SOLVED THE LEAK. i FIRST TRIED AN ALTERNATE SD CARD WITH A SIMILAR PATITION TABLE (EXT2/FAT32) BUT HAD THE SAME PROBLEMS EXCEPT THE DATA WOULD SIMPLY BE GONE INSTEAD OF IN THE LOST.DIR FOLDER. i HAVE YET TO IMPLEMENT THIS TO MY PRIMARY USE SD CARD because of the fact that I have backups and files that I need on that card from before the leak. I anticipate the same results, fingers crossed.
If ANYONE has any incite into why the partition table set up as it was would affect the retention of data in this manner please let me know.
PLEASE PLEASE let me know
Hello,
Try posting your question/issue in the ROM/kernel thread where you got them or their dedicated Q&A thread(if it has one) or even PM the developer in case its something he isn't aware of, he may want to try and solve it so his ROM has no issues.
I hope this helps. Good luck.
Droidriven said:
Hello,
Try posting your question/issue in the ROM/kernel thread where you got them or their dedicated Q&A thread(if it has one) or even PM the developer in case its something he isn't aware of, he may want to try and solve it so his ROM has no issues.
I hope this helps. Good luck.
Click to expand...
Click to collapse
Thanks, I was using stock rom though. And the caps lock was an accident, at any rate i have changed roms and the issue appeared to be a faulty sd card to begin with. I wasn't able to retain data from my reader writer to phone on my primary sd ince reformatted but was when I used a different one. Anyway thanks for the advice and I will use it if I have different questions

How to check file system integrity?

Hi All,
I apologize if this is a dumb question, but I'm new to modifying Android stuff.
Today I tried out using adb running on Puppy Linux to disable some apps on my new phone. It mounted the phone fine and I was able to issue the commands I found in the tutorial to disable certain apps. However, I forgot to unmount the phone before unplugging it and Puppy Linux threw up a scary looking message about how disconnecting without unmounting can cause file system corruption on the phone.
Is this something I should be concerned about or is the warning dialogue overstating the danger? Is there a way to check file system integrity on Android phones?
Thanks for any help!
Mounting partions that by default are RO ( testing state , for example /system ) as RW ( production state ) and afterwards not remounting them back as RO leaves a security whole, nothing else.
jwoegerbauer said:
Mounting partions that by default are RO ( testing state , for example /system ) as RW ( production state ) and afterwards not remounting them back as RO leaves a security whole, nothing else.
Click to expand...
Click to collapse
is that the same with usb external HDDs?
entwicklun said:
is that the same with usb external HDDs?
Click to expand...
Click to collapse
System critical partitions by default always are mounted as RO.
jwoegerbauer said:
Mounting partions that by default are RO ( testing state , for example /system ) as RW ( production state ) and afterwards not remounting them back as RO leaves a security whole, nothing else.
Click to expand...
Click to collapse
I apologize for the slow reply. Thank you very much for your response. I forgot to mention that I also copied a few files from my computer to my phone (after running adb) before disconnecting without unmounting. Does copying the files introduce the risk of corrupting the file system or is it still a non concern like you mentioned above?
ryan735 said:
I apologize for the slow reply. Thank you very much for your response. I forgot to mention that I also copied a few files from my computer to my phone (after running adb) before disconnecting without unmounting. Does copying the files introduce the risk of corrupting the file system or is it still a non concern like you mentioned above?
Click to expand...
Click to collapse
If you copied the files to system critical sections of Android OS like /system partition then it might be possible Android OS got corrupted, but an Android partition's file system - what can be thought of as an index or database containing the physical location of every piece of data on the related storage memory - itself never gets corrupted by such an action.
jwoegerbauer said:
System critical partitions by default always are mounted as RO.
Click to expand...
Click to collapse
alittle paraphrasing and human synergistics/adapting would have been helpful.... soz for being sh!t.
entwicklun said:
alittle paraphrasing and human synergistics/adapting would have been helpful.... soz for being sh!t.
Click to expand...
Click to collapse
ROFL
jwoegerbauer said:
If you copied the files to system critical sections of Android OS like /system partition then it might be possible Android OS got corrupted, but an Android partition's file system - what can be thought of as an index or database containing the physical location of every piece of data on the related storage memory - itself never gets corrupted by such an action.
Click to expand...
Click to collapse
Thank you very much. I copied an apk file over to the 'Downloads' directory in order to install it (it isn't available in the Play Store for my country). It sounds like that should be safe as I don't think that would be considered a system critical portion of the OS, right?
Thank you again. I appreciate your help and explanations. It looks like there's no need to worry in this particular situation, but I will make sure to unmount the phone before disconnecting in the future.
ryan735 said:
I copied an apk file over to the 'Downloads' directory in order to install it (it isn't available in the Play Store for my country). It sounds like that should be safe as I don't think that would be considered a system critical portion of the OS, right?
Click to expand...
Click to collapse
You got it.

Categories

Resources