Thursday, August 20, 2015

6.0 marshmallow - My adoptable storage is full. How can I move the data to a bigger MicroSD card?


I've got a Moto G 2014 LTE running CM13. When I found out about the whole 'adopt SD card as internal storage' thing, I was quite excited, as the actual internal storage on this phone is tiny. I set up a 16gb micro SD, the biggest I had at the time, and have been using it with minimal problems.


Fast-forward to this day, and I now have a 64gb micro SD that I want to use instead of the 16gb one. However, I'm at a loss as to the best way to copy the data over onto the new one, or if it's even possible. The ideas I've got so far include:



  • Titanium Backup all [system] apps, factory reset, format new SD and then restore (should work, but a massive pain)

  • NANDroid the SD card onto a USB OTG stick, then restore to the new one (pretty sure this is a bad idea and won't work, but...)

  • Copy all the stuff onto my computer via my phone through a file manager of some sort (I have a linux/linux/windows triple boot, so file format isn't a problem), format the new SD into phone, and copy back (can't be that simple, can it? Hidden/inaccessible files?)


  • Copy the files onto USB OTG with a root file explorer app, reformat the SD as portable, format the new one as adopted, and then copy them back (could work, except for the point below)

  • Format the 64gb SD card as internal through an OTG card reader with the command adb shell sm set-force-adoptable true, use a root browser to copy all the data over from the old SD, format the old SD as external and remove it, and take the new SD and put it in the SD card slot (seems overly complicated, and also suffers the below pitfall)


The other thing that worries me is mount points: will the apps with externally-stored data know to look at the new SD card for it? Will I have to remount it in a specific location with the shell each boot (or use an init.d script perhaps)? I suppose that it can always be accessed through /sdcard or /storage/emulated/0, but I'm not 100% sure what goes on behind the scenes.


I've got recent NANDroid backups, so if anyone can eliminate the options that definitely won't work (or say which one[s] probably will), I can try them and report back in case someone stumbles across this question in the future.


EDIT: So, my phone further bit the dust and got to the point where it got into a pretty major bootloop. Ended up having to flash a whole new ROM. As such, I probably won't be able to test the full image/decryption/etc. method that I was originally planning. However, I will write up what I've discovered so far in case anyone wants to take up this particular method in the future:



  1. Image the old SD with dd as follows: sudo dd if=/dev/mmcblk0 of=~/SDCardBackup.img, where /dev/mmcblk0 is the location of the sd card as obtainable through lsblk

  2. Restore the image you just made to the NEW sd card : sudo dd bs=4M if=~/SDCardBackup.img of=/dev/mmcblk0 (you may have to unmount it first)

  3. From here on in, I was following this (thanks @beeshyams!) tutorial, which explains the next steps way better than I ever could have done. The plan was to decrypt the storage and resize the main partition with gparted. I had no idea whether it would work or not, but I felt it was worth a try. However, when I came to run the actual decryption command using the key I'd extracted, I got an error (which I believe was my shoddy linux skills more than anything).



As I say, I have no idea if the above method would work or not even if everything did go to plan. Also, feel free to correct any of my commands above if I mis-typed them (I'm on Windows currently, so this is all from memory.) If this info helps anyone, then good. But until then, @faidherbard's comment should work fine.


Thanks, Jackdafish



Answer



Having a similar issue, I read through the comments to your question and ended up doing the following based on a hint suggested by Barleyman:



  • Go to Settings > Storage & USB › Internal Storage, click on "Migrate data" to move your data back to internal


In case you do not have enough space left on internal to move everything back (which was my case), here are some additionnal steps:




  1. Connect the phone to a PC via USB and back-up the contents of the old "adopted" SD Card

  2. Manually delete enough data from the old SD Card to be able to do the move: typically pictures and videos that you can easily restore afterwards

  3. Click on "Migrate data" in Settings > Storage & USB › Internal Storage

  4. Check that the old "adopted" SD Card is now empty (or even format it back to "Portable") then eject it

  5. Insert the new SD Card and set it up as "Internal storage" and agree to move the data to it

  6. Eventually reconnect the phone to the PC via USB to restore manually deleted data




Reference: Answer to "How does the "Format as internal storage" feature work in Android 6.0+?":





  1. You can reverse the process by opening "internal storage" from storage settings and there's "migrate data" that will copy everything back to internal nvram.



No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...