Problem of moving apps to SD card

That was a goal, by time it collapse to moving apps data to SD card.

Common purpose was highlighted in article Андроид: [DirectoryBind] Простой способ связать внешнюю sd карту и внутреннюю память, чтобы освободить место / Хабр

To be brief many Android device users have restricted internal memory and slot to insert SD card with large capacity somewhat 64-128 GB. The more application you have the close the moment when you receive the message: Internal memory is insufficient!

Despite the fact You do have large SD-card 64GB or 128GB!

I have such a device and I wanna solve the problem of slow internal memory. Some times I can’t use my Bluetooth earphones cause youtube movie stop functioning…

Below I wanna share my thoughts about solving this problem.
1. I have the tablet Lenovo Tab 3 8 Plus (model TB-8703x), OS Android Marshmallow v.6.0.1, processor qualcomm snapdragon 625, additionally I have SD-card Samsung - 64.0 GB.

The size of internal memory is 16 GB, the system uses 3GB, adding user applications consumes all free memory.

Details: My tablet is rooted by Magisk-v24.3.

OS don’t allow to install apps on to SD card, so one need to move apps on SD card.

I looked and tested different ways of solving this problem.

The OS does not have files such as init.d (and others like ott), so I found the only one way to save internal memory at the expense of SD card.

It was publicized in the article Андроид: [DirectoryBind] Простой способ связать внешнюю sd карту и внутреннюю память, чтобы освободить место (My translation: Android. Simple way to link external SD-card and internal memory to free memory.)

Article dated 2013/02/19. Ref: Андроид: [DirectoryBind] Простой способ связать внешнюю sd карту и внутреннюю память, чтобы освободить место / Хабр.

There are several posts like this, dated by slig, Dec 25, 2011,

and so on.
It’s a pity, but it seems the work was done by Russian speaking author and then was translated to English. Instruction contain a mess of terms like source, target, and so on, so it was impossible to create anything able to work. From the appearance of the first publication instruction did not corrected and possibly not used, so one may use the only idea of creating symbolic link to data block of apps and move them onto SD card. My tablet does not allow to use scripts Autostart.sh, because it has no OTT directory. There are no way to launch application BIND.
2. What one may do?

The only accessible thing is moving application data to SD card, the application itself remains in internal memory.

Sample: Делается это довольно просто:

First of all I divided SD card on two partitions:

First partition is created as Primary partition and formatted as FAT32 or ExtFat.
Second partition also is created as Primary partition and formatted as EXT2, EXT3 or EXT4.

Partitioning SD card may be done by program aparted on Linux. In my case the first partition takes 35 GB as FAT32, second takes 25-29 GB formatted as EXT4.

First partition is seen from Android as SD-card and may be used as external memory for saving arbitrary data.

Second partition is used for saving app data, app itself remains in internal memory. To make it accessible you must mount it:

I am using Terminal Emulator for Android OS: site termoneplus.com, and keyboard for terminal Hacker’s Keyboard. You type the command:
mount -t ext4 -o rw,noatime /dev/block/mmcblk1p2 /data/sdext4
Then you may choose an application to move it’s data on the SD card:

I have chosen Weatherstation - com.arf.weatherstation

Application APKInspector gives us the necessary data:

Source Dir: /data/app/com.arf.weatherstation-1/base.apk

Data Dir: /data/user/0/com.arf.weatherstation
If you have installed totalcommander you may see the properties of application data catalog:

/data/user/0/ com.arf.weatherstation - size is 5.2 Mb

This program also convenient to copy/moving dirs. For android commands one may use Terminal Emulator

Now I am moving Weatherstation application’s data into dir:
/data/sdext4/com.arf.weatherstation

from dir

/data/user/0/ com.arf.weatherstation

and making symbolic link in terminal session:
su

ln -sf /data/sdext4/com.arf.weatherstation /data/user/0/com.arf.weatherstation

That’s all.

Size of data on SD card is 5.9 Мb
Back way, was supposed must work just simple copy data from new place into old one and unlink.

But this way does n’t work on my tablet , so if you want to return data in original place I forced to uninstall app and reinstall it again.

(I should say application start is lower, so this may be reason not to use this method of saving memory).

Notice:

How to unlink symbolic link:

Launch Terminal, type the command unlink:

unlink /data/user/0/com.arf.weatherstation

If your device has not such a command do next.

First check the symbolic link by command

ls -l /data/user/0/com.arf.weatherstation

The answer should be:

root root 2022-08-04 16:46 com.arf.weatherstation ->/data/sdext4/com.arf.weatherstation

Type a command:

rm -r /data/user/0/com.arf.weatherstation.
3. Practical results.

I selected my not system apps with size of memory data more than 1 Mb and attempted to move them onto SD card.

I estimated the size of moved data should be 146 Mb

List of my apps:

First part of my apps with small amount of data size which there is no sense to move them:

Apk Analyzer sk.styk.martin.apkanalyzer (3.0.5) Not moved

	Data Dir:	/dat/user/0/sk.styk.martin.apkanalyzer		V=230.5k

