Error when migrating data from internal microSD to internal storage despite apparent available space


Question

I have a Moto G3 (Android 6.0) with a microSD of 2GB that I configured to use as internal storage. It's been working fine for years, but I want to upgrade to a larger and faster card. So, I'm first trying to safely remove this microSD. When I try to migrate data from the microSD card to my phone's internal storage, it fails with the following message:



Couldn't move data


Data left at original location



However, I thought I cleaned up enough space, as described in this answer. I removed several apps, cleaned data and cache. The microSD reports zero apps and cached data used. Here's the current disk usage:



  • Android OS: 4.19GB

  • Internal storage: 7.68GB of 11.81GB

  • SanDisk SD card: 1.78GB used of 1.80GB


I checked this answer, but it seems different because there the microSD is used as portable storage, instead of internal. This answer seems closer, Droidriven says the /data partition might be the culprit:



Droidriven (reply #13):


You probably have too many apps to move everything to internal, you have plenty of storage but your /data partition probably isn't big enough.


You'll have to backup the apps and data, and store it on PC, then uninstall the apps. Then migrate what is left. Then go from there. You can put the apps and data back after you get done if you have enough space or another sdcard.



Using adb, it seems /data partition has space, though:


$ df
Filesystem Size Used Free Blksize
/dev 439.2M 88.0K 439.1M 4096
/sys/fs/cgroup 439.2M 12.0K 439.2M 4096
/mnt 439.2M 0.0K 439.2M 4096
/system 2.2G 1.7G 511.2M 4096
/data 11.8G 7.6G 4.2G 4096
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/cache 248.0M 242.8M 5.1M 4096
/persist 3.9M 192.0K 3.7M 4096
/firmware 35.2M 31.5M 3.7M 4096
/fsg 2.1M 2.1M 1.0K 1024
/storage 439.2M 0.0K 439.2M 4096
/mnt/expand/6318ae65-dd0e-47fb-be4d-522416bf8877 1.8G 1.8G 16.0M 4096
/mnt/runtime/default/emulated: Permission denied
/storage/emulated 11.8G 7.6G 4.2G 4096
/mnt/runtime/read/emulated: Permission denied
/mnt/runtime/write/emulated: Permission denied

I think this is the right track, though, it looks like something related to a partition that doesn't fit.


Where can I look for more info? Can I use adb to perform this migration? Maybe the error messages will be more detailed.


EDIT: One thing I noticed after talking to someone at AndroidQuestions' Discord is that, since before I started cleaning up space, the SanDisk SD Card always showed 0.00 bytes allocated for Apps and Cache and 1.78GB used of 1.80GB. Even after I cleaned up around 4GB of storage, it still showed the same numbers. Is it possible that the SD card used as internal storage will always show these stats because it has been allocated by the OS? Thus, it is actually already empty and I can try to eject it without data loss.


I'll give it a try and post an update later.


Answer

Despite the SD card was showing as 1.78GB used out of 1.80GB, it was already empty. So, I formatted as portable and ejected without data loss.


As I reported in my question, there were no apps or cache stored in it. It showed as used because it was formatted as internal, although it didn't have any data in it. About the option to migrate data back and failing when attempted, I think it's some buggy interface as this is an old Android version and the first one to provide this feature (internal storage).


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