How to use microSD as internal storage in an Android phone

Published:

Overview

Older Android phones lacks good support for expanding internal storage when connecting a microSD external memory card.

This is a guide to make Android aware of you microSD and have it used as internal storage by default using an Ubuntu Linux computer.

This guide makes sense when the Android phone doesn’t gives the option to use a microSD external storage card as an internal storage when you just connect it.

Install adb

adb is the Android’s debugging tool that runs on Linux, to install it: sudo apt-get install adb.

Activate developer mode

In your Android phone enable the Developers menu.

  1. Open the Settings app.
  2. Scroll to the bottom and select About phone.
  3. Scroll to the bottom and tap Build section 7 times.
  4. Return to the previous screen to find Developer options near the bottom.

Enable debugging

Enter the new Developer menu item and enable debugging through USB cable.

Connect phone to PC

After having the adb tool installed, we connect the phone through an USB cable and check it is being detected by adb with adb devices -l.


$ adb devices -l
List of devices attached
A6R9XXXX27905XXX       unauthorized usb:1-2 transport_id:1

If it says unathorized like above, then trying to access the phone will fail with the following message.


$ adb shell 
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

So you should check phone’s screen and accept to handle the smartphone through the computer.


$ adb devices -l
List of devices attached
A6R9XXXX27905XXX       device usb:1-2 product:CRO-L03 model:CRO_L03 device:HWCRO-XXXXX transport_id:1

Format microSD

Now we log into the phone through adb shell and execute the following commands.


shell@HWCRO-XXXXX:/ $ adb shell
shell@HWCRO-XXXXX:/ $ sm set-force-adoptable true
shell@HWCRO-XXXXX:/ $ sm partition disk:179,128 mixed 60
shell@HWCRO-XXXXX:/ $ sm set-force-adoptable false
shell@HWCRO-XXXXX:/ $ ^D

We can choose to use 60% of the microSD memory as internal storage with the above command sm partition disk:179,128 mixed 60 or make Android use all the available external storage as internal storage with private like sm partition disk:179,128 private.

Move data to internal storage

  1. Go to Settings and then Storage.
  2. Select the microSD card listed at the internal storage section and tap to enter it.
  3. Inside the above menu browse to the bottom and choose to move all the data to the new card.

Final

Remove all the data from previously stored apps, and manually check they are located in the new position.

Also check that Camera default storage is the newly chosen internal or external storage as you prefer.

References

Uruguay
Marcelo Canina
I'm Marcelo Canina, a developer from Uruguay. I build websites and web-based applications from the ground up and share what I learn here.
comments powered by Disqus

    Articles

    • How to use microSD as internal storage in an Android phone

Guide to use a microsd card on your android phone as internal storage.

Clutter-free software concepts.
Translations English Español

Except as otherwise noted, the content of this page is licensed under CC BY-NC-ND 4.0 . Terms and Policy.

Powered by SimpleIT Hugo Theme

·