Apps2SD All in one tool[2.3+]: Partition SD card and Move/Link Apps to SD card [ROOT]

Did Apps2SD help you?

  • Yes

    Votes: 460 74.6%
  • No

    Votes: 63 10.2%
  • Didn't try

    Votes: 94 15.2%

  • Total voters
    617
Search This thread

dimstrdan

Member
Dec 22, 2019
7
1
Hello! Why is it not possible anymore to read/write into /data/data (internal data) on Android 11? Also foldermount can't read internal root of Android 11? Anyone has a way to fix this?
 
  • Like
Reactions: aston.w
Great App, i am using it for a long time now but i have a problem when rebooting.
Everytime I reboot my device, SWAP gets reenabled and all my folder mounts are off. It's really a pain to always manually change these settings after a reboot.
I already tried it with scripts that disable SWAP on boot, but somehow they won't get executed (if i trigger it manually it just works fine). And even if that would work, there are still the folder mounts.
Is there a way to fix that??
 

juandante

Member
Jan 4, 2018
23
1
In a nutshell u can follow these steps:

Description of the use of Apps2SD on Xiaomi phones

1. We have a Rooted Xiaomi Redmi Note 5 Pro phone with Magisk installed and custom recovery (for example Orange Fox 10.1) and MIUI 10.3.1.0 firmware Android 9 stable. How to organize full Android access to a flashcard is not discussed here. BusyBox must be installed on the system.

2. Since we will use the 2nd partition with the f2fs file system on the flashcard, we need to install a custom kernel with support for this file system (I don’t know if the stock kernel supports this file system, I don’t use it!). I am using the Ancient-EAS kernel which can be downloaded from the link Click here!... Install the kernel in the usual way as a zip archive through custom recovery. After installation, you need to boot into the system and reinstall Magisk, then reboot, this will increase the overall stability of the system!

3. Next, you need to install a Magisk module called Init.d Injector from the Magisk repository.

4. After that, we reduce the size of the first partition of the flashcard and create a primary second partition there and format it for the f2fs file system. I am using a 128 GB flash drive, the second partition is 32 GB.

5. Boot with the repartitioned flashcard, launch Apps2SD and mount the second section of the flashcard. The section should mount perfectly!

6. In the Apps2SD settings, in the "Set path su.d ..." parameter, set the path data / adb / post-fs-data.d

7. Check the box for "Get sleep ban"

8. Check the box "Use CP instead of RSync" ...

9. Check the "Backup Apps2SD database" checkbox.

10. The "Restart Apps2SD service" checkbox should be ticked.

11. After that, go to "Bind applications to SD card" and select "Recreate mount script". Select the f2fs file system and select the item "My device supports init.d" and create a script. To be honest, I didn’t create any scripts until I ran the mounts, I don’t know where, when and what scripts are created, so you can go through all the points for reliability, but you should create everything when you select init.d.

12. Find and save the scripts 00000000apps2sd-main.sh, 01apps2sdinit, apps2sh-mountscript.sh in the data / adb / post-fs-data.d and data / adb / service.d folders, and then give these files permission 755. Trace to give apps2sd permission 777 in the data / adb folder.


13. That's it, you can reboot the phone, the 2nd section of the sd card will be mounted at boot, you can go to Apps2SD and move custom applications to the 2nd section of the sd card!

NB: this was translated so caution is advised

I think those pseudo tutorials are complete bullsh*t. They explain how to activate the app but not how to recover from the many problems that the app will cause later like force closing apps, losing apps, etc.

I moved 10+ apps from a very old phone a very old Galaxy Note 4 with Android 6.0 and gosh, App2SD was creating complete mess with constant app crash. I removed all bits of Apps2SD and phone was working great again.

And there is no sort of help in the app, with parameters that doesn't mean anything (like SD Fix, what does it do ? or even again what I put in bold in your translated post) and there is no integrated troubleshooting.

And on Android 7+, it seems to have a lot of problems too. To sum up, this app is a magnet to trouble. I think it can be made better if it was not so opaque and had some real help and explanations in the app.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,086
426
Portland, OR
I just did a short test of Apps2SD on Android 11. Linking apps works, mostly. For me, they don't disappear after reboot, and I don't get a soft reboot error.

Specs:
Galaxy Tab S7+
Latest stock Android 11
Rooted with Magisk v23

When creating the mount script, it fails if I try the Advanced option. But if I set the mount script path to /data/adb/service.d, it works. I also told it not to modify system partition.

As for the actual linking of apps, everything works except linking obb. With that I just get an error. My workaround is to use Riru, LSPosed, and XInternalSD. Then I can move obbs to 1st partition of MicroSD (not 2nd, which Apps2SD uses), apps still load fine. You need a root file manager to do this, I use Root Explorer.

