[APP][ROOT] FolderMount - Link folders from internal SD to external to free space

Search This thread

madmack

Senior Member
This app has a lot of potential. I am using SGNII on CM 10.1 and tried linking the Camera DCIM folder so I can save photos automatically to the ExtSDcard. However, like smar I am able to read access from Source folder but not write. Hoping this would be fixed.

I would definitely buy the Pro version of this app once it comes out. Thanks dev for this!

could you or smar please provide the output of "mount" after a fresh boot (before running my app). I want to see the permissions, ownership before and after my app pins folders to be able to fix this.
 

cambr1an

Senior Member
Mar 9, 2013
89
17
Cabanatuan City
^I wish to be able to help but I do not know how to do what you are asking. Sorry for being a noob, but could you give detailed instruction on how I can 'provide the output of "mount"'? Thanks and sorry again for my being clueless.
 

smar

Senior Member
Aug 27, 2005
151
36
London
could you or smar please provide the output of "mount" after a fresh boot (before running my app). I want to see the permissions, ownership before and after my app pins folders to be able to fix this.

I've attached results for both pre and post mount below. Other than the new mount for the bound folder, the only difference seems to be in the remounting of the external SD Card.

i.e. the original mount for the external card reads:

Code:
/dev/block/vold/179:49 /storage/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

After mounting, this line reads:
Code:
/dev/block/vold/179:49 /storage/sdcard1 vfat rw,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

I wonder if it is the masks causing the problem - I recall you had issues with the 0702 masks in another forum and hence the remounting - or whether it is one of the other mount options.
 

Attachments

  • preMount.txt
    2.1 KB · Views: 56
  • mount.txt
    2.2 KB · Views: 46
Last edited:

madmack

Senior Member
I've attached results for both pre and post mount below. Other than the new mount for the bound folder, the only difference seems to be in the remounting of the external SD Card.

i.e. the original mount for the external card reads:

Code:
/dev/block/vold/179:49 /storage/sdcard1 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

After mounting, this line reads:
Code:
/dev/block/vold/179:49 /storage/sdcard1 vfat rw,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

I wonder if it is the masks causing the problem - I recall you had issues with the 0702 masks in another forum and hence the remounting - or whether it is one of the other mount options.

it seems the difference between internal's and external 's ownership is the culprit. There is an easy solution which is to relax the permissions and make the extsdcard globally writable. I hate to resort to this and would love to keep it as a last resort but I'll throw a few apks here for you guys to test before I resort to that.

Stay tuned. I'll give you guys something as soon as I get some free time.
 

smar

Senior Member
Aug 27, 2005
151
36
London
it seems the difference between internal's and external 's ownership is the culprit. There is an easy solution which is to relax the permissions and make the extsdcard globally writable. I hate to resort to this and would love to keep it as a last resort but I'll throw a few apks here for you guys to test before I resort to that.

Stay tuned. I'll give you guys something as soon as I get some free time.

Ok that makes sense. Thanks for all your efforts, and happy to test a new apk whenever you have some time!
 

madmack

Senior Member
attached is a test apk for those with no write access to the mounted folders.

1. install the attached.
2. reboot!
3. bind your folders.
4. see if write access is given to apps in mounted folders.
5. give me the results of the "mount" command again just to verify that everything is ok.

Edit: get it from OP. v0.1.1b should take care of the read/write issue.

Anybody can give me an example of a game that uses the obb folder? Free would be awesome :p
 
Last edited:

.xxx.

Senior Member
Oct 8, 2011
1,719
1,021
Mumbai
Eternity warriors for obb folder game and is for free..

Sent from my GT-I9300 using Tapatalk 2
 

cambr1an

Senior Member
Mar 9, 2013
89
17
Cabanatuan City
attached is a test apk for those with no write access to the mounted folders.

1. install the attached.
2. reboot!
3. bind your folders.
4. see if write access is given to apps in mounted folders.
5. give me the results of the "mount" command again just to verify that everything is ok.


It works! Thank you!!! :D
 

Attachments

  • premount.txt
    1.9 KB · Views: 74
  • mount.txt
    2.1 KB · Views: 66
Last edited:

StephenC82

Senior Member
Jan 10, 2011
289
30
Obb mounts now work as does writing to the bound apps.
Two quick suggestions. Confirm a deletion of a bind and being able to add more than 3 binds. I know you want this as a premium feature tho.
Thanks for the app tho it's working wonders.

Sent from my GT-I9300 using xda premium
 
  • Like
Reactions: madmack

madmack

Senior Member
Obb mounts now work as does writing to the bound apps.
Two quick suggestions. Confirm a deletion of a bind and being able to add more than 3 binds. I know you want this as a premium feature tho.
Thanks for the app tho it's working wonders.

Sent from my GT-I9300 using xda premium

thanks for the feedback. any suggestion for the number of free binds instead of 3?
 

smar

Senior Member
Aug 27, 2005
151
36
London
attached is a test apk for those with no write access to the mounted folders.

1. install the attached.
2. reboot!
3. bind your folders.
4. see if write access is given to apps in mounted folders.
5. give me the results of the "mount" command again just to verify that everything is ok.

