Recover lost DCIM folder from internal memory!? - OnePlus X Q&A, Help & Troubleshooting

internal memory was full. was trying to shift DCIM folder using CUT-->PASTE (ES explorer App) from internal to external SD card, but used the skip paste option since external already had a dcim folder and i didnt want to overwrite it.
when i rechecked the internal memory the DCIM folder had disappeared from internal memory because of using "cut" instead of "copy"
how do i recover the lost DCIM folder?

You might be able to use a data recovery tool but more than likely it's gone forever mate.

Try using DiskDigger photo recovery... It's found on the Play Store.

Tanner1294 said:
You might be able to use a data recovery tool but more than likely it's gone forever mate.
Click to expand...
Click to collapse
files are still there since i havent over written the free space. problem is the directory structure has been deleted. i need a program to recreate the directory structure maybe.

chromeopx said:
Try using DiskDigger photo recovery... It's found on the Play Store.
Click to expand...
Click to collapse
tried it. it didnt work. i need a program which recreates the folder structure .

There are so many programs i can use to recover files but they wont work because i cant mount the Internal Memory so that it shows up as a regular partition in windows. Just useless MTP mode. UMS mode needs to come back for the Internal memory.

psychem said:
There are so many programs i can use to recover files but they wont work because i cant mount the Internal Memory so that it shows up as a regular partition in windows. Just useless MTP mode. UMS mode needs to come back for the Internal memory.
Click to expand...
Click to collapse
If you had access to linux and a data recovery tool for Linux you may have a chance. Windows cannot mount the internal storage since it uses either EXT4 or F2FS, both filesystems that Windows can't read.

Tanner1294 said:
If you had access to linux and a data recovery tool for Linux you may have a chance. Windows cannot mount the internal storage since it uses either EXT4 or F2FS, both filesystems that Windows can't read.
Click to expand...
Click to collapse
i have linux mint boot usb key but how will it help? MTP is a bottleneck at the phone end. MTP wont allow mounting internal memory even in linux.

Related

[Q] Cant see files that I copy to the SD card over USB