My 2 cents...
 
  • Like
Reactions: Unreal_Hawkz

Numatu

Member
Aug 11, 2021
18
1
"Device stuck in bootloop after creating mount script using the "Advanced method""
I've this problem with my note 8 Android PIE. I apply The solution e the phone restart. After I try to recreate the script with normal but after the phone go to bootloop and if i try the same solution it say no such file or directory!!!
 

Numatu

Member
Aug 11, 2021
18
1
Sorry I'll try to explain better. My Samsung note 8 (android pie), have a partition, with many app linked. I had some problem with them, so I try to recreate the script, with "Advanced method" that worked fine untill than. But Device stuck in bootloop after creating mount script using the "Advanced method". So i tried to resolv the problem with a solution finded in the site "https://www.apps2sd.info/kedb.html" a the title " Device stuck in bootloop after creating mount script using the "Advanced method" ". So the device restarted and this time i try to recreate the script with "Normal method" but device go again in bootloop but this time i tried again the solution but it didn't work and terminal says so.....
 

Attachments

  • WhatsApp Image 2021-11-27 at 13.21.50.jpeg
    WhatsApp Image 2021-11-27 at 13.21.50.jpeg
    176.7 KB · Views: 14

AnonVendetta

Senior Member
Apr 29, 2016
1,086
426
Portland, OR
Sorry I'll try to explain better. My Samsung note 8 (android pie), have a partition, with many app linked. I had some problem with them, so I try to recreate the script, with "Advanced method" that worked fine untill than. But Device stuck in bootloop after creating mount script using the "Advanced method". So i tried to resolv the problem with a solution finded in the site "https://www.apps2sd.info/kedb.html" a the title " Device stuck in bootloop after creating mount script using the "Advanced method" ". So the device restarted and this time i try to recreate the script with "Normal method" but device go again in bootloop but this time i tried again the solution but it didn't work and terminal says so.....
It looks like you're trying to unset the immutable and append attributes on vold. And then copy vold_apps2sd, but with the name of vold. But it's not letting you, because the file doesnt exist.

In TWRP, mount system partition, open file manager, go to /system/bin/, do you see more than one vold file? And what are their names?

Are you able to boot into Android? Or just TWRP?
 

Numatu

Member
Aug 11, 2021
18
1
It looks like you're trying to unset the immutable and append attributes on vold. And then copy vold_apps2sd, but with the name of vold. But it's not letting you, because the file doesnt exist.

In TWRP, mount system partition, open file manager, go to /system/bin/, do you see more than one vold file? And what are their names?

Are you able to boot into Android? Or just TWRP?
just TWRP
 

Attachments

  • WhatsApp Image 2021-11-28 at 12.51.04.jpeg
    WhatsApp Image 2021-11-28 at 12.51.04.jpeg
    103.5 KB · Views: 11

AnonVendetta

Senior Member
Apr 29, 2016
1,086
426
Portland, OR
Rename vold to voldbak (actually it doesnt matter if it is bak or anything else), then rename vold.original to vold. Then try booting into Android. If it works, you can delete voldbak. Apps2SD possibly replaced your vold file with something that isnt compatible. The vold.original should be the one your Android had before the app made any changes.

Before you rename the files, run this in a terminal:

sha1sum /system/bin/vold
sha1sum /system/bin/vold.original

Is the same value reported for both files? Or different? Same values means the files are identical, different values means the opposite.
 
Last edited:

Numatu

Member
Aug 11, 2021
18
1
Can i copy that file somewhere, for security?
I don't find the size, but if i order the files by size they are in different position
 
Last edited:

Numatu

Member
Aug 11, 2021
18
1
GREAT!!!!!
It restarted!!!
Thank you, Thank you, Thank you very much.
May i ask you another help. i would repair the partion and the applications linked.
How can i do this?
 

AnonVendetta

Senior Member
Apr 29, 2016
1,086
426
Portland, OR
GREAT!!!!!
It restarted!!!
Thank you, Thank you, Thank you very much.
May i ask you another help. i would repair the partion and the applications linked.
How can i do this?
I have no idea how to repair the partition and get the apps relinked.

If you are rooted with Magisk, I suggest you try mounting 2nd partition with a service.d script instead of advanced option. No chance of messing up system files that way. And dont allow it to modify system partition when creating mount script.

