• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to create Mount script as/ or Link2sd symbolic link in adoptable storage.

kumaranil13k

Well-Known Member
Jan 10, 2020
102
8
Question : How to create Mount script as/ or Link2sd symbolic link in adoptable storage (format microsdcard as internal memory) in Android 6.0.1 marshmallow any help

I have an old mobile with upgrade of Android 6.0.1 marshemellow with 16gb internal memory(11gb reserved for system and only 5 GB free space for user apps and files). I want to make 128gb or 64 GB microsdcard as internal memory.

I had changed many apps manifest through apkeditor and changed their default install location. To external still some files are moved and many apps cAnt change the manifest.

So to add at least 60gb I decided to move apps and folder redirect dcim download whatsapp Facebook to external micro SD card so that at least 2gb space is always free in internal memory.

Now the question and problem is that can I cheat or mislead the Android 6.0.1 marshmallow (without root or with root) throughs

  1. Using apps like link2sd or app2sd or folder redirection appps or
  2. Through SM PM command.
    Code:
    adb shell sm list-disks adoptable
    sm partition disk:179:160 mixed 25
    adb shell sm format private:179,3
    adb shell sm mount private:179,3
    adb shell pm set-install-location 2
    adb shell pm get-install-location
  3. Through creating own symbolic link boot.init script to decieve Android 6.0.1 is and move or link apk files like data lib hex off apk to.memory card
  4. Can both adoptable storage (format as sd as internal and the link2sd symbolic link mount scripts) work together as after formatting as card as internal Android assumes no external card and the how will be it work from redirecting or symbolic link to internal folder. I tried Inc it gave "Mount script error"
And it Any way or script if I can write or tell it will be great help for my problem
 
Marshmallow supports internal (Adoptable) Storage, If you format your SD card that way, you don't need to do anything else, Android will take care of it. Just be aware that the SD card will be encrypted so only readable by the phone.
Also, if you do a factory reset, the phone will generate a new encryption key and the SD card will no longer be readable, so make syre you back uo regularly to Google drive or your PC.
 
Upvote 0
@ocnbrze and @Davdi bro thank a lot nice to see if replies bro first of let me clear my query technicalli in one line I "I want to reprogram or remodify the link2sd modify mount script " to make it work in Android 6.0 for eg. I am sharing a XDA forum question where one answered a solution to.do it https://forum.xda-developers.com/t/link2sd.3222034/



in this post query I want to ask that, as it's with Android 6.0.1 marshmallow mobile.phone I am able to move all user apps to Microsdcard formatted as internal.memory. when I format the Microsoft card as internal it can auto move/installs only 10℅ to 20% not apps to external micro SD card by default it install... others individual apks apps installed I edited apps main manifest apkeditor apps manifest and changed it as default install location to external thus it's successful with some apps to.move (25%-35%).But rest 55%- 65% apps are still unmovable now what I am planning is to link or symbolic link or mount or move those 65% apps by cheating receiving Android 6.0 .1 and linking or folder redirect mount script to Microsd card format as internal as link2sd aapp do. .

my major concern and study from.forum.linka are that as in Android 6.0.1 marshmallow the microsd card formatted as internal so it mounts that card to name /sdcard and linked sear h for /sdext and says that the card not available as it's made to search for external card whereas .

Now how to create our own mount script or modify setting or can we crater another mount point so as card as /sdext and make.link2sd or appear work which can redirect symbolic the internal memory apps to Microsdcard formated as internal...Is it possible or just my imagination....Can u help me in guiding or writing such mount script or tell me any other settings way out


In the link of XDA forum answer a solution. Was share as a Novice I don't know if it will work or not
https://forum.xda-developers.com/t/link2sd.3222034/


I found a workaround to make link2sd work on android 6.
The first time I installed and ran link2sd, during the creation of the boot script an error was raised about a missing /dev/block/vold/179:18 device.
So I logged in with a terminal and discover that the device in vold is no longer called 179:18 but public:179_18.
I created a symbolic link with the 179:18 name that points to the new device name, recreated the mount scripts and I have now the second SD partition automatically mounted and working to move apps with link2sd.
I sent an email to the app creator, I hope he can fix the issue now.

Below how I did:
- Write down the name of missing device from the error raised by link2SD when the mount script creation fails (eg. for me: /dev/block/vold/179:18)
- Open a terminal to open a local shell.
- Log in as the root user ("su" command)
- Change to the device dir and list the present devices.
Example for me (/dev/block/vold/179:18):
Code:
root@: / # cd /dev/block/vold
root@: /dev/block/vold # ls
disk:179_16 public:179_17 public:179_18
root@: /dev/block/vold #
- Identify the new device name: if for example the device name was "179:18", now the new one is "public:179_18"
- create a symbolic link named as the missing device that point to the new device name (replace the name with your device):
Code:
root@: /dev/block/vold # ln -s "public:179_18" "179:18"
- DO NOT REBOOT YET
- if you list files you should see the new link:
Code:
root@: /dev/block/vold # ls -l "179:18"
lrwxrwxrwx 1 root root 13 Feb 19 11:11 179:18 -> public:179_18
- Open the link2SD app and from the menu choose "Recreate mount script" and accept to reboot when the script has been created.

link2SD should now be able to create the mount script.

When you reboot your device, the symbolic link that you created is deleted, but in my case the app created a mount script with 2 mounts:
- The first with the device using the symbolic link (that will fail because the link is gone)
- The second with the physical device (/dev/block/mmcblk1p2) that will successfully mount the 2nd sd partition
So, if it's the same for you, you will not need to modify the mount script.

The only issue (but not that annoying) now is that at every reboot android see the 2nd SD partition as corrupted and ask you to format it: I simply ignore it and dismiss the notification (If someone knows a way to make android ignore a specific disk device, let me know)

I don't know if this can work on all devices, I only could test with my galaxy tab 3.8 with A Bliss ROM.

Let me know if it works.
 
Upvote 0
There really is no need, Android is very good at storage management, From Android's perspective it doesn't matter whether apps are in the devices storage or an SD card formatted as internal, it's all the same to Android. Just be aware that you'll need to use the fastest (Class 10 or better) card, and doe to how the cards are made - I believe that anything above 64GB is made by using multiple 64GB chips ( it may be multiple 32GB chips maybe someone with more knowledge can clarify). this can potentially reduce the life of a card as it will be read/written to many more times as internal storage that if you just used it as removable storage for music/video, photos etc.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones