How to recover /sdcard - Xiaomi Mi 9 Questions & Answers

I used to flash the Mokee ROM, but some applications crash, so I decided to re-flash ROM, when I cleared the data, cache, dalvik in recovery, I found that the file names in /sdcard all became garbled. /root /data and other directory files are fine.
Now I have used the USB disk to flash new ROM, but /sdcard still can't write or even copy the file from the sd card.
I know that formatting with a computer can be recovered, but I want to restore the original files and photos as much as possible. Do you have any idea?

I don't know how to add photos to the post, so I uploaded it to my Twitter. I hope there is no violation of the regulations : )
twitter.com/953949233/status/1156925100047794176

Related

storage problem

Hay.
how i can format my nexus one or clear its all earlier data . I also have 8gb sd card
waiting for reply. Thanks
Uh... do you mean a factory reset cause that is pretty easy just go to settings -> privacy -> factory reset this will wipe everything from your internal storage except the ROM and updates so you will stay on the same version that you are running now. This will not delete anything on the SD card so if you want to do that just put it in your computer and format it from there.
storage
Hay
can u more define.
is factory rest bracke my root
If by that you mean will it unroot you, then no you will stay rooted even if you factory reset.
There are two different main partitions in the phone (for partitions, think different drives under windows). The first being the /system partition. Everything in the /system partition is readable only. You are not able to modify anything in there (with a standard setup... we will delve a bit into this later). The other partition is the /data partition, which is read/write. This is where every app that you install is located (with a few exceptions which I will note below). When you do a factory reset/data wipe, it will just wipe out that /data partition so all your apps and data are gone (including any system settings.
The exception to the rules are for rooting, and certain flashable zips that put apps in the /system partition (like the google apps zip if you are running a custom ROM). So when you rooted, it put everything required for root into the /system partition (by changing it to read/write using root permissions). So if you do the factory reset, it will wipe the /data directory along with the .android_secure folder on the root of the sdcard (which is where all your apps are stored when you store apps on the sdcard).
Since the factory reset doesn't include the /system partition (otherwise you would be left without an OS to boot into), your root will remain, and otherwise, it will be just like it was when you first started up the phone.
If you want to remove root, you will have to flash a ROM (most likely a stock Android version) that doesn't include root/superuser permissions.

Files in storage disappears after a rom install. 21GB used and I can't find it.

I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
tevinwade said:
I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
Click to expand...
Click to collapse
As stated on mikes page it was highly recommended to format your sd before installation of 4.2.2... Because android 4.2.2 handles files differently from 4.1. Not HTC s doing I believe(correct if wrong)
tevinwade said:
I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
Click to expand...
Click to collapse
Try data/media/
If it's not there then download DiskUsage and see if it helps you find it. https://play.google.com/store/apps/details?id=com.google.android.diskusage
Sent from my HTC One using xda premium
BEFORE RUNNING THE ADB METHOD IN THIS WEBSITE, MAKE SURE YOU ARE IN RECOVERY AND MAKE SURE THAT ADB IS WORKING. DO NOT RUN THESE COMMANDS MORE THAN ONCE OR YOU WILL WIPE YOUR ENTIRE SDCARD. BACK UP ALL YOUR DATA AND MAKE SURE THAT YOU HAVE ALL YOUR CRITICAL DATA OFF THE PHONE OR YOU WILL REGRET IT WHEN YOU WIPE OUT PRECIOUS MEMORIES AND DATA.
http://trickdroid.org/trickdroid-6-0-android-4-2-2-and-your-sd-card/
Use the ADB method. it will move everything.
I case anyone has the same problem. It was in data/media as redbull123 stated. It appears as if Astro File Manager doesn't display the files in the folder while ES File Explorer does.

[Q] can't take photos + read/write error

rooted, stock lollipop 5.0.2, problem started out of nowhere this afternoon...
camera won't let me take photos as it asks for an SD card. even after i insert an SD card, the error persists.
opening quickpic gives me the following errors...
Code:
not an error (code 0) could not open the database in read / write mode
Code:
unable to open database file (code 14)
can't delete ANY files manually in ES file explorer even with root explorer enabled.
booted into TWRP and cleared cache and dalvik to no avail.
seems like the phone can't read or write any data, except installing/uninstalling apps via google play still works. seems to be the same problem addressed in this thread http://forum.xda-developers.com/galaxy-s2/help/read-write-errors-advice-solved-t2323801 although i don't know how to identify the corrupt file(s) and delete them or fix permissions...
help!!
...bump?
basically wen that happens is because a file or folder is corrupted, it maybe in any place on your phone really difficult to find. That usually happens after you flash some (app, script), restore a TWRP backup, or a app that have root access doing the wrong thing.
i had this problem two times.
In the 1°, i fix by going in the TWRP, and erased my internal memory, after reboot all good.
this case was very simple i copy every file to pc, erase, after restore the one i need, and everything was fine...
In the 2°, i try that and was not successful, i need to re install the stock rom via fastboot from xml rom file to completed clean my OS.
In both cases, i was not able to make a Titaniumbackup, so i lost some data of a fill apps in the second (because i make a backup every week, if i didn't have it i probably lost everything).
If you don't use titanium, and don't wanna to loose things and app files etc, you can try copy everything on internal and external memory, by plugin on the device to a PC, after a TWRP backup of yours data, after wipe, dalvik cache, data, internal storage, cache, system, re flash the same rom you are now, and after test and see if you can write, restore the data backup.
But that data may corrupted your phone again, because the problem maybe in that.
So if after restore the data all goes bad, redo everything and do not restore data, you will lose app and data, but app can be reinstated.
:good:
baybutcher27 said:
basically wen that happens is because a file or folder is corrupted, it maybe in any place on your phone really difficult to find. That usually happens after you flash some (app, script), restore a TWRP backup, or a app that have root access doing the wrong thing.
Click to expand...
Click to collapse
thank you, i used this as an opportunity to wipe and flash cyanogen. so far so good (seems much smoother too).

Please help me. Tried to change /data file system and wiped all my files...

I'm panicking very much right now.
I did a big, big stupid and accidentally wiped my entire /data partition, including /sdcard (!!) in TWRP 3.0.4.1 while attempting to change the filesystem of my /data partition from F2FS to EXT4. I did a full backup of my phone, including /data partition (but excluding /data/media/0/ which is the location for /sdcard of course) on my phone prior to attempting to change the filesystem.
I didn't think that this would also wipe /sdcard, and ALL MY FILES INCLUDING MY BACKUP...
I'm frantically searching through Google as we speak for guides to clone these formatted sectors over USB (I'd imagine using ADB shell) to a PC and use Windows file or partition recovery tools to try and save every, if not most files.
Please lend me your knowledge and links to fixing this issue, Android community. <3
In older Android versions the /sdcard partition was it's own partition, which is why I didn't think of copying all my files over to a PC before making changes to /data.
well, when you wipe data from any partition in twrp it sort of resets all space to be overwritten. The data that is marked for overwrite doesn't remain when you full wipe. Since you changed the file system, the data was removed and overwritten by the wipe with blank space.... i hope you had at least some of it backed up on your pc. I never use those apps personally, i always hard backup all my things with a drag and drop onto my pc. I highly recommend it, saves you a disaster. Im very sorry.... i hope you didnt lose anything really important.
OcazPrime said:
well, when you wipe data from any partition in twrp it sort of resets all space to be overwritten. The data that is marked for overwrite doesn't remain when you full wipe. Since you changed the file system, the data was removed and overwritten by the wipe with blank space.... i hope you had at least some of it backed up on your pc. I never use those apps personally, i always hard backup all my things with a drag and drop onto my pc. I highly recommend it, saves you a disaster. Im very sorry.... i hope you didnt lose anything really important.
Click to expand...
Click to collapse
Heh, that's exactly what happened. I'm gonna attempt this guide: https://forum.xda-developers.com/ga...de-internal-memory-data-recovery-yes-t1994705
Basically try to use "dd" to make a RAW copy of "dev/block/dm-0" which according to the mount command I ran in TWRP's terminal shell, is what block /data is used on OnePlus 3T (OOS 4.1.3).
Wish me luck.

Is it possible to mount data partition on PC or USB to recover data

Is it possible to mount data partition on PC or USB to recover data?
Edit: I meant userdata partition
I have tried backing up data partition using TWRP, but it prompted me that pictures and downloads will not be backed-up!
Isn't the data partition that holds my camera and download folder?
I am looking for a tool or and app that can let me take a disk image of internal SD partition, or create a whole image of my phone; so that I can use data recovery in my PC.
Making Dump Files Out of Android Device Partitions
have u try this
Thanks I have tried it but when I execute
Code:
noblelte:/ # dd if=/dev/block/sda17 of=/sda17.img
Gives me
Code:
dd: /sda17.img: Read-only file system
Just to be sure : I ran the adb code while the phone is on normally not in TWRP.
I also ran the code in TWRP terminal, while connecting a USB and mounting it.
It created the image inside the USB , however it stopped at 4GB saying the file is too large.
SilverDove said:
I also ran the code in TWRP terminal, while connecting a USB and mounting it.
It created the image inside the USB , however it stopped at 4GB saying the file is too large.
Click to expand...
Click to collapse
Are you just wanting to back up pictures, download folder, etc etc? Backing up the data partition the way you are is pointless as you're just accomplishing what twrp already does. Data partition is apps, system configurations, texts, calls, etc. Not pictures you've taking, download folder, etc.
And is there a reason you want an img file? Seems pointless to me when you can just copy it all over by drag and drop or adb pull the internal storage lol
I want to make a userdata partition image because it holds the camera album I deleted by mistake. I want to take the image and try to recover the deleted files using PC recovery software.
I found out that my problem was the 4GB limit of FAT32, so I formatted my USB flash memory using both exFat and ext4 and recovered the partition using TWRP terminal with the code above.
However I am still unable to read the image through Linux Reader and I can't attach the image as VHD.
Is what I am doing is useless? Because it came to my mind that if the recovered userdata partition is encrypted I will not be able to opened it, however, TWRP can browse the files so I guess it is not encrypted.
SilverDove said:
I want to make a userdata partition image because it holds the camera album I deleted by mistake. I want to take the image and try to recover the deleted files using PC recovery software.
I found out that my problem was the 4GB limit of FAT32, so I formatted my USB flash memory using both exFat and ext4 and recovered the partition using TWRP terminal with the code above.
However I am still unable to read the image through Linux Reader and I can't attach the image as VHD.
Is what I am doing is useless? Because it came to my mind that if the recovered userdata partition is encrypted I will not be able to opened it, however, TWRP can browse the files so I guess it is not encrypted.
Click to expand...
Click to collapse
You may need to convert the file type of the img using simg2img, make_ext4fs, etc
You can see what the file system type of the img you have by running:
file blahblah.img
But still don't think you're going to recover them but possibly lol never tried as I sync everything to a cloud
SilverDove said:
Is it possible to mount data partition on PC or USB to recover data?
Edit: I meant userdata partition
Click to expand...
Click to collapse
For backing up app data, I'm more of a Titanium Backup person myself and for backing up partitions I generally prefer TWRP, but there are also apps for backing up all the different partitions as well. This is just one. Never tried it, but Wanam is a much trusted developer in the XDA community for Samsung devices.
https://play.google.com/store/apps/details?id=ma.wanam.partitions
NOTE: You can always save these backups to a USB OTG device if you need to as well. That's what I do with my Titanium Backup app data files and the information is with me all the time hanging on my key chain.(More info about that under "No SD Card Slot" on this post HERE.) This information can of course always be copied to a PC too.

Categories

Resources