Advanced option works on my Marshmallow phone, but it doesnt work on my tablet that runs Android 11. Magisk script works fine.
2021_11_29_05.07.45.png
2021_11_29_05.08.55.png
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Sorry to hear about your data loss due to messing with AS. I know how that feels.

    Thanks for your explanation of how AS works. Already having read many pros and cons about it, I'm still lamenting if how AS works is really what I want. Esp. because of the way migrating works - that I can't choose what is getting migrated but am forced to migrate everything. I initially had thought AS would only merge the SD card into Internal Storage, and not also move /data/apps and data/data hidden in the background. Esp. since hardly and app works if run from AS anyway and I had to enable a switch to install and keep apps on internal. I think much rather I'd prefer to have all apps and data on internal by default, and continue to choose willingly via XinternalSD and root Symlinks what exactly to move to SD card.

    Re. backups: very good points - here's how I've been doing it:

    1. backup via TWRP -> images to PC
    2. phone booted into Android & connected to PC: manual copies of Internal and SD-card's folders/files -> PC
    3. with SD formatted as AS: SD-card via adapter into PC then 1:1 RAW clone saved as compressed image

    The path to folder with the encryption keyfile in /data/misc/vold is great to know - I just backed the entire folder up :cool:
    Get rid of adoptable storage while you can, go back to what Android calls "portable storage".

    Unfortunately LOS won't let you move apps to SD if you're not using AS. This is where Apps2SD etc come into play. I think pretty much all LOS/AOSP/CM based ROMs are like that these days. If it's a stock OEM ROM, you may or may not be able to move apps to SD without AS. Samsung is famous for not supporting AS in most of their firmwares, while still allowing apps to be moved to SD.

    Deeper explanation of AS:

    Android formats your SD, creates AS partitions, and encrypts them. If you choose not to migrate your data, the SD is still considered separate from internal storage. But once you choose to merge, your SD becomes the internal storage that you would normally have access to (usually at /sdcard/ or /storage/emulated/<User#Here>). Another part of the AS SD partition is designated for app storage, but the files there can't be accessed directly without root. Also, once merged, your internal storage becomes effectively managed/owned by Android. I don't recommend AS for devices that have more than 128GB internal storage, for the reason that you're kind of forfeiting control to at least a part of that storage. A selling point of AS is that it gives you more space for apps and data without having to manage seemingly separate internal/external storages. It just makes everything look like it's all in one place. If your device has a lot of space, AS isn't so useful.

    As for whether apps are stored on the real internal storage (in the the data partition), or on the fake AS internal storage (on SD), that's also managed by Android. You can still manually choose to move certain apps back and forth as you wish.

    In short, Android takes control of your data partition and allocates a certain portion to you via AS, all the while making it look like your AS SD is internal when it's not. The finer details are managed invisibly in the background. AS is designed to be user friendly ("for dummies"), but I'm a geek and prefer a higher level of control. I feel that AS is less suitable for that than regular portable storage.

    As far as the encryption benefits, it also has a slight performance hit. Apps ran from the AS SD will never run as fast as they would if they were located on the "real" (data partition) internal storage. By choosing to move an app to SD, you're selecting the AS SD, and moving to internal puts it back on the real internal storage. But anyway, back to encryption....any attacker with access to that golden key file (via root or TWRP, since there's no other feasible way to get at it without elevated rights) will just be able to unlock your AS SD and they have everything. They can even plug the SD into a PC running Linux, and use the key file to unlock and mount the partitions.

    I think Android encryption mechanisms are highly overrated, and they have been demonstrated to have numerous security flaws that makes it easy for an attacker to bypass and have your data. I never store truly critical files on my phone (the ones I wouldn't want anyone seeing), just the stuff I wouldn't care if they got to. As an alternative, you could individually encrypt your important files with (preferably open source) software. Or you could store them in encrypted container files like what EDS (app) can create. Then you would still have the benefit of encryption, and it would be more fine grained, instead of having the entire data partition/AS SD encrypted. Even if an attacker got to these files, they wouldn't be able to use them without either knowing the password, or cracking it via brute force.

    I find that encryption methods/softwares on PC are much more reliable and secure than Android's encryption mechanisms. I'm actually very much pro-encryption and use it alot. But I don't like the ways that Android implements it. On PC, most of my partitions are encrypted, except those that shouldn't be for various reasons.

    It looks like you already have a good backup plan, not much to say there. So you already know that AS cant be normally accessed on PC without using Android as a go-between. It's also smart that you cloning the entire SD in raw mode. That way it doesn't matter if it's encrypted or not. I'm assuming you're aware of command line tools like dd that can copy in raw mode. A downside of raw mode copying is that it can take a long time to backup/restore.

    So, to end this post:

    1. Continue using AS just as you are now

    2. Continue using AS, but use it in "mixed mode" instead. By default AS will format the entire SD. With mixed mode you can create a 1st portable partition that is clear/plaintext. And another that AS will use for app/fake internal storage. This setup is almost the same as AS in regular/non mixed mode, but it gives you an extra partition that isn't encrypted. You can use the unencrypted partition for regular file storage, while letting AS use the other partition for apps. And of course the AS partition will also have its' fake internal storage you can use for storage too. A downside of this is that you might encounter the issue of only being able to access the portable partition in TWRP, while not having access to the AS storage. Or at least, that's what happened when I tried mixed mode on my older phone. For more info Google "adoptable storage mixed lidicott". You will find a blog post detailing how to create AS partitions in mixed mode.

    3. Go back to regular portable storage. For this I'd recommend a 1st partition that is either formatted as exFAT (if you need to store files larger than 4GB, or if the partition will be bigger than 32GB) or FAT32 (less ideal). For the 2nd partition, it should ideally either be formatted as ext4 or f2fs (so that Apps2SD can use it for linking). Now you have the flexibility of app linking, while using fbind and XInternalSD to the fullest when necessary.

    Another word about encryption: Physical access is king. If an attacker can physically access your devices, they have already done much of the effort required to get at your files. Never leave your device unattended, never let it out of your sight, never let anyone use it if you don't know them very well. And if you're not using it for an extended period, turn it off if feasible. I'm extremely paranoid in regards to who gets to access my device, I oftentimes won't even let my girlfriend use certain devices. Or if I do, I give access to a clean, sanitized "safe area" where nothing important is stored and they have extremely limited abilities in terms of what they can access. Or I will designate a certain device as "for use by others", unencrypted and with nothing important on it. These days an attacker with high level access can just access the powered on device, dump the contents of your RAM while the encrypted partitions are mounted. Then they take the RAM dump and analyze it for encryption passwords, keyfiles, or anything else that the encrypted partition may have temp-stored in RAM. An attacker can also do a so called "cold boot" attack. In this scenario they get accessible to the device shortly after it's powered off. They then have a time limited window (usually less than 5 minutes) in which to access the RAM and dump a copy. RAM still retains its' contents for a short time after power off before being fully flushed. Obviously these methods won't work everywhere, there are different types of encryption. And none of this will stop an attacker if they can establish remote access to your device while it's on.
  • 165
    Hi all,

    This is my first post in XDA but I've been a regular reader as a guest. I've developed an app(Apps2SD) to move/link apps from internal storage to external SD card with lots of other cool features.

    Apps2SD has evolved from being an app which moves app data to sd card to an all in one app with many cool features.

    Translation project http://os3pxnq.oneskyapp.com/collaboration/project/54276

    Apps2SD Translation Thread

    Tutorials @ https://www.youtube.com/watch?v=-4q5HAHJblI&index=1&list=PLiRFJHKSKUX_q0hsN0oHn4iXGoloJku5s

    Prerequisites:
    • Device needs to be rooted
    • Root permission should be granted to Apps2SD
    • 2 partitions on external SD card (use Apps2SD partition tool to create 2nd partition). 1st partition should be FAT/exFat partition, this is your standard SD card storage. The second partition is used as the internal storage for linked application files and can be ext2, ext3, ext4 or f2fs.
    12
    Version 12.2 released in play store and attached in OP

    Changelog:

    • Updated translations
    • Fixed Partial link issue on app install/update
    • Fixed obb/ext data linking issue
    • Added sd card support for Swap files
    • Added option to disable Apps2SD service
    • Added option to delete broken symlinks
    • Added revert SDFix option
    • Added full magisk support
    • Added custom su.d path support
    • Added display size in Folder mount
    • Added background copy/move in Folder mount [Pro]
    • Added search option in App analyzer [Pro]
    • Added link type sort
    • Other bug fixes and performance improvements
    11
    Version 12.0 released in play store and attached in OP

    Changelog:

    • Added App analyzer to create Folder mount pairs [Pro]
    • Added option to create hibernate shortcut [Pro]
    • Added app selection in restore apps [Pro]
    • Added option to link apps above a certain size [Pro]
    • Fixed SDFix for Marshmallow and Nougat
    • Performance improvement upto 10 times in creating backup and restore
    • Fixed many partition tool issues
    • Fixed bug in Hide apps
    • Fixed app crash in LineageOS
    • Added confirmation before moving files in Folder mount
    • Added support for Magisk interface
    • Improved mount script
    • Added wake lock option
    • Fixed bug in broken app cleaner
    • Made sdcard path dynamic in Folder mount
    • Many other bug fixes and erformance improvements
    11
    First of all I'd like to thank all of you for the continuous support you've given me. After evaluating all the Pros and Cons I have decided not to continue development and support for the the app. I know many of you will be disappointed but trust me it was a very tough decision for me. I have spent countless hours on research, development and testing the app and I'll always be proud of it.

    PS: I'll be releasing the final build for free version (with pro features) tonight on play store, hopefully they don't suspend the free version as well.

    Update: The apk is updated in play store and attached in the first post