Damumed ab.damumed (2.3.2) Not moved

	Data Dir:	/dat/user/0/ab.damumed					V=267.5k

Hacker’s Keyboard org.pocketworkstation.pckeyboard (v1.40.7) Not moved

	Data Dir:	/dat/user/0/org.pocketworkstation.pckeyboard	V=54.9k

Magisk com.topjohnwu.magisk.videop (1.2.0) Not moved

	Data Dir:	/dat/user/0/com.topjohnwu.magisk			V=493.2k

SD Maid eu.thedarken.sdm (5.3.18) Not moved

	Data Dir:	/dat/user/0/eu.thedarken.sdm				V=1.3Mb

Titanium Backup com.keramidas.TitaniumBackup (8.4.0.2) Not moved

	Data Dir:	/dat/user/0/com.keramidas.TitaniumBackup	V=647.4k

Titanium Backup Add-on com.keramidas.TitaniumBackupAddon (1.0.0) Not moved

	Data Dir:	/dat/user/0/

Total Commander com.ghisler.android.TotalCommander (3.33) Not moved

	Data Dir:	/dat/user/0/com.ghisler.android.TotalCommander	V=89.9k

WordHunt onedict.wordhunt.pwa (1.2) Not moved

Despite this it stopped to start

	Data Dir:	/dat/user/0/onedict.wordhunt.pwa				V=6.4k

XAPK Installer com.apkpure.installer (2.2.2) Not moved

	Data Dir:	/dat/user/0/com.apkpure.installer				V=28.5k

bGEO net.probki.bgeo (12.0.270) Not moved

	Data Dir:	/dat/user/0/net.probki.bgeo					V=134.0k

Terminal com.termoneplus (4.0.1) Not moved

	Data Dir:	/dat/user/0/com.termoneplus					V=1.2k

Second part of apps able to move data part on to SD-card:
Apk Inspector net.jevinstudios.apkinspector (5.3.0)

	Data Dir:	/dat/user/0/net.jevinstudios.apkinspector		V=6.6 Mb

CallApp Contacts com.callapp.contacts (1.966)

	Data Dir:	/dat/user/0/com.callapp.contacts			V=22.6 Mb

Vivaldi Browser com.vivaldi.browser (5.4.2760.26)

	Data Dir:	/dat/user/0/com.vivaldi.browser					V=20.2 Mb

Weatherstation com.arf.weatherstation (6.9.7)

	Data Dir:	/dat/user/0/com.arf.weatherstation				V=5.8 Mb

Third part of apps with moved data on to SD-card and which stopped to work:
MX Player com.mxtech.videoplayer.ad (1.48.12) Reinstalled

	Data Dir:	/dat/user/0/com.mxtech.videoplayer.ad		V=22.2 Mb

Errors: app doesn’t work.Screenshot shows a lot references to file com.mxtech.videoplayer.ad in root dir. The reason unknown.

Potplayer mediaplayerclassic.window.videop (1.2.0) Reinstalled

	Data Dir:	/dat/user/0/mediaplayerclassic.window.videop	V=4.8 Mb

Error: app works not correctly. By the end of show appears a message: “Application failed”

ReadEra org.readera (22.07.16+1670) Reinstalled

	Data Dir:	/dat/user/0/org.readera					V=19.3 Mb

Error: Decoding determination failed.

Repeat Player kr.co.darby (3.3.2) Reinstalled

	Data Dir:	/dat/user/0/kr.co.darby					V=4.7 Mb

Error: sometimes appears the message: “App Repeat Player failed”

WhatsApp com.whatsapp (2.22.17.76) Reinstalled

	Data Dir:	/dat/user/0/com.whatsapp						V=24.0 Mb

App didn’t start: Error

Fast notepad net.fast_notepad_notes_app.fasnotepad (7.10) Reinstalled

	Data Dir:	/dat/user/0/net.fast_notepad_notes_app.fasnotepad	V=5.0 Mb

Error: added information stopped saving in it!

Calculator++ org.solovyev.android.calculator (2.2.7) Reinstalled

	Data Dir:	/dat/user/0/org.solovyev.android.calculator		V=4.6 Mb

Error: Ability to open in floating window gone.

File manager+ com.alphainventor.filemanager (3.0.3) Reinstalled

	Data Dir:	/dat/user/0/com.alphainventor.filemanager			V=5.4 Mb

Error: app not started!

Full size keeped is equal to 55.2 Мb

  1. Conclusions: (I think, you may do your own one)

  2. The economy may be greater if one may move system apps, but no ability to restore the original status by moving the data dir back on original place is critical.

  3. I think idea using symbolic link must work if author did n’t use non standard tricks for solving its personal tasks.

  4. One may use custom ROM like LineageOS. But my Android does n’t allow unlocking bootloader, additionally I don’t know if init.d exists and may it be used for app link2SD?

  5. I am not sure the problem may be solved cause the vendor made such a version of Android 6.0.1 and locked any possible back door in device.

  6. Of course one may avoid this problem by buying more powerful device with large internal memory kinda 64 - 128 GB. But for me this break the bank…

Radmir

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.