ts-binds binds two different folders on your device so that both folders share the same contents
I am stopping development because I no longer use a device with an SD card slot. While the project may be revived in the future should my new device has an SD Card slot, consider using a much more worthy alternative fbind
Please delete /data/ts-binds
, uninstall module and reboot before updating.
This is a huge update as a lot of the core code has been changed drastically. Please have a look at the changelog below for more information.
Essentially, this "binding" method is widely used to save space on internal storage!
Derived from a very long-living trick for users who are struggling with the internal storage space available on their phones, while at the same time has the benefit of inserting an SD card, ts-binds will make use of already available functions on your device, to mirror a path to another path, effectively making both paths indistinguishable.
For example, if you mirror the Download
folder on Internal with the Stuff from Internet
folder on your SD Card, the same list of cat pictures will be shown on both directories when navigated via a file manager, and any changes will take effect on both paths.
This saves space because the files physically reside on the external storage instead of internal storage.
- Magisk Stable version ≥17
- Beta and Canary version not supported
- Android version ≥ 5
none
- Further Reading (Documentation)
- XDA Developers thread
- → DOWNLOAD ZIP (Also available in Magisk Repo)
- GitHub
- Changelog
- Verbose changelog (commit history)
Updgrade Notice
Please delete /data/ts-binds
, uninstall module and reboot before updating.
Regressions
- Magisk version <17 is no longer supported due to template change
Additions
- New binding algorithm to support sdcardfs!
- SDCardFS seems to rely on
/mnt/runtime
mountpoints. The key is to set the bind paths from there, but the binded mount needs to be remounted with propergid=9997
andmask=6
, thus making legacy/storage/emulated/0
play nice with the permission of the binded folder - It is assumed that as of Oreo, SDCardFS implementation is already mature. Hopefully this algorithm persists for long!
- Binding algorithm will also mount other runtimes if Android do not do it automatically
- SDCardFS seems to rely on
- New
$obb
variable to ease things in folderlist- OBB binding is dealt with the new algorithm
- Detection algorithm if legacy mode (for FUSE) should be applied on your device
- Behaviour can be altered by using the new
mode
parameter for tsbinds. Runtsbinds help
in terminal for more info
- Behaviour can be altered by using the new
- ts-binds is now licensed with ... Unlicensed! Read LICENSE file for info
Modifications
- Update minmagisk to version 17.0
- Rename
disable.txt
todisable
- No longer output to log file if ts-binds invoked from terminal. Parent process needs to manually pipe to a file
service.sh
output is redirected to the original log file- This means that the log only represent the automated process of bind mounting when the system boots.
service.sh
will finish if SD Card not found in 60 seconds.- Previously the script will infinitely loop
- Code refactor
Additions
- New
mount
parameter to output the system's mount entries. Commandtsbinds mount
is to execute in shell - New
pairs
parameter to output the pair names in thefolderlist
. Great to do quick revision. Commandtsbinds pairs
is to execute in shell
Fixes
- Fix the mount namespace issue - now binds and unbinds take effect the way it should be!
- All the commands are now passed through
su -M -c
to take effect on the global namespace.
- All the commands are now passed through
Modifications
- Change to use busybox
- Uses hardcoded PATH towards the busybox folder
/sbin/.core/busybox
- Uses hardcoded PATH towards the busybox folder
- Uses hardcoded path towards module directory
/sbin/.core/img/ts-binds
- Was
/magisk/ts-binds
but /magisk is a symbolic link towards above path - I know, hardcoding paths is not recommended by the Magisk documentation, but the module goes forward by Magisk's new version. The reason I had to do this is because there is no other easy alternative to find module's dir other than extreme measures of loopdevice mounting or looping through countless number of directories from root. So instead of taxing the shell during boot, I prefer not to do that instead.
- Was