Edit: get it from OP. v0.1.1b should take care of the read/write issue.

Anybody can give me an example of a game that uses the obb folder? Free would be awesome :p

Just did a quick test and write access seems to be working fine. Thanks for sorting so quickly!

---------- Post added at 03:01 PM ---------- Previous post was at 02:59 PM ----------

thanks for the feedback. any suggestion for the number of free binds instead of 3?

3 is very reasonable, and 5 would be quite generous of you!
 

chriscsh

Senior Member
Aug 13, 2007
1,065
77
Hong Kong
Anybody can give me an example of a game that uses the obb folder? Free would be awesome :p

Real Racing 3 :D

i just try the new version and setup the obb folder, seem setup and moving files fine, and have green pin
but when play Anomaly HD, and it said no data :(
my device is Galaxy Tab 2 7" P3100, with CM10.1
 

Attachments

  • mount.txt
    2.1 KB · Views: 36
Last edited:

StephenC82

Senior Member
Jan 10, 2011
289
30
thanks for the feedback. any suggestion for the number of free binds instead of 3?

I think for the time being three or four would be enough. But I understand that such a feature would be useful to gain paying customers, so I'm grateful for what you've already given us.

Sent from my ASUS Eee Pad Transformer Prime TF201 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 541
    Features of FolderMount:

    • Root is an absolute MUST. No root, no access to app.
    • Mount internal SD card folders to external SD folders.
    • Move content from internal to external when a pair is added. (Dialog prompt)
    • Support for Android 2.3 - 6.*.
    • Holo themed throughout and an intuitive GUI design.
    • It will check SDCARD mount status and remount if necessary.

    Why would you need this app?

    Today some apps store big files over the internal SD card (e.g. Games, Podcasts, Offline RSS feeds, Pictures, Offline navigation software). Typically users have a small internal sd card size (~16GB) while the external SD is a lot bigger (~32-64GB). Most of these apps don't have an option to use the external SD card to store data so they starve your internal SD card memory. I'm bringing this solution to fix this issue. In my case, I use this app to mount offline navigation software and some GameLoft games (NFS anyone?).

    Doesn't this do the same thing as previous apps?

    There are a few apps that already do this. However, my app differs in that:

    a) Some of the existing apps aren't maintained anymore. FolderMount will be maintained by me as we go forward.
    b) While most of the previous apps work properly in most cases, I found them not very intuitive to setup initially and were lacking some necessary "sanity checks" before linking folders. I intend to keep this app as intuitive and bug free as possible.
    c) Support for Android 4.2.2! No app will currently do that for you, so here it is. (dev talk: this uses the debuggerd service trick to get it to work).

    Users that buy the premium key will get:
    • Unlimited folder pairs (free version has a limit of 3).
    • Ability to mount any subfolder in the internal sdcard. (free version has restrictions on Android obb and data folders)
    • Get to see the folder sizes in root explorer
    • Support the developer and make him very happy :D

    Mini how to
    1. Click add to add a folder pair
    2. Select a source directory that you want to move files from. This should be somewhere in your internal sdcard. Usually located at /mnt/sdcard
    3. Select a destination directory that you want to move files to. This should be some folder in your external sdcard or OTG drive.
    4. FolderMount will offer to move the files to the destination. Click yes.
    5. After the moving process is done, click on the pin. If the pin is green, you're all set.
      Note: The files will appear in both the source and destination after pinning them. This is normal as the files that you see in your internal sdcard are actually located on your external sdcard. This is how FolderMount "tricks" apps that don't have the ability to save explicitly to the external sdcard.

    FAQ

    Please do read the FAQ before asking questions in this thread. If your question is ignored, it is most likely because the answer to it already exists in the FAQ.

    Note to users complaining about FM not working in KitKat with custom ROMs. Before asking any questions or complaining that FM does not work, have your kernel dev (or ROM cooker) look HERE


    Screenshots:

    1-small.png
    2-small.png
    3-small.png
    4-small.png
    5-small.png
    6-small.png
    7-small.png


    Video tutorial(s):

    1. by KiaTheKing

    Translations:

    Want to have FolderMount in your language? Help us by joining our crowdin project. More information here: http://www.devasque.com/foldermount/translations.html

    Bug reports:

    FolderMount version 2.2 and up support an integrated bug report and submission capability. Use the feature in the Settings menu to submit bug reports.

    Changelog:

    v2.9.11 (6/26/2016)
    • Broader compatibility with Samsung M devices

    v2.9.9 (6/7/2016)
    • Added Android Marshmallow compatibility
    • Android M support for Moto devices (disable sdcardfs module)
    • Cosmetic changes to copy notification (no more white text on white BG)
    • Root dialog has a clear check mark (or x mark if root was not granted)
    • Destination is sometimes not there, FM doesn't ask you to move files back when you delete that pair
    • Ask permissions to write to external sdcard using Storage Access Framework. Copy operations should work now in Android M
    • Initial support for Samsung devices running android M. A patch will be offered to replace two files. If your /data partition is encrypted, you will lose all data on it! There is no way around that at the moment. Once you factory reset, FM should work fine and you'll have AOSP encryption which TWRP can decrypt
    • Migration to new Android M permission granting model. FM will ask you for permission only when it needs these permissions


    Rest of changelog



    Disclaimer: This app does not guarantee functionality in any way, shape, or form. It is not my responsibility if this app does not work, breaks your sdcard or eats your kittens. User discretion is advised.
    23
    OK guys. Here is your first beta for MM. Please test it out thoroughly and report back ! It seems to work fine on my device for now.

    Warning: The copy/paste functionality is not thoroughly tested. Please do not use the FM copy/paste operation (from source to target, when offered) on your precious family photos/sensitive data. This warning is only for users running Android M. The rest of you should be ok.

    1. FM will ask you to kindly grant it access to the root path of your external sdcard on first launch. Do that.
    2. SuperSU by Chainfire is a must

    If you fulfill these two requirements, everything should work. I also added some minor cosmetic changes to users on Android M. The notification's "moving files" text shouldn't appear as white anymore.

    Enjoy and don't forget to report back on your experience.
    17
    Sorry guys it's been a while since I wrote (two months?). That is really because I am get swamped with work/life that I have very little time to dedicate to FM. Unfortunately the changes that Marshmallow requires are not a few lines of code. This is especially true given Samsung's recent mess with their M firmwares. Anyway, I have been working over the last week in whatever little time I have in my days to fix these issues and v2.9.3b is the result of this work. Change log is as following:

    • FolderMount copy operation has been improved immensely. Copying the entire Whatsapp folder (2.9G) in my device took about ~7 m instead of 2 days ! The reason why FM was so slow copying was because of the recent migration to SAF (Storage Access Framework) which Google is enforcing in android M. This new framework has many bugs, some of the methods they supply are extremely slow and inefficient so I took my time profiling these methods and optimizing them. I think this is acceptable at the moment. The only "slow" thing in my framework is the initial population of folder content. If you have a folder of 1000+ files, this operation might take ~10s but everything else is relatively acceptable.
    • Samsung ! You are killing me. This version is tested and working with Android M on the S7 edge. The previous beta version shipped with arm x64 binaries, hence why it didn't work on some of the earlier samsung phones. This one ships with the correct arm binaries so in theory it should work correctly with all Samsung ARM based devices 32/64bit.
    • Samsung: here is a big fat warning and there is very little I can do about it: If you accept the patches that FM proposes and your /data partition is encrypted (which is the default) then all your data and settings will be lost and you'll have to reformat your internal sdcard! Why you might ask? Well, I need to get rid of the custom fuse module that Samsung implements. Their fuse model is linked with the proprietary encryption tool they use. If I want to replace their proprietary encryption algorithm, I need to restore the AOSP encryption tools and there you go. Once you format your /data partition (either in recovery, or by simply rebooting), everything should work fine from that point on. You will end up with the AOSP encryption which, by the way, TWRP can decrypt.
    • exFAT ? No problem ! The new binaries support exFAT so at least your external sdcard don't have to be formatted too !

    Please test. Sorry if I didn't reply to any of your posts. I barely had time to put this in.

    I'll look at feedback on this beta in case something terrible happens ! So please keep posting your feedback in any case.
    14
    I actually did have a bit of time today and I got most issues worked out:
    • App now uses DocumentFile APIs to access external sdcard. Basically FM can now write to your external sdcard in MM. A lot of changes to the framework had to be incorporated here. I still have to "clean up" some of the code and make the write-access granting scheme a little more intuitive. Yes, you will have to explicitly grant access to the root directory of the ext_sdcard to FM.
    • Some commands changed in MM: Tools like "mount" have moved from "toolbox" to "toybox" (Thanks Google!!) so FM correctly adapts to this new change.
    • Mounting and unmounting works as long as you have SuperSU and not any other root app.

    One issue remains. Although the folders are mounted correctly, non-rooted apps aren't able to write into the target. The reason is the newly set permission (umasks) on these external sdcard mount points. It could be an issue that is local to CM-13.0, which is what I'm basing my work on, or the NTFS filesystem which is what my sdcard is formatted to. I need a bit more time to debug these problems and will post a beta APK once these issues are worked out.

    As always, no ETA. Just stay tuned.
    14
    Newly baked version is out. v2.9.4b addresses some of your comments so thanks for your invaluable feedback !

    • Fixed the ugly switch. No ugly artifacts anymore.
    • More optimizations to the SAF (Storage Access Framework). Copy operations should flow smoothly now.
    • Fixed a bug were if destination folder doesn't exist and you delete the pair, FM asks you to move files back to source. It now doesn't.
    • Android M? FolderMount will now not let you use the app unless it has the proper access rights to the external sdcard root path. If you give FM any other folder, it'll just keep popping the same dialog again until you do so. This is critical because a lot of the functionality of the app -such as the file browser- depends on this critical step being done correctly.

    As always, your feedback is very important. I am particularly worried about these versions breaking compatibility with pre-M releases of Android. I haven't tested that at all in these beta releases given that all my devices now have Android M. :cool: