I originally wanted to comment here to ask a clarification question. But as I haven't enough reputation and it seems there isn't any private messaging possible, I opened this new question.

The device is a Moto G2 with 8GB storage. I configured it under cm13 to use a 64GB sdcard as adoptable storage. After a few weeks my sister called, the device disconnects the sdcard very often and wants it to be reinserted.

In the hope that it's only the sdcard giving up, I ordered a new one and copied the whole disk with dd if=/dev/oldCard of=/dev/newCard. Have to wait, if the problem is gone or not. But I thought about, if the adoptable storage option of Android isn't that brilliant and therefore googled if I could somehow mount an ext4(/or f2fs) partition on the sdcard under /data.

The answer I found here on Android Enthusiasts, sounds interesting, but I can't believe that this works this way, as of my understanding... So, in the linked answer, it says:

This is the way to have /data on the SD Card directory:

  1. Copy all /data to the SD Card directory: /mnt/sdcard/data
  2. Delete /data
  3. Create a symlink that points to the SD: ln -s /mnt/sdcard/data /data

So, my problem/confusion with this are the following points:

  1. If I create a symlink in the root dir to something else, this link is gone up on a reboot. So how am I supposed to make the link from /data to some other place persistent?
  2. If I make /data point to /sdcard/data, wouldn't the mount command now mount the partition in which the data is really stored under /sdcard/data? So the data would still be placed in the internal memory, but the point where it's mounted in the system is a different/wrong one, right?

My aim would be, to have a sdcard formatted with ext4/f2fs and get it mounted as /data like mount /dev/block/mmcblk1p1 /data instead of the internal data partition. But can I do that WITHOUT modifying the fstab of the kernel for every update I want to do manually?


  • Why don't you simply use adoptable storage fetaure? Feb 4 '17 at 13:54
  • As said, I am at the moment. If the new sdcard fixes the problem of disconnecting card, all fine. But because of that, I got curious if it is possible to directly mount it under /data easily
    – 9Lukas5
    Feb 4 '17 at 14:16

I have done the exact same thing in the past with a Samsung Galaxy Y DuOS S6102 by replacing all the mount lines concerning the data partition in the init scripts and fstab file.

I couldn't find better solutions (think as future-proof) for the problem because once you look at the boot process for a generic Android device in Wikipedia, you'll notice the kernel runs the init scripts which makeup the directory tree and mount certain stuff that lay the foundations for Dalvik/ART runtimes to kick-in.

So by making a few tweaks to these scripts and partitioning the 8GB SD card into 1GB and 5.6GB, I was able to make it work boot.

Note: The device I used runs on ancient technology with little security features as compared to modern techniques. Hence, you might wanna be careful before making changes.

  • So I'm right that the linked solution can't work? 🤓 Maybe it'd be possible to place a script in system somewhere, that remounts the partition from an sdcard to /data before the os actually boots up? But I have no idea where and/or how to that 🤔
    – 9Lukas5
    Feb 4 '17 at 10:14
  • But isn't that happening in my answer? Before the OS boots up is before Dalvik/ART kicks in and the kernel is where I'm targeting mount scripts to work. :/ Feb 5 '17 at 10:58
  • Yeah, your solution does that. The one I linked in my original question won't work^^. But the aim was a way, without editing the kernel. Because else, I would have to edit the kernel of each update manually before flashing
    – 9Lukas5
    Feb 25 '17 at 22:32

This should work since what the symlink does is it looks at the /data as a folder but it actually works on the folder that the symlink is referring to.

About your issue of it disappearing after reboot. You can run a script at startup that creates the symlink. (Or you can probably mount your data directly to /data without having to use a symlink)

I have done something similar to make my Termux file system work from a SD Card. Take a look at this answer.

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.