Motorola g3 and unreadable SD Card


Question

A couple of days ago the SD card (which is the "expanded filesystem" from android 6.0) on my phone stopped working. The phone still boots and works, but all my data (especially photos and WhatsApp conversations - yes, I didn't make a backup, shame on me) are gone.



I removed the SD from the phone and put it in my PC, where Fedora recognizes the partitions but cannot mount them.



Here's the output of fdisk -l:



fdisk -l /dev/sdc
Disk /dev/sdc: 29 GiB, 31104958464 bytes, 60751872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 938FFB3B-CA49-45D0-89B3-BE22ADAAD86E

Device Start End Sectors Size Type
/dev/sdc1 2048 34815 32768 16M unknown
/dev/sdc2 34816 60751838 60717023 29G unknown


Whenever I try to mount one of those partitions, I get



mount /dev/sdc1 /mnt/test
mount: /mnt/test: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.


Same result if I use the -t option with auto, vfat or ntfs.



If I open gparted and attempt the data rescue this is what it finds:



Gparted's Attempt Data Rescue



and when I click the "View" button it correctly recreates the Android filesystem, but with no file inside:



tree
.
├── Android
│   ├── data
│   │   ├── com.android.vending
│   │   │   └── files
│   │   ├── com.google.android.apps.maps
│   │   │   └── files
│   │   ├── com.google.android.gms
│   │   │   └── files
│   │   ├── com.google.android.googlequicksearchbox
│   │   │   └── files
│   │   │   ├── download_cache
│   │   │   └── pending_blobs
│   │   ├── com.google.android.music
│   │   │   ├── cache
│   │   │   └── files
│   │   ├── com.google.android.videos
│   │   │   └── files
│   │   │   └── Movies
│   │   ├── com.google.android.youtube
│   │   │   ├── cache
│   │   │   └── files
│   │   └── com.motorola.migrate
│   │   └── files
│   │   └── Pictures
│   └── media
│   ├── com.android.providers.media
│   ├── com.google.android.talk
│   └── com.motorola.MotGallery2
├── bluetooth
├── DCIM
│   └── Camera
├── Download
├── LOST.DIR
├── media
│   └── audio
│   └── notifications
├── Music
├── Ringtones
├── System Volume Information
│   └── IndexerVolumeGuid
└── WhatsApp
└── Media
├── WhatsApp Audio
├── WhatsApp Images
└── WhatsApp Video
44 directories, 1 file


Has anyone any idea?


Answer

The issue here is that Marshmallow and newer Android external storage is encrypted when it is adopted by the system as internal storage.



You need the crypto key from your device to mount the volume, does your phone have an unlocked bootloader and/or are you rooted? If not, you are not going to be able to access the key and decrypt the volume.



Similar questions which may be useful as reference: Moto G3 (android marshmallow) not detecting SD card anymore (solution?) and Recovering data from corrupted SD card formatted as internal storage (Marshmallow)



Remember that this is not unique to the Moto G 2015, most Android devices with Marshmallow and newer have this capability (and issues). Honestly, it best to not use adopted storage if at all possible.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes