Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn a portable SD card into internal storage via ADB command?

Android 6.0 Marshmallow’s introduces Adoptable Storage, a feature that allows use a SD Card as internal storage.

Is it possible to activate adoptable storage via ADB shell commands?

like image 925
cassioso Avatar asked Jun 27 '16 00:06

cassioso


People also ask

How do I convert a portable SD card to internal storage?

To turn a “portable” SD card into internal storage, select the device here, tap the menu button in the top-right corner of your screen, and select “Settings.” You can then use the “Format as internal” option to change your mind and adopt the drive as part of your device's internal storage.

Can I make an SD card internal storage?

Tap the name of your SD card. Tap the three vertical dots on the top right corner of the screen. Select Storage Settings. Choose format as internal option.


3 Answers

I managed succesfully perform this operation on my LG K8 LTE. I want to notice there are "500 xxx Unknown disk" errors problems, and give solution to avoid this. Solution is very simple. Proper steps in ADB would be:

adb shell
sm list-disks
// HERE YOU GET YOUR DISK ID, SOMETHING LIKE "disk:179,64" - REMEMBER THOSE NUMBERS
sm set-force-adoptable true
// IN NEXT LINE, SIMPLY PUT THOSE NUMBERS AFTER "disk:" AND ALSO AFTER WORD "mixed" TYPE PERCENTAGE OF SPACE LEFT AS EXTERNAL, SO IN MY CASE:
sm partition disk:179,64 mixed 60
// IT TAKES TIME. BE PATIENT. WITH THIS LINE I TRANSFORMED WHOLE EXTERNAL SD INTO 40% OF INTERNAL AND 60% OF EXTERNAL
sm set-force-adoptable false

BANG! That's it! Now go to storage and usb, there click on internal part of SD and expand options, click on "use as internal" or something like that, last option, (I cannot see what was that because I already clicked it and everything works) apps are finally going on SD with OBB files! ;)

Have a good day!

like image 51
Adam Staszak Avatar answered Oct 14 '22 03:10

Adam Staszak


I have done somewhat extensive research on this question online. I can tell you the steps, and they seem to work for everyone but me. Try them and let me know if they work for you.

  1. Back Up your SD card, as it will be wiped.
  2. If you don't already have it, download and install Java SE Development kit. The website is www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. I used version 8u101 for Windows x64.
  3. If you don't already have it, download Android SDK Manager. The website is developer.android.com/studio/index.html. Scroll almost to the bottom where it has "Get just the command line tools" and select android-sdk_r24.4.1-windows.zip for Windows. When it downloads, extract all to a location where you want to keep the folder.
  4. Open the Android SDK folder and run the SDK Manager. (If it fails to run, see question 14504325 in stackoverflow). Follow the instructions on www.howtogeek.com/125769/how-to-install-and-use-abd-the-android-debug-bridge-utility/ to get it up-and-running.
  5. When you have the command prompt open per the how-to-geek website instructions, enter "adb shell"
  6. Then enter "sm list-disks". This will return the name of your microSD card. The instructions I was following showed a disk labeled 179:160, but my computer showed the disks as 179,32. This is where I'm stuck.
  7. Finally, enter "sm partition disk:179:160 private", where the numbers are the name of your disk from step 6, if you want to adopt your whole SD card as internal storage. Otherwise, enter "sm partition disk:179:160 mixed 25" where the last number is the percent of the card's space used for external storage. I have not been able to get this to work.

See http://www.modaco.com/news/android/heres-how-to-configure-adoptable-storage-on-your-s7-s7-edge-r1632/ for the original instructions.

P.S. I tried this on a Samsung Galaxy On5, so that might explain why it hasn't worked.

like image 42
Jess Kennedy Avatar answered Oct 14 '22 05:10

Jess Kennedy


This has now been disabled on (at least) some Samsung tablets.

I have a galaxy tablet that has been running with a huge sd card formatted as internal storage.

I purchased another more recently and on this adb format command did not work (it just immediately returned to the command prompt).

I have had to do a factory reset on the older machine and now find that it too will not allow the SD card to be formatted as internal memory - it behaves just as the newer one does.

My guess would be that Google have updated android to 'respect' the settings of the suppliers UI.

This has (of course) completely messed up my system, as the backup/restore was based on main memory of over 100GB, not the 16GB the device actually has.

like image 1
pperrin Avatar answered Oct 14 '22 04:10

pperrin