2

Galaxy S5 running LineageOS 16 (Android 9).

I'm having issues with running out of storage space, even though I have 128GB external SD card, merged with the internal storage. Is there a way to create a symlink from the internal memory to the external SD card, even though they are technically merged and aren't identified as separate storage locations within Android as a result?

I've never made symlinks on Android so I'd appreciate some pointers or resources on that as well.

  • post the output of adb shell df – alecxs Jul 1 at 12:52
  • @alecxs how do I do that? I ran "adb shell df" in a terminal emulator on my phone and it was unrecogized. – BingBong Jul 1 at 13:23
  • pastebin.com/9a1LrHBf – BingBong Jul 1 at 14:27
  • it is already mounted to /storage/emulated with 100 GiB free space (84%) no need to symlink – alecxs Jul 1 at 14:32
  • But I get warnings about low space sometimes. Should I just ignore that or will it cause issues with the system? My intent with symlinks was to force my large music folder to be stored on the external SD card as well as my TWRP backups. – BingBong Jul 1 at 14:33
1

First of all, symlinks don't work on Android's emulated storage (/sdcard). See this answer for details.

Secondly, when you format external SD card as Adoptable Storage, it's mounted at /mnt/expand/[UUID], which holds a file hierarchy very similar to /data partition, like /data/app, /data/data and /data/media etc. If you migrate your data to newly created Adoptable Storage, data from /data/media/ is moved to /mnt/expand/[UUID]/media/ and the later is now emulated and bind mounted at /storage/emulated. You can check this by executing df on a terminal app or adb shell. It should free space on internal memory i.e. userdata partition mounted on /data.

Additionally you can move apps (along with their data) to Adoptable Storage to further free up space. Apps only with installLocation set to preferExternal or auto can be moved.

So you can't create symlinks, but if you want more free space, go for e.g. replacing large directories in /data (check with du -h /data | sort -h) with (bind) mounts from partitions on external SD card. However (DAC and MAC) permissions should be taken care of, otherwise apps (or even OS) may break.
See Can't move apps from internal to external storage.

RELATED: What is /storage/emulated/0/?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.