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:
- 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 throughlsblk
- 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) - 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