problems with SDCard after partitioning


Question

I'm using a rooted XPeria Z1c. Recently I got myself a bigger SDCard (128 GB) and I decided to use 2 partitions. I started 'adb shell' then partitioned the card using



sm partition disk:<disk_id> mixed 50


After disconnecting the phone I formatted the 2nd partion as exFAT. Windows' disk manager is showing me 3 partitions on the SD: one exFAT plus 2 more that obviously aren't recognized. One of those 2 is quite small (16MB in size), the other one has roughly the size I'm expecting it to have.
EDIT: formatting was done by the phone itself after I first inserted the freshly partitioned card, and I expected the format to be ext4.



My phone has no problems using both of the main partitions, so that's good.



On my PC I'm running a Linux device driver by Paragon enabling me to access extFS formatted sd cards an pendrives from Windows Explorer. But if I directly connect the card to my windows PC (using an SD card reader) only the exFAT partition is accessible. Apparently the other partition is not truly formatted as ext4.
I tried various adb / terminal commands to access that special partition and find out what it is but I can't really access it (fdisk, mount, cat, df, ...).



Can anyone give me an idea how to handle this? What file system could be used for my internal SD card if it's not ext4?



EDIT2: (after comment from @Izzy): I just created a new (smaller) SD card with just one partition and formatted as ext4. After inserting it into my phone I had to prepare and format it as internal storage. After that I pulled it off my phone again and examined it using my PC. Result: the ext4 partition is readable in Windows (through the Paragon driver) and it also has an extra 16MB partition. No idea whatsoever what this is used for...



EDIT3: doing some more experiments with my smaller sd card I think that @Izzy pointed into the right direction; might as well close this question


Answer

As it turned out, your partitioning was due to the fact you wanted to use (and not, as one might assume, to use ). As our adoptable-storage tag-wiki points out, adopted storage will be encrypted – not just the files on it, but the entire partition. That explains two things:




  • attaching the card to your PC using a card reader, the PC cannot read the partition without having the encryption details. As you didn't provide them to the PC, it could not "open" it

  • attaching the device via MTP however shows the partition fine on your PC, as the Android device has decrypted it



Remains the mystic 3rd partition. The small size suggests it's some "control partition". A good guess as it turns out: if you list the label, you will find it's called android_meta (while your adopted partition will be labeled android_expand) – which you can find out e.g. by a Google search for "sm partition disk" 16m. Quoting from this Oopsmonk article on how adoptable storage creation works:




It will create two partitions (android_meta and android_expand) for adoptable storage, the android_meta is a reserved space for feature use and android_expand is the external storage which is encrypted via dm-crypt.




With that last detail, your puzzle should be complete


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