I have been searching for answers on this and so far found nothing. Sorry if its already been covered somewhere I didn't find.
The SD card is working fine in the pone.
When I put it in a usb adapter to plug into my pc it mounts fine and I can copy files to it without any errors but when I put it back in the phone I cant see the files?
Same thing happens when I plug the phone into a pc with USB and copy the files.
The files are still there because when I plug back into the pc I can see them.
Anyone know why I have this issue please?
Many thanks
Ben
Try unmounting an remounting the sdcard in the Settings menu.
Have you tried other filemanagers than the stock one?
I can't confirm your issue but it sounds like a caching issue.
Have you tried turning it off and on again? =)
I have a similar issue , I have files that I have copied over to the phone sd card and wanted to use a file manager to move them around into different files however none of the file managers seem to see the files
Sent from my GT-I9300 using xda premium
d4fseeker said:
Try unmounting an remounting the sdcard in the Settings menu.
Have you tried other filemanagers than the stock one?
I can't confirm your issue but it sounds like a caching issue.
Have you tried turning it off and on again? =)
Click to expand...
Click to collapse
I am using ES File Explorer
I have tried rebooting the phone and also (after you said) mounting and unmounting the SD card. The Issue remains the same.
Does anyone else have this issue or any ideas?
If you're connected to PC as MTP mode, try to switch to camera transfer mode..
Maybe this will help?
External and internal sdcard mount points
After some more investigating I have discovered that what is displayed as /sdcard/ is in fact the phones internal flash memory and the actual SD card is mounted as something else.
There you have 2 folders in /mnt
/mnt/sdcard >> taht is the internal flash storage
/mnt/sdextcard >> that is the inserted sd card
http://mono-for-android.1047100.n5.nabble.com/detect-SD-Card-path-td5710218.html
This explains why I could see the files i copied to my sd card on my phone as my phone wont enable me to see the actual external SD card.
Was surprised I couldn't find an actual thread about this on the forum.
I can see that creating a mount point for called SDCARD within the internal memory will allow apps that default large content files to use this space without complaining but this means that although Samsung allow SD cards to be inserted they cannot be used with a standard set up?
So is there any way for me to get to this other mount point without root access?
I thought, for a change, I might hold off rooting my phone but this might spur me on...
Afaik Android does not have a concept of "internal" SD card. (Which is the or at least a reason why most phones have a separate data partition)
However when phone manufacturer's started offering internal storage capacity for normal files, they just used the sdcard.
The name of the external sdcard varies from phone to phone and manufacturer.
I can remember that the name of the external sd card on my S1 was /sdcard/external_sd/ (no /mnt as with the S3 !)
On current Cyanogenmod for the S1 it's /mnt/emmc/ which seems to be introduced as some sort of "standard".
This variety in naming shemes and the possibility of a phone not having internal SD-card storage, only having internal SD-card storage or having both _SHOULD_ make app developers give you the option where to store it.
If it doesn't it's a restriction in the app, not the sdcard.
Solution[/b[
If you are rooted you can easily bypass these restrictions with a simple trick. Make sure the app is terminated before attempting this!
Go to the terminal emulator and type:
Code:
su
mkdir /mnt/sdcardext/APPFOLDER
cp -rvf /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
mount -o bind /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
You've now told Android to re-route all filesystem access'es transparently to the external SDcard while the app still believes it's on the internal one.
Note that you'll have to run the following after every boot (or have it run as auto-start) since mount's are not persistant.
Code:
su
mount -o bind /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
Thank you for the explanation on this d4fseeker. Really all I wanted to do at this time was be able to access the external SD or point to it as a content location. But I will bookmark the solution for forcing apps to use it.
No I know what I know I have rooted my phone, curtesy of Chainfires guide here and can now see the extSDCard directory
houseofcutler said:
I am using ES File Explorer
I have tried rebooting the phone and also (after you said) mounting and unmounting the SD card. The Issue remains the same.
Does anyone else have this issue or any ideas?
Click to expand...
Click to collapse
In ES file explorer, you can go to your external SDcard by open Menu (left capacitive button), then select Manager and then SD card Analyst.
it will show /sdcard,,, it means internal SDcard. You have to touch "Disks" icon (the second from the left), then select /mnt/extSdCard. Eventually you can browse your external SD.
I don't know if there is the easier way. Or you can use the stock explorer app "My files", it is easier to browse the external card but with less function than 3rd party app.
That does work thanks - Turns out I purchased Root Explorer a while back so I have installed that and set the home directory to be the external SD mount point. Still need ES though for when I am copying across my network
jackie_jerk said:
In ES file explorer, you can go to your external SDcard by open Menu (left capacitive button), then select Manager and then SD card Analyst.
it will show /sdcard,,, it means internal SDcard. You have to touch "Disks" icon (the second from the left), then select /mnt/extSdCard. Eventually you can browse your external SD.
I don't know if there is the easier way. Or you can use the stock explorer app "My files", it is easier to browse the external card but with less function than 3rd party app.
Click to expand...
Click to collapse
I have quite the same problem but another way around. I can see all the (music)files in the phone but when I connect the phone via USB to my PC I can only see a few (about 30) of the files in the folder. I have booted the PC and the phone, took the SDcard also out and in. Also when I insert the SDCard to the PC's cardreader I can see all the files, so I quess the problem is in the phone. Any ideas how to solve this?
Not sure what your issue is but my advise is to confirm you a definitely looking at what you think you are - that was my problem before.
For example when the Phone is connected to your PC:
Create a text file called phone.txt in the 'Phone' Directory
Create one called card.txt in the 'Card' directory
Then use the built in 'my files' browser or whatever app you use to see if the files are where you think they are.
Might help...
d4fseeker said:
Afaik Android does not have a concept of "internal" SD card. (Which is the or at least a reason why most phones have a separate data partition)
However when phone manufacturer's started offering internal storage capacity for normal files, they just used the sdcard.
The name of the external sdcard varies from phone to phone and manufacturer.
I can remember that the name of the external sd card on my S1 was /sdcard/external_sd/ (no /mnt as with the S3 !)
On current Cyanogenmod for the S1 it's /mnt/emmc/ which seems to be introduced as some sort of "standard".
This variety in naming shemes and the possibility of a phone not having internal SD-card storage, only having internal SD-card storage or having both _SHOULD_ make app developers give you the option where to store it.
If it doesn't it's a restriction in the app, not the sdcard.
Solution[/b[
If you are rooted you can easily bypass these restrictions with a simple trick. Make sure the app is terminated before attempting this!
Go to the terminal emulator and type:
Code:
su
mkdir /mnt/sdcardext/APPFOLDER
cp -rvf /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
mount -o bind /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
You've now told Android to re-route all filesystem access'es transparently to the external SDcard while the app still believes it's on the internal one.
Note that you'll have to run the following after every boot (or have it run as auto-start) since mount's are not persistant.
Code:
su
mount -o bind /mnt/sdcard/APPFOLDER /mnt/sdcardext/APPFOLDER
Click to expand...
Click to collapse
But doesn't this simply relocate 100% of APPFOLDER to the microSD card and still leave no option to have Apps in both flash locations? Or will programs like App 2 SD somehow now be able to relocate apps back to the internal flash partition (aka "internal sdcard")?
Ah, nevermind. "APPFOLDER" is a single application's appfolder, not a directory with all the apps. So this should be something an app could do on any rooted S3 with a nice gui and persistence through some service mod in init.d or whatever Android uses in its place, yes?
Ok, was just digging around in /mnt/sdcard and while a few apps have obvious directories there, most do not. What's more, being an android noob, I'm not sure where their directories would be located (app manager doesn't say either).
Anyone care to point me in the right direction? Also, is there a way to install some other standard linux shell commands like more and grep?
Thanks.
Sent from my GT-I9300 using XDA

Thanks to JB's Freaking Portable Media Player Mode I Lost My SD Card!

Why did Jelly Bean have to remove the USB Mounting???
Today I connected my HTC to the PC and was deleting a folder in the SD Card had to access it via the freaking Portable Devices > SD Card and it was taking too long to delete a folder with an mp3 file. I cancelled it and restarted my phone to recovery to do a flashing.. Before flashing it I mounted the SD Card and went to the file manager only to know that my card has been wiped clean!
Used Recuva to recover some files but most of them is lost!
Then the strangest thing happened, I was recovering the files from recovery after mounting the USB drive. After rebooting back > Browsing to the SD Card via portable media I could see that the I had all the files intact.. Then after going back to the SD Card Root and refreshing, The folders were disappearing until I was left with the WhatsApp folder and some other folders (I guess whatsapp was running hence the folder didn't get deleted).
Can anyone explain what had happened and is there any way to get back the files?
Thanks
Sent from my HTC Desire X
In all seriousness the data probably became corrupt when you removed It midway through doing something, check lost.dir on your Sdcard it will probably be full of un-openable files (there is way to get your data from this files)
Next time try using a SDcard reader
Sent from my HTC Desire X
BatEarsJoe said:
In all seriousness the data probably became corrupt when you removed It midway through doing something, check lost.dir on your Sdcard it will probably be full of un-openable files (there is way to get your data from this files)
Next time try using a SDcard reader
Sent from my HTC Desire X
Click to expand...
Click to collapse
I didn't remove the SD Card, Just cancelled the deletion operation and I did check the Lost.dir folder, It is empty.
Droid.Anoop said:
I didn't remove the SD Card, Just cancelled the deletion operation and I did check the Lost.dir folder, It is empty.
Click to expand...
Click to collapse
You cancelled an operation and directly unmounted the storage, that did corrupt the data.
If you want UMS mount SD in recovery
GtrCraft said:
You cancelled an operation and directly unmounted the storage, that did corrupt the data.
If you want UMS mount SD in recovery
Click to expand...
Click to collapse
I don't understand. How does cancelling a deletion operation corrupt the data? I didn't pull out the chord in middle of an operation or anything like that.
I cancelled the operation and did some other tasks on my PC and later unplugged the chord and booted to recovery.
Anyways I have recovered some data with Recuva and now while I was at it, Did a full wipe (including SD Card) and reinstalled the ROM.
@prototype-U and other kernel developers! Can you add UMS support to the kernel soon?
ReSkid said:
I don't understand. How does cancelling a deletion operation corrupt the data? I didn't pull out the chord in middle of an operation or anything like that.
I cancelled the operation and did some other tasks on my PC and later unplugged the chord and booted to recovery.
Anyways I have recovered some data with Recuva and now while I was at it, Did a full wipe (including SD Card) and reinstalled the ROM.
@prototype-U and other kernel developers! Can you add UMS support to the kernel soon?
Click to expand...
Click to collapse
It needs more than just a kernel modification imo
prototype-U said:
It needs more than just a kernel modification imo
Click to expand...
Click to collapse
i suppose it would be easier in aosp rather then sense. But still very difficult. Will look into c8813 sources coz it has MTP/Camera/UMS all three modes.

[Q] Use /storage/external_SD instead of /storage/sdcard0

I have a LG Optimus L3 II, and since it has less than 2 GB of total ROM, I have bought an external SD card. I have some experience with Linux desktop systems, but not really with Android. On a Linux desktop, if I lack disk space, I can mount /home to the device I want using /etc/fstab, so all my personal files are transparently saved to the specified device.
I have noticed that my user files on the LG Optimus are all saved to /storage/sdcard0. Also, that there is a symlink from /sdcard to /storage/sdcard0.
What I would like to accomplish is to transparently have all my personal files on /storage/external_SD, but I'm not sure if I can just change /sdcard to point to the new location, or if I would need to change mount points somewhere, etc. I have searched on Google about this, but found nothing clear, and it seems this may vary from device to device. Also, I haven't tried anything yet, because I don't really think I would be able to recover if anything goes bad.
Thanks for your attention!
teresaejunior said:
I have a LG Optimus L3 II, and since it has less than 2 GB of total ROM, I have bought an external SD card. I have some experience with Linux desktop systems, but not really with Android. On a Linux desktop, if I lack disk space, I can mount /home to the device I want using /etc/fstab, so all my personal files are transparently saved to the specified device.
I have noticed that my user files on the LG Optimus are all saved to /storage/sdcard0. Also, that there is a symlink from /sdcard to /storage/sdcard0.
What I would like to accomplish is to transparently have all my personal files on /storage/external_SD, but I'm not sure if I can just change /sdcard to point to the new location, or if I would need to change mount points somewhere, etc. I have searched on Google about this, but found nothing clear, and it seems this may vary from device to device. Also, I haven't tried anything yet, because I don't really think I would be able to recover if anything goes bad.
Thanks for your attention!
Click to expand...
Click to collapse
You can't just replace /sdcard to point to a new location, as Android is always expected to run from the internal storage, and this can cause mayhem. Now, the first question you should answer to yourself is what you mean when you say "personal files": if you just need to store songs, pictures, movies etc., you can store them on the external SD without any issues.
However, the main problem with Android in this aspect is the applications (apps and their data). The best thing would be if you could natively install them on the SD. But this is not always possible, since SD cards are usually formatted with non native Linux file systems (such as FAT) ,in order for them to be mounted on Windows, meaning that they lack the infrastructure to run apps from within (like file permissions or symlinks).
Solution here is the following: Format your SD card to be either all or partially of an ext3/4 file system type (so it can at least hold all apps and their data), then install the Link2SD app, which moves the application to this SD partition and creates all links from the internal drive to this partition. The paid version of this app (Link2SD+, which costs $1) allows you to link also the application data to the SD card (not only the app itself). I have used this solution on many low end devices I had in the past (like yours basically), and it solved this issue perfectly.
Digdis said:
You can't just replace /sdcard to point to a new location, as Android is always expected to run from the internal storage, and this can cause mayhem. Now, the first question you should answer to yourself is what you mean when you say "personal files": if you just need to store songs, pictures, movies etc., you can store them on the external SD without any issues.
However, the main problem with Android in this aspect is the applications (apps and their data). The best thing would be if you could natively install them on the SD. But this is not always possible, since SD cards are usually formatted with non native Linux file systems (such as FAT) ,in order for them to be mounted on Windows, meaning that they lack the infrastructure to run apps from within (like file permissions or symlinks).
Solution here is the following: Format your SD card to be either all or partially of an ext3/4 file system type (so it can at least hold all apps and their data), then install the Link2SD app, which moves the application to this SD partition and creates all links from the internal drive to this partition. The paid version of this app (Link2SD+, which costs $1) allows you to link also the application data to the SD card (not only the app itself). I have used this solution on many low end devices I had in the past (like yours basically), and it solved this issue perfectly.
Click to expand...
Click to collapse
Thanks for your answer, Digdis! What I'm really looking for is not to have applications installed on the external SD card, since 2GB is more than enough for applications for me. What I really want is to have stuff that generally goes to /storage/sdcard0 in /storage/external_SD, because this is where my personal files and settings goes to. For example, if I download something, no matter what size, or record videos, I would expect them all to go directly to the SD card. I know a few applications, not all, can be directly configured to use the external card, but it would be a rather unintelligent way, unless Google has decided to throw basic Linux design out of the window.
Also, what you are telling me is that applications will fail to run if Android/data/ is on an external SD card? Because if I just install applications on SD card, it won't really solve my problem, because I have few applications installed, but data on /storage/sdcard0 tends to grow a lot.
teresaejunior said:
Thanks for your answer, Digdis! What I'm really looking for is not to have applications installed on the external SD card, since 2GB is more than enough for applications for me. What I really want is to have stuff that generally goes to /storage/sdcard0 in /storage/external_SD, because this is where my personal files and settings goes to. For example, if I download something, no matter what size, or record videos, I would expect them all to go directly to the SD card. I know a few applications, not all, can be directly configured to use the external card, but it would be a rather unintelligent way, unless Google has decided to throw basic Linux design out of the window.
Also, what you are telling me is that applications will fail to run if Android/data/ is on an external SD card? Because if I just install applications on SD card, it won't really solve my problem, because I have few applications installed, but data on /storage/sdcard0 tends to grow a lot.
Click to expand...
Click to collapse
OK understood. First of all 2GB seems a bit low for both ROM and apps, but if you say it works for you...
Now, regarding automatic download of pics etc. to SD. You can try Xposed module Downloads2SD . Didn't try it, but you can give it a try.
You can actually do that by telling the system to mount them differently but LG handles that by initiation not fstab. I can try and help you.
Didn't explain it very well. Mount the External SD as sdcard0 and sdcard0 as External_sd so the phone will safe on sdcard0 which we just made the external_SD. There can be problems with pictures recognition or music stuff like that but it should work.
Thanks a lot, @Digdis, I'll keep everything you said for reference.
@christi9503 OK, please, let's try it!
teresaejunior said:
Thanks a lot, @Digdis, I'll keep everything you said for reference.
@christi9503 OK, please, let's try it!
Click to expand...
Click to collapse
Are you rooted with a custom recovery? We need root for this and also you need to give me some files.
christi9503 said:
Are you rooted with a custom recovery? We need root for this and also you need to give me some files.
Click to expand...
Click to collapse
Yes, it is rooted, but what do you mean with "a custom recovery"?
teresaejunior said:
Yes, it is rooted, but what do you mean with "a custom recovery"?
Click to expand...
Click to collapse
CloworkMod(CWM) or TWRP recovery. So you can flash flashable zip.
christi9503 said:
CloworkMod(CWM) or TWRP recovery. So you can flash flashable zip.
Click to expand...
Click to collapse
Are both supported on this device?
teresaejunior said:
Are both supported on this device?
Click to expand...
Click to collapse
Search around the forum a guy around ported all from what I know. Anyway install one of the recoveries to get ready.
What I want you to do now is this:
Check in storage path (with a root explorer) what folder you have like sdcard0, external_sd etc. Tell me all and what is the address (where it links)
EX: sdcard0 -> internal storage.
Also go in system/etc/ and copy me with a root explorer to sd card and then upload it on forums this file : init.qcom.post_boot.sh
christi9503 said:
Search around the forum a guy around ported all from what I know. Anyway install one of the recoveries to get ready.
What I want you to do now is this:
Check in storage path (with a root explorer) what folder you have like sdcard0, external_sd etc. Tell me all and what is the address (where it links)
EX: sdcard0 -> internal storage.
Also go in system/etc/ and copy me with a root explorer to sd card and then upload it on forums this file : init.qcom.post_boot.sh
Click to expand...
Click to collapse
Installing will probably take me some time, because Android is refusing to install anything now saying I don't have enough free space (although I have 199MB, but maybe it thinks is too little). The information you have requested I have already:
There is /sdcard/, which is just a symlink to /storage/sdcard0/.
/storage/sdcard0, which is the internal memory, is mounted like:
Code:
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
And there is also /storage/external_SD/, which is mounted like:
Code:
/dev/block/vold/179:33 /storage/external_SD vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
init.qcom.post_boot.sh is attached.
teresaejunior said:
Installing will probably take me some time, because Android is refusing to install anything now saying I don't have enough free space (although I have 199MB, but maybe it thinks is too little). The information you have requested I have already:
Click to expand...
Click to collapse
This is why I urged you to start moving apps to the SD card. Android will refuse to install anything on your internal memory unless you have at least 10% free space.
teresaejunior said:
Installing will probably take me some time, because Android is refusing to install anything now saying I don't have enough free space (although I have 199MB, but maybe it thinks is too little). The information you have requested I have already:
There is /sdcard/, which is just a symlink to /storage/sdcard0/.
/storage/sdcard0, which is the internal memory, is mounted like:
Code:
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
And there is also /storage/external_SD/, which is mounted like:
Code:
/dev/block/vold/179:33 /storage/external_SD vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
init.qcom.post_boot.sh is attached.
Click to expand...
Click to collapse
Well install recovery by adb with dd (in shell).
---------- Post added at 06:43 PM ---------- Previous post was at 06:31 PM ----------
@teresaejunior
Under /mnt (on the root I think) you will have some folder like sdcard, external_SD etc inside that folder. Tell me what folders are there and the one that gets you in internal and the one that gets you in external pls.
CWM is installed!
In /mnt there are:
Code:
asec
obb
sdcard -> /storage/sdcard0
secure
teresaejunior said:
CWM is installed!
In /mnt there are:
Code:
asec
obb
sdcard -> /storage/sdcard0
secure
Click to expand...
Click to collapse
Ok gonna give you a flashable zip in a second that will replace your post boot script. If it goes into bootloop we got a backup don't worry.
teresaejunior said:
CWM is installed!
In /mnt there are:
Code:
asec
obb
sdcard -> /storage/sdcard0
secure
Click to expand...
Click to collapse
Flash this and tell me if they are swapped. Through CWM.
View attachment SwapL32.zip
christi9503 said:
Flash this and tell me if they are swapped. Through CWM.
View attachment 3082829
Click to expand...
Click to collapse
I think it swapped, but now many applications are crashing or failing to open files. I copied all files from sdcard0 to external_SD and rebooted, but it still doesn't seem to help. Maybe I should have formatted the external SD to ext*?
teresaejunior said:
I think it swapped, but now many applications are crashing or failing to open files. I copied all files from sdcard0 to external_SD and rebooted, but it still doesn't seem to help. Maybe I should have formatted the external SD to ext*?
Click to expand...
Click to collapse
Nope you do not need to format it in order to work. Just make a clean install and use this swap. Maybe you copied them wrong. If the swap worked all is fine my friend.
christi9503 said:
Nope you do not need to format it in order to work. Just make a clean install and use this swap. Maybe you copied them wrong. If the swap worked all is fine my friend.
Click to expand...
Click to collapse
OK, thank you so much, now _this is_ going to take a good time!

[HOWTO] Use external SD card as internal storage in KitKat

Beware, this guide is more or less untested, it will interfere with stuff like memory encryption and OTA or other firmware updates. You have been warned, I assume no warranties for bricked phones, SD cards or lost data.
Many cheap-ass Mediatek phones ship with Android 4.4.2 or later and only ridiculous amounts of internal storage (2GB in my case, CAT B15Q). That may be enough for basic apps, but as soon as you install Navigon or other data-heavy apps (or WhatsApp with a load of videos) you're going to run out of space in no time - and because Google is a bunch of fools, they disallowed app installations to SD cards entirely in 4.4!
So, we're going to move /data in its entirety to our nice huge SD card and be able to use even bigger apps on small phones. It might be possible that this guide works on other phones, but that depends on how they boot and where the fstab and init.rc reside!
Prerequisites:
Mediatek-based 4.4.2 or later phone with root access in recovery (boot it in recovery, run adb shell, therein run id. If it says root, all fine. If not, install CWM)
A large enough SD card (I chose a 32GB card with a 50:50 split between /data and the "external sd card")
Solid Linux knowledge, one Linux PC and one Windows PCs. I urge you to NOT use any kind of VM unless you have experience with USB passthrough.
spFlashTool and the Mediatek drivers from http://forum.xda-developers.com/general/general/stock-rom-cat-b15q-rom-development-t2988774, for a flashing guide see http://forum.xda-developers.com/android/help/howto-firmware-flashing-cat-b15q-t2989627
mtkdroidtools from https://www.androidfilehost.com/?fid=23501681358558543 on the Windows PC
mtk-tools from https://github.com/bgcngm/mtk-tools on the Linux PC (no, Cygwin does not work, it messes up the permission bits), cloned on an ext4 partition (not sure if ext2/3 can handle the extended permission bits...)
a network connection between the PCs or a USB stick to transfer files
Take the sd card out of the phone and insert it into your computer. Many laptop SD slots don't like SDXC (>4GB), you might need e.g. a Huawei 3G stick or a SDXC-compatible USB dongle.
Repartition the SD card using Acronis Disk Director, gparted or whatever you're familiar with. The first partition must only be resized (this is the FAT partition), the second partition is a ext4 (!) partition. Both MUST be primary partitions. Acronis and other tools on Windows might require a reboot to repartition SD cards. I recommend a 50:50% split, but if you're heavy on apps or their data, you might go for a 25% FAT: 75% EXT4 split.
Boot your phone into recovery, connect to it with adb in a root shell.
Assuming your data partition is at /dev/mmcblk0p8 (look in /fstab to find it out, followed by mount /data and ls /data to verify), execute the command "dd if=/dev/mmcblk0p8 of=/dev/mmcblk1p2", wait until it is finished. This can take up to ten minutes or more, depending how much data there is.
Shut down the phone, take out battery and SD card.
Insert the SD card into your Linux machine, run resize2fs /dev/sdb2 (or wherever the ext4 sd card partition ended up, check it in dmesg) as root so that the filesystem grows; then eject the SD card and put it back into your phone
Readback your BOOTIMG partition, transfer it to the linux PC (or, if you already have a boot.img for your current firmware, use this one)
On the Linux PC, open a rootshell (to avoid permission issues when building the ramdisk).
Run "./unpack-MTK.pl /path/to/bootimg"
"cd boot.img-ramdisk" (directory might be named different, depending on how you named the bootimg dump file)
Using a text editor, edit the "fstab" file(s) (there might be multiple, with suffixes): From (adjust if needed)
Code:
/[email protected] /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
to:
Code:
/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
Now, edit the init.rc file (beware, other .rc files in the ramdisk root might also contain mount commands!).
Search for "on fs_property:ro.mount.fs=EXT4" and again replace /[email protected] (or whatever the node for /data had been) with /dev/block/mmcblk1p2 in the commands in this block (should be fsck, tune2fs,ext4_resize and mount).
Repack the boot image: ./repack-MTK.pl -boot boot.img-kernel.img boot.img-ramdisk/ /path/to/newboot.img
Transfer newboot.img to the Windows PC and flash it using spFlashTool
boot your phone, look in Settings->Memory to see if it went OK!
If the memory view didn't change, also modify the other blocks of on fs_property, in case your device does not use an ext4 rootfs (but yaffs or ubifs instead).
Functionality
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
e.ahmedmahfouz said:
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
Click to expand...
Click to collapse
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
harddisk_wp said:
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
Click to expand...
Click to collapse
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
madthinker said:
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
Click to expand...
Click to collapse
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
harddisk_wp said:
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
Click to expand...
Click to collapse
i see, thanks to explain me :good:
There is another way to get more space: Link2SD (2.- euros) with a second partition on your external SD-card exactly like shown above (ext4 partition, primary).
The advantage is, that if the sdcard is faulty the system still runs, just the apps which are symlinked to the ext4 partition won't run.
So I use this for all these not absolutely important apps which needs lots of internal memory, e.g. kindle bookreader, Amazon, WhatsApp etc. I dont use it for all apps, most importantly not for any app, where there is no alternative. Last week my two years old 64 GB MicroSD card (SanDisk, with warranty 10 years) in my SGS4 stopped working and this could happen all the time. They are not that reliable I think, that I would put my system on it.
I did this now with the Cat B15Q of my friend.
EDIT: and she has now more than 1 GB free internal space
I think this is the best solution, 2 GB for the pure ROM and the system apps is more than enough and all user apps go to the external sd-card (2nd partition).
good day!
hope you can help me.
what if i want vice versa? because my phone's default storage (0) is sd card.and i want my default storage will be its internal since it is 32gb rom. tried all ways but i think the answer is its boot.img. thank you..hoping for a help

system data in my sdcard take a huge size (fix)

Today i notice that i can't save anymore in my sdcard.i Check my sdcard using diskusage application,i saw that 20 GB of my sdcard space is taken by system data.
What this? And how can i delete this ??
Don't worry,i fix it.
I connect the sd card to my pc,and i saw one hidden folder which not showing in any file browser in my phone even if i enable the hidden folders ( strange)
The name of this folder is : Found.000 which have 19.8 GB in size.
I delete it and everything is back to normal again
did it happen again? the point is to find why does this happen and
I have the same issue when I delete large files or folders,
they are moved in system data,
I haven't found the culprit yet
It's windows "fault".
You can read more here https://www.howtogeek.com/282798/what-are-the-found000-folder-and-file0000chk-file-in-windows/
ok but why does Android move to system data instead of delete?
patrickdrd said:
did it happen again? the point is to find why does this happen and
I have the same issue when I delete large files or folders,
they are moved in system data,
I haven't found the culprit yet
Click to expand...
Click to collapse
Have you solved anyway?
I have the same problem, no hidden folder found.
I had to backup my data on PC and then format it.
I formatted my card as exfat, it was the only way my files would delete immediately
patrickdrd said:
I formatted my card as exfat, it was the only way my files would delete immediately
Click to expand...
Click to collapse
my card is formatted as exfat yet, what filesystem have you used before?
tapioco2000 said:
my card is formatted as exfat yet, what filesystem have you used before?
Click to expand...
Click to collapse
the one android uses (at least my nougat used that)
when you select format option from the settings menu,
i.e. fat32
same problem in internal memory
Hello, I have the same problem but in internal memory.
Any idea to solve in this case?
Many thanks

Categories

Resources