Hello
I'm looking for some help on repairing a broken filesystem on a sdcard. There is a popular issue with the Redmi Note 8T that is corrupting the filesystem when copying a lot of files to the sdcard. Technical details and questions below.
The sdcard is a 128GB Sandisk Extereme card. It's encrypted (used as Adoptable Storage), the phone has still the decryption key, so when I insert the card it shows files and directories. Before the crash there was around 100GB of data on the sdcard. Now it has only 2,8GB of used storage (for most of the time - explenation below).
I've made a dd copy of the card and copied it to a larger 256GB card and a 512GB pendrive. Both starages connected to the phone (over usb, microcard reader) are giving the same result - the files and directories are decrypted, but the filesystem is corrupted. When I insert the sdcard into the phone and check the capacity, it shows that there is -6126312313/128GB of used space. After couple of minutes, the number changes to ~100GB/128GB or to 2,8GB/128GB (which is 95% of times).
Actually only one directory is corrupted the "Camera" directory. This one had previously around 95GB of pictures. When entering over MTP protocol and trieng to open this directory, it show's an error releted with bad directory size, entering over adb shell allows to enter it, but it's empty. Over adb it also shows that its size is 120KB. But there aren't any files inside the directory.
The phone of course isn't rooted and the bootloader is locked. Android 10 on board.
I'm looking for help, or any kind of idea on how to access the images in the Camera direcotry - and couple of questions below.
1. Is there any way to fsck over adb without root?
2. Can I access the decryption key on the phone? And decrypt the partitions on linux?
3. Can the sdcard be decrypted? And if yes - will it delete the decryption key after that?
4. Can I make a dd/binary copy of the card over adb and save it (looking for a way to fsck the filesystem on linux, but for that I need a full decrypted copy of the card)?
5. Is there a known app that could repair a broken filesystem?
6. Can the phone be rooted without loosing the decryption key? The phone doesn't need to be functional after that. If accesing the directory means breaking the phone - I'll go for it.
7. Any other ideas are very welcome, will give a try on anything.
And a final one - are there any other places on the internet (except xda) where I could ask for help which I'm not aware off?
Thanks!
Related
Not sure if it is the same as Orbit2 file corruption problem. But mine consists of a few disappeared file directories - 3 directories all over 900MB. All the other smaller directories were unaffected. And the files should still be there as the space used and space left reported were the same as if the directories were there.
What would be the best tool to recover the directories and the files? Thought about using chkdsk, but I worry that it would just delete them. I have rescuePro bundled with SanDisk, but the files types were not listed in their compatible table.
Anyway to prevent this from happening again?
I used a program (for Windows) that recovered my hard disk from a total disaster. I deleted a partition and created another over it. It recovered everything.
Its name is [email protected] Partition Recovery. Connect you card reader with the card and check it.
Hi,
Some files from my efs folder were deleted (which resulted in corrupt imei, but thats another story) and I found a program that can restore deleted files from flash storage.
But the problem is that it sees only storage cards. (It sees the phone's storage if I mount it)
Is there a way to somehow mount the root of the device as a storage device? (I have the drivers of the device so I can access its root through adb or "android commander" but not through this program)
Sent from my imei messed up (half bricked)Nexus S using XDA App
Any help here?
I don't think so. Before you can mount the sd card on the computer, you have to unmount it on the phone. So in order to mount root on the computer, you might first have to first unmount root on the phone (not sure about this). I can imagine your phone having a small problem with this.
Could you copy the contents of root to the sd card (maybe in fastboot or recovery), and let the program work on the files there?
In the past on my Android phones, primarily LG, I have had SD cards installed and they became the default storage location for download, DCIM, images saved from any program, etc. Now I have the G5 and it seems to be quite different. I have an SD card installed and it seems there is no way to make it the default location as it has been in the past. I understand that adoptive storage can be made to work to use the SD card for more 'internal' RAM but I have had two issues with this, 1. I can't see the phone with ADB when connected to my PC and 2. I can't seem to find adoptive storage instructions that work. I am not new to LG or Android phone but this one has me a bit confused. Can adoptive storage be used on the T-Mobile G5 and/or can the SD card be made the default location for the G5 to store things, like DCIM, downloads, etc like all the LG phones in the past?
Thanks,
T.E
I was able to get adoptable storage going, discovered there's a typo in Paul O'Brien's article, once I fixed that I was set to jet. This is an edit from Paul's article here:
http://www.modaco.com/news/android/...e-adoptable-storage-on-your-s7-s7-edge-r1632/
1. BACK UP THE DATA YOU HAVE ON YOUR MICROSD CARD. Your card will be formatted by this process, so make sure you have saved any pictures, videos etc. from your card to your PC before you start.
2. Decide how you want to split your card. You can either commit 100% of the card to internal storage, or split between internal storage and conventional SD. This option is useful if you like to unplug your card and put it in your PC. I would probably recommend committing the whole card.
3. Umount the sdcard before connecting it in debug mode to your pc.
4. Open your command window / terminal on your computer and type the 'adb shell' command (with your phone connected of course). You will need to enable USB debugging in developer settings (which in turn is displayed by tapping the build number of the device 5 times) in order to see the option.
5. Type 'sm list-disks' to list the disks available for adoption. It'll look something like below - take note of the disk ID (disk:179:160 in this example).
6. Partition the disk. For this we use the 'sm partition DISK TYPE RATIO' command. For example, to partition the disk above as fully adopted storage (aka private) I'd use the command 'sm partition disk:179,160 private'. If I wanted a 50/50 split between adopted and regular, I'd use the command 'sm partition disk:179,160 mixed 50'. Easy right?
7. This took almost no time at all for me.
8. Go to the sdcard in storage and move data to it. This will then merge the space on the card and the internal storage.
HTH.
Ok, first problem first. I have the SDK installed, debug mode on and phone connected. I can see the file system on the phone but ADB DEVICES returns nothing. Until I can get that resolve I can't even do the rest.
Can anyone tell me how to get the T-Mobile LG G5 to be recognized by ADB?
Resolved and I believe I have the adoptable storage working now.
If this is done with a somewhat slow SD card will it have a negative impact on the entire system?
btothec said:
If this is done with a somewhat slow SD card will it have a negative impact on the entire system?
Click to expand...
Click to collapse
Maybe. Please correct me if I'm wrong but adoptable storage tries to only put stuff on the sdcard that will live comfortably there. Nothing system related will go there, so worse case an app takes longer to launch.
scottricketts said:
Maybe. Please correct me if I'm wrong but adoptable storage tries to only put stuff on the sdcard that will live comfortably there. Nothing system related will go there, so worse case an app takes longer to launch.
Click to expand...
Click to collapse
I am using a 64gb Class 10 and have not noticed any significant change in performance.
scottricketts said:
I was able to get adoptable storage going, discovered there's a typo in Paul O'Brien's article, once I fixed that I was set to jet. This is an edit from Paul's article here:
http://www.modaco.com/news/android/...e-adoptable-storage-on-your-s7-s7-edge-r1632/
1. BACK UP THE DATA YOU HAVE ON YOUR MICROSD CARD. Your card will be formatted by this process, so make sure you have saved any pictures, videos etc. from your card to your PC before you start.
2. Decide how you want to split your card. You can either commit 100% of the card to internal storage, or split between internal storage and conventional SD. This option is useful if you like to unplug your card and put it in your PC. I would probably recommend committing the whole card.
3. Umount the sdcard before connecting it in debug mode to your pc.
4. Open your command window / terminal on your computer and type the 'adb shell' command (with your phone connected of course). You will need to enable USB debugging in developer settings (which in turn is displayed by tapping the build number of the device 5 times) in order to see the option.
5. Type 'sm list-disks' to list the disks available for adoption. It'll look something like below - take note of the disk ID (disk:179:160 in this example).
6. Partition the disk. For this we use the 'sm partition DISK TYPE RATIO' command. For example, to partition the disk above as fully adopted storage (aka private) I'd use the command 'sm partition disk:179,160 private'. If I wanted a 50/50 split between adopted and regular, I'd use the command 'sm partition disk:179,160 mixed 50'. Easy right?
7. This took almost no time at all for me.
8. Go to the sdcard in storage and move data to it. This will then merge the space on the card and the internal storage.
HTH.
Click to expand...
Click to collapse
Can this be undone? What happens if you remove the sdcard? Is it still readable in a PC, so the files could be recovered if the phone died?
Click on the sdcard then select make portable storage. No clue what happens if you take it out other than some programs won't work.
kchannel9 said:
Can this be undone? What happens if you remove the sdcard? Is it still readable in a PC, so the files could be recovered if the phone died?
Click to expand...
Click to collapse
If it gets encrypted you won't be able to read it in a PC.
Sent from my LG-H830 using XDA-Developers mobile app
Can someone that had done it please post pics of how is it supposed to look like once you do the process, the reason I asked is bc under storage I can see the storage as one but in many google apps I only the the the 32gb of storage and no 211gb like on the storage settings. Thanks in advance
TheEditor said:
Ok, first problem first. I have the SDK installed, debug mode on and phone connected. I can see the file system on the phone but ADB DEVICES returns nothing. Until I can get that resolve I can't even do the rest.
Click to expand...
Click to collapse
How did you do it im having the same issue?!?!?!?!
TheEditor said:
Resolved and I believe I have the adoptable storage working now.
Click to expand...
Click to collapse
how did you fix the adb shell problem?!?!?!
---------- Post added at 12:16 AM ---------- Previous post was at 12:14 AM ----------
i get this when i type in adb shell
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\Dawid>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: device '(null)' not found
C:\Users\Dawid>
what do i do? how do I fix this?
you guys have adoptable storage working? do you guys like it? Yay Or Nay? i have it working fully no problems just i havent formatted my sd card yet. wondering if its worth doing.
Good morning folks,
I'm hoping XDADevelopers can assist me with an issue I've brought onto myself past couple days. I'm praying something can be done to recover my files! :crying:
I have an Galaxy S8+, and I encrypted my phone using Android's encryption feature (with a 4 digit pin code), and for some reason it wouldn't allow me to decrypt it. The option remained as 'Encrypt SD Card' via Settings > Lock Screen & Security > Encrypt SD Card, but when you go into it, it said that it couldn't decrypt the device as it needs the same device used to encrypt the SD Card in the first place confused:what? It is the same phone!!!). Burning up the internet trying to find a solution, I came across several forums telling me to do some of the following:
- Change Screen Lock Type to 'None' then try again - Failed
- Backup contents of SD Card onto PC, format SD Card on phone, encrypt SD Card (using 4 digit pin code), copy contents from PC onto SD Card, then decrypt it - Failed
- Wait it out - Failed
- Enable Developer Settings (I always do for the record) and enable 'Stay Awake' / enable USB Debugging, then repeat option 2 - Failed
- Mount / Unmount, reboot, etc. - Failed
When it was encrypted without any files on it, the option was now Settings > Lock Screen & Security > "Decrypt SD Card", so it seemed like an initial error occurred that made the SD Card think it was encrypted from another device,
Now the only copy I have of my files are stored on PC with no way of accessing it :crying:
I haven't formatted the phone yet, and I'm very reluctant to do so in-case i cause further damage.
Right now I'm in a constant loop of trying option 2 in hopes that it suddenly worked and allows me to access the photos! it managed to work once, but couldn't let me open the files from QuickPic app.
My questions are:
Can I recover my files? (from my PC)
Is there a way of forcing the encryption and encrypted files (stored on PC) back ONTO the SD Card after having formatted it?
Is there an app (either on phone or PC), that can force me to enter the 4 digit pin code (which was my phone lock, along with fingerprint scanner).
I'd very much appreciate any time and response regarding this.
Many thanks!
RedEyez92 said:
Good morning folks,
Click to expand...
Click to collapse
Hi.
I understand that it is unlikely that I will already help the author of the topic. But maybe my situation will be useful to someone else. Faced the same problem as the author. My memory card started to fail. At first, the phone lost her, but was found again after sd card being remounted. Then after some time the phone lost it again and did not see it at all. In this case, my laptop saw the card. I found that the problem is in LOST.DIR. Now the phone began to see the card, but it gave an error that the card was encrypted on another phone ("this sd card cannot be decrypted because it was encrypted on another device") (maybe the problem is that I inserted another card to check if this is a problem with the phone’s hardware). I tried the steps described above and the error reappeared. I tried to format the card and copy only a part of the files from the image and came to the conclusion that the problem is in one bit file in the DCIM/Camera directory. The phone apparently tried to scan the gallery on boot. It received a decryption error and stopped decrypting the rest of the content and just said that the keys are not the same. As a result, with long attempts, I found a broken file and successfully restored all other files.
Hello!
My Galaxy S9+ running Android 10 crashes whenever I insert my microsd card containing upwards of 9000 sub-directories and 92000 files. The SDCard is using 330GB out of 400GB.
Basically the way this happens is that I insert the sdcard and then a notification displays saying "Checking SanDisk SD card... Reviewing current content"
Obviously some kind of timeout is occurring when android attempts to scan the sdcard.
I have tried to disable the scanning a number of ways, making all the sub-directories hidden by prefixing them with a dot, putting a .nomedia file in every sub-directory and by not using any sub-directories and instead having all the files loose in the top level of the sdcard. This last "solution" actually works to stop the crashing but is unacceptable to me.
Basically my question boils down to this: Is there any way to disable android scanning the sdcard upon boot and when it is inserted ? I have rooted my phone so I could make modifications to the system to achieve this.
I simply want the sdcard to be usuable like on my linux desktop computer, I insert the sdcard, browse it with a file browser, and that's it. I don't want anything to happen by itself when it is inserted, no scanning, no indexing, nothing!
The MicroSD Card is formatted as exFAT
Assuming the external SD-card is FAT32-formatted, then this is true:
The maximum number of files within a directory of a FAT32 file system is 65,536 if all files have short filenames (8.3 format). Short filenames are stored in a single 32-Byte entry.
That means the maximum size of a direcotry (what by nature simply is a file) is 65,536 * 32 Bytes, i.e. 2,097,152 Bytes.
jwoegerbauer said:
Assuming the external SD-card is FAT32-formatted, then this is true:
The maximum number of files within a directory of a FAT32 file system is 65,536 if all files have short filenames (8.3 format). Short filenames are stored in a single 32-Byte entry.
That means the maximum size of a direcotry (what by nature simply is a file) is 65,536 * 32 Bytes, i.e. 2,097,152 Bytes.
Click to expand...
Click to collapse
Thank you for your reply,
I wish it were that simple. The SDCard is formatted as exfat and works perfectly fine under windows and linux.
The file system has nothing to do with the issue I don't think, it must be some issue with android.
Your phone should can handle exFAT-formatted SD-cards ( microSDXC cards ). At least so it's written it its specs.
jwoegerbauer said:
AFAIK exFAT is not supported on all ROMs.
Click to expand...
Click to collapse
It is on mine. The SDCard works perfectly fine with less subdirectories on it, the issue really is not the file system itself, I ran a logcat and this error always occurs
*** WATCHDOG KILLING SYSTEM PROCESS: Blocked in monitor com.android.server.StorageManagerService on foreground thread (android.fg)
I figured it out in the end, I had to format the sdcard as ext4 and then mount it from the command line with appropriate namespace and permissions
People still use SD cards?
Wow.