yashsingh1/xdaforums huggingface dataset:
[Android Software Development] DualJoe:
If i bind mount the folder this happens. 'Root Explorer' (and all other apps) have empty obb folder and corrupt permissions. My guess is that the abstraction of /data/media/obb through FUSE doesn't like the vfat permissions. It results in missing 'X' permissions (on folders(!) not files). 'X' on folders is not executable(!) but accessable(!) thus the folder looks empty indeed (not accessible).

mount -o bind /storage/sdcard1/obb /data/media/obb

(mount -o bind /storage/sdcard1/obb /sdcard/Android/obb)

(mount -o bind /storage/sdcard1/obb /data/media/0/Android/obb)

(mount -o bind /storage/sdcard1/obb /mnt/shell/emulated/0/Android/obb)

Edit: One explanation could be (if FolderMount really has no problems with the above situation) that it spawns a shell (or mounts) directly from Java/DalvikVM that is in a different mountspace than 'ADB shell' or init.d.

If i bind mount the ext folder to /sdcard/Android/obb nothing happens. The apps still see the original obb folder on internal sdcard (probably due to different mountspace).

Edit2:

Here are the permissions how they are seen by apps after above mount. Notice the missing 'X' permission. Probably the result of FUSE directly pushing VFAT permission bits to EXT mask.
[Android Software Development] egingell:
I don't have that problem. And the fact that you have a file named sdcard1-obb suggests that you have typoed something and that you are trying to mount a directory to a file.

Sent from my SGS4.
[Android Software Development] DualJoe:
Everyone has this problem since this is how recursive slave mountspace is working now in Android 4.2.2 due to multi user accounts. That's why i'm asking how FolderMount solved this. See here and here.

That's intentionally created to identify the folder.
[Android Software Development] egingell:
Oh, I see what you're saying. FM uses debuggerd to mount and dismount.

Sent from my SGS4.
[Android Software Development] madmack:
yea, i had that happen too. I guess I finally need to implement an explicit delay on boot feature after all. I need to think about it :rolleyes:

FolderMount runs the debuggerd android service to mount all folders in Android 4.2.2. It also binds /data/media/<user id> instead of any symlink in /storage/* or /mnt/ or whatever if your sdcard shares the same partition as /data as is the case in most of these newer 4.2 devices. With debuggerd uid and gid execution rights and /data/media as the source, binding works fine.
[Android Software Development] DualJoe:
And this goes by api functions only or is it possible with shell commands (mount..) as well?
[Android Software Development] egingell:
You can do it with shell scripts. Look up [MENTION=2872010]rootSU[/MENTION], he has such a script.

Sent from my SGS4.
[Android Software Development] madmack:
strictly shell. just make sure you put a fat delay if doing it via an init script.
[Android Software Development] DualJoe:
Thanks.
[Android Software Development] DualJoe:
The debuggerd method is kinda dirty, too much sleeps, starts, stops, whatsoever. I think i've found a cleaner method by tweaking umasks so it passes FUSE with proper permissions.

The only concern i have is what happens with the bind folders on shutdown? If i detach the sdcard the way its meant to be done by Android settings only the main mountpoint vanishes (or anything in vold.fstab) not the bind mounts thus i think they won't be gracefully unmounted at shutdown either. And not unmounting vfat/fat32 is probably a very bad thing.

Do you know anything about how Android4+ handles this? I will take a look tomorrow in the kernel ramdisk. Maybe i can gather some more informations there.
[Android Software Development] danarama:
Yes it is dirty. The sleeps etc may not all be necessary. At least; they may be reducable. It's all in beta right now so I was just using safe testing times in there. That said, there was never that much interest in it and it can be a bit complicated for noobs so there wasn't a lot of point getting to deep into it.
[Android Software Development] siraltus:
Yeah, it made me stop using FolderMount altogether cause I can't have my SD card disappearing randomly. I now only manually mount a pair for a particular game I want to play, otherwise it stays disabled.
[Android Software Development] madmack:
FM uses the umount broadcast events to manually un-mount all entries when the sdcard is ejected/umounted and remounted when inserted/mounted again.

On shut down, on 4.1 devices, FM is quick enough to unmount all pairs. In 4.2.x devices, it isn't so the paths are still mounted when the phone shuts down.
[Android Software Development] DualJoe:
I guess I will use this to unmount properly.

http://xdaforums.com/showpost.php?p=10979424&postcount=61
[Android Software Development] madmack:
Looking good :good:
[Android Software Development] bsoplinger:
Wouldn't it be useful for a Tasker hook, a way to ask that all binds get removed, along with the inverse of all binds get created? Or does Tasker suffer from not being quick enough to fire off events at shutdown? Can't an app signal the system "please wait until I say" and get to do its shutdown magic completely?

Just random thoughts on the problem.

Sent from my Nexus 7 using Xparent Purple Tapatalk 2
[Android Software Development] lclaudiogb:
4.1.2 working good, 4.2.2 reboots!

Foldermount was doing really great moving my large game data to ExtSdCard while my Xperia ZL was running JB 4.1.2. Now unfortunately after my phone updated to 4.2.2, on trying to mount pairs, all I get are reboots.

The only way to stop the reboots is to try to acess Foldermount as soon as the phone starts, access the app and untick MOUNT ON LAUNCH.

Is anyone experiencing something like this on Xperia phones, specially Xperia ZL or Z?

Please answer cause the app is fantastic but I can´t use it now.

THX!
[Android Software Development] madmack:
apart from actually overwriting the shutdown script with a shell script, I don't see anyway to do it. A Tasker plugin won't help in the case either unfortunately because it runs on Android APIs that do timeout and risk incompletion at shutdown.

http://xdaforums.com/showthread.php?t=2317432
[Android Software Development] pyler:
maybe you can write Xposed module which will hook function which starts after pressing "Power off" (it will execute your code and then run original shutdown code)
[Android Software Development] madmack:
it'll require xposed being installed. no can do.
[Android Software Development] lclaudiogb:
I´ve read the thread a bunch of times and although I´m not a total noob here, I find it a little complicated cause I don´t have any issues with system R/W e.g. using root explorer or any other app which requires root access and needs to mount R/W, definitely no reboots. On the other hand, the only app that gives me reboots on mounting is FolderMount.

Does this fix will work in this case as well cause I really don´t want to mess my ZL at all?

Thanks again!

P.S: In order to check things, I tried to use another app that is intended to do the same function FolderMount does and on mounting, I got the same damned reboot.

The one I would like to use is FoldermMount cause I´ve purchased the PRO version.
[Android Software Development] aviwdoowks:
Use Tasker to autostart FM (unmounted) then manually mount. UTS>60.
[Android Software Development] egingell:
Why? I see no benefit whatsoever in doing that. Unless you mean to have Tasker open the UI which you can do already without it having a plugin.
[Android Software Development] aviwdoowks:
Right. As a reminder only needed on 422 roms. I have no problems on 412 w/ auto mount.
[Android Software Development] madmack:
I don't know man. I don't own the device. I do know that some users with the same device tried what was suggested by that thread and got it working.

You'll need to provide more logs or loan the device to me if you want me to look any further as this issue is really ROM specific and has nothing to do with FM.
[Android Software Development] egingell:
Which you can do as-is without a plugin.
[Android Software Development] bsoplinger:
Just to make sure I'm understanding correctly...

As of now, only on Android 4.2.2, the way shutdown behaves can cause an issue where FolderMount isn't given enough time to cleanly unmount all the bindings. The only workaround at the moment is to modify the shutdown script per a few pages back. The workaround basically calls a script to unmount whatever's necessary then calls the normal shutdown script.

Have I got it right? If so, is there a way to write the unmount script to automagically unmount everything FolderMount did or must everyone manually create the folder list based on their unique set of mounts?

Sent from my Nexus 7 using Xparent Purple Tapatalk 2
[Android Software Development] egingell:
A file that unmounts FM's mounts and executes the shutdown script could easily be written and just left there to modify as necessary.
[Android Software Development] madmack:
I haven't personally fiddled with the shutdown binary in /system/bin so I'm not sure it'll work but someone posted a link that referred to overwriting this file and then referencing it from the overwritten shell script. You can make an easy test to see if this will work: rename /system/bin/shutdown to something else and then try to shut down or reboot your device. If it doesn't shut down or reboot, then yes, we can use this to unmount all pairs and call the shutdown binary.
[Android Software Development] egingell:
I would just like to point out that I have no such file on my phone.

Sent from my SGS4.
[Android Software Development] madmack:
LOL. I'm liking this. :good:
[Android Software Development] partisano:
Hi all. I have a doubt: is this application compatible with Samsung Galaxy S II? I would like to buy a 64 GB MicroSDXC (class 10) and install apps with their data on it: GPS navigators, Gameloft games, etc. Is it possible? Thanks and regards.
[Android Software Development] egingell:
Um... Ok.

It's compatible with every Android phone; however, it does not move data from the /data partition on its own - you can make the pairs, but you have to move the files yourself. Chances are, the GPS maps and Gameloft stuff is on the internal SD, so you won't have to worry about that.

Sent from my SGS4.
[Android Software Development] madmack:
I never thought there would be a reliable way to force Android to do some time consuming task before shut down. The shutdown script that someone referred to seemed promising even though I was a bit surprised that it existed at all. You saying that the shutdown binary doesn't even exist is exactly what I've been thinking anyway and just proves the point that these aren't and shouldn't be the way to force android to run some shell script before shutdown.

In any case, I'm generally against tampering with binary files in Android's system partition unless absolutely necessary.
[Android Software Development] egingell:
There's one named "/system/bin/rmt_storage" that I have no idea what does, but judging by the name, remounts the SD card(s).

Edit: And I don't know when /system/bin/sdcard gets executed. I tried hooking it, but either it gets executed early or it never does. :shrug:
[Android Software Development] madmack:
it gets executed early by the ramfs.
[Android Software Development] pyler:
but its the most cleanest way :) no need hack any binary, and it works for all phones. People which have FM have root so there are not BFU.

check:

https://android.googlesource.com/platform/frameworks/base/+/742a67127366c376fdf188ff99ba30b27d3bf90c/policy/src/com/android/internal/policy/impl/GlobalActions.java

=>

https://android.googlesource.com/platform/frameworks/base/+/947f7824118f0e9b642df8760a8725a7eda59318/core/java/com/android/internal/app/ShutdownThread.java
[Android Software Development] siraltus:
Tons of people run Xposed on stock to add UI and behavior mods, also many run Xposed on both stock and AOSP ROMs to circumvent Google Wallet's device and carrier checks, enable Netfix playback on Exynos 4 devices, and many, many other purposes. I say Xposed is very popular.
[Android Software Development] madmack:
Sorry guys, it won't happen. Requiring other modules ain't my style (we got rid of the busybox requirement after all!).

Is unmounting before shutdown that important? Honestly it hasn't affected me or corrupted my data so far and I reboot a lot.
[Android Software Development] siraltus:
My SD cards consistently got "corruption found in the volume bitmap" errors when running chkdsk on them on a Windows machine, and I'd get a FOUND.000 folder with a few random files in it every time. After I stopped using FolderMount, the corruption no longer happens.
[Android Software Development] madmack:
This is not necessarily due to the reboot but could be due to the mountpoints themselves. Try to unmount all pairs in FM before rebooting and see if the errors are gone? You'll need to test this thoroughly over a few days.
[Android Software Development] siraltus:
I did, that's how I know it's FolderMount. Ever since I realized FolderMount is causing my SD card to not mount on almost every boot, I only mount and then dismount pairs manually on an as-needed basis.

The corrupted volume bitmap happened consistently if I didn't dismount my Google Music cache folder pair before reboot - makes sense, since Google Music keeps writing stuff to its cache all the time. Other pairs were static (only accessed when the parent app was running) and applications only read from those directories (Caustic, Bard's Tale), so leaving those pairs mounted didn't cause the volume bitmap corruption.

Yesterday I got rid of the Google Music pair completely and now I just let Google Music cache to the internal SD card because it was getting ridiculous.

I now only have a pair for Bard's Tale and nothing else, and I only mount it when I'm playing the game, then dismount it, and I no longer get any corruption.

(I took the card out of my phone at least once daily to chkdsk it on a Windows 7 computer.)
[Android Software Development] madmack:
damn. is this on a fat32 or exFAT sdcard?
[Android Software Development] siraltus:
exFAT.
[Android Software Development] madmack:
I wonder if that's the reason right there. Crappy beta exFAT linux driver implementation.
[Android Software Development] siraltus:
If it was a crappy driver, my card would be getting randomly corrupted all the time, and not only when FolderMount's got a pair mounted on it that an app keeps writing to. Spotify keeps its cache on the external SD card and it isn't causing any corruption even when I reboot with Spotify still playing.

If you have doubts about the exFAT implementation, open a discussion with the Cyanogenmod folks.
[Android Software Development] Magissia:
Can't you switch to ext4 or ntfs ? Some roms have proper ntfs read write support.

Regards
[Android Software Development] siraltus:
Many recoveries don't support (TWRP for example) NTFS, so doing backups to the card or installing ROMs from the card goes out the window.

Ext4 on an SD card causes all sorts of weird permissions issues that you have to have a custom init.d script to correct them on every boot.
[Android Software Development] madmack:
CM and the newly exFAT troubles again. Now I'm more certain that this is your problem man. If you're having the same problem on stock samsung exFAT implementation or on FAT32, then I'll look at it. Otherwise, it just really is a waste of time at this point for me.
[Android Software Development] siraltus:
You do realize I'm not the only person in the world using an exFAT-formatted card with Cyanogenmod? The number of people who do will only be increasing over time. Have fun.
[Android Software Development] Magissia:
Hey, and what if he find a workaround, put it in use, and then CyanogenMod fix their exFat ? Lost time ? If the problem is from CyanogenMod, it's up to them to fix it !

Regards
[Android Software Development] siraltus:
Yes, but without madmack discussing this with Cyanogen, THEY won't know there's a problem, if there even is one, and will never fix it.

It's not about finding a workaround in FolderMount right now, it's about finding out if there even IS a problem in Cyanogen, and if there is, madmack is more qualified to discuss it with them than any FolderMount user.

This isn't some obscure single-user scenario - there will only be more and more Cyanogen users using exFAT-formatted SD cards as time goes on - many held off switching to CM from stock for exactly that reason (me included).

FYI, I did post about those issues in the official CM nighlties thread for t0ltetmo and codeworx did the same thing madmack just did - dismissed me while blaming the other guy (he blamed FolderMount for the SD card failing to mount on boot and the random volume bitmap corruption, and he actually turned out to be right about the former).

So until the devs talk to each other about what the **** is going on between their software, we're up a **** creek without a paddle.
[Android Software Development] egingell:
What exactly is exFAT? A hybrid of EXT and FAT? If that's the case, then it's really no surprise that it's quirky. Any time two different techs get mixed to "improve" both, some implementations will be hacky at best.

Sent from my SGS4.
[Android Software Development] siraltus:
http://en.wikipedia.org/wiki/ExFAT
[Android Software Development] madmack:
The only way I see this getting resolved is by having me dive into the CM code and fix it myself and frankly, my priorities aren't exactly on fixing exFAT in CM at the moment. I'd say if you really want to continue using CM, either look if you can still load the sdcard using the old exFAT modules (that some apps or kernels allowed), format as FAT32 and just wait until the water clears. CM is a bleeding edge ROM and sometimes, fixing your app to be compatible with that is just not worth it.
[Android Software Development] siraltus:
Fair enough; it would take considerable effort to even figure out if there is a problem and then diagnose it. For now, I'll just continue mounting and unmounting FolderMount pairs manually as needed and watch the CM changelog for any commits to the exFAT stuff.
[Android Software Development] egingell:
That explains why people are having issues with it- proprietary, closed source. lol
[Android Software Development] madmack:
v2.0.15 is out in the OP.
[Android Software Development] kasra001:
Guys I can't use it with obb datas....can anyone help me?
[Android Software Development] madmack:
go to Settings and change the destination checks option.
[Android Software Development] baileyjr:
Does anyone know yet if the mount points have changed in 4.3?
[Android Software Development] mugenga:
Hi All,

I'm currently using the Sprint Galaxy Note 2 and was on Paranoid Android.

I tried using Foldermount to move over the data folder for Blitz Brigade from internal sdcard to externalsdcard. Somehow after that process was completed, overnight, my phone just self rebooted and now it can't boot into the rom. I tried to just Factory reset, but I'm getting:

E : error opening '/data/media/0/Android/data/com.

E : error: I/O error.

I've tried to reinstall the AOSP rom, but it still wasn't able to boot into it. So I tried Factory resetting again (receiving the same error as above) then installed a touchwiz based Rom, but I'm running into the same issue. I try to boot into it, but now it's just rebooting back into recovery.

I tried going in through the TWRP File Manager and manually deleting the data folder, but I run into the same error as above again. Does anyone have any ideas as to a solution to this?

Is there a way I can just wipe my internal storage without worrying about permissions issues? I tried doing Format data and wiping internal, but I've run into the same issue. :eek:

Any help would be much appreciated. :D
[Android Software Development] madmack:
Looks like fs corruption on the /data partition to me.

Factory reset won't help. You'll need to clean this by a menu "advanced wipe" or something like that, and make sure you select data and internal sdcard. If this also throws an error, there is an option to use mkfs.ext4, make sure it is checked. I don't know the exact name of these options but this should serve as a guideline.
[Android Software Development] mugenga:
Thanks, The advance wipe did not work. I'm still getting the same errors. I also have the latest version of TWRP, but I don't see any options for mkfs.ext. My advanced tab only has "Copy Log to SD", "Fix Permissions", "File Manager", "terminal Command", "Reload Theme", and "ADB Sideload"
[Android Software Development] madmack:
hmmmm.. i would be able to force a format if I had adb access in recovery but I guess that's not a possibility. Try Odin to flash a stock rom. If you can find the correct, I repeat, the correct pit file, then put that in Odin and check" repartition ". First though, I'd try flashing stock via Odin without repartition just to see if that would work (I somehow doubt it).
[Android Software Development] bsoplinger:
I'm sure everyone is asking about 4.3, so I'll jump in too but at least I won't ask for a quick answer as I'm sure there's plenty of info to sort through. I'm just concerned because I saw a comment that directory binding won't work. This could just be a repeat of the fact that they don't work (as they used to in earlier Android versions) on 4.2 either because of changes to the Android system to provide more security or it could be that the additional changes for even more security in 4.3 (which also breaks the way rooting works) breaks things even more.

Sent from my Nexus 7 using Xparent Purple Tapatalk 2
[Android Software Development] brando56894:
I gave this a try because I wanted to link my Downloaded Google Music folder located at /data/data/com.google.android.music/files/music to /mnt/extSdCard/google-music but it didn't seem to work. I am missing the files that were in the data folder (not a big deal, it was one album) and when I created a blank file in one directory it didn't show up in the other. Also ls -a didn't show a symlink between ../music to ../google-music

edit: while trying to find the device name for /data to mount it r/w I did find this so it may have actually worked in some way

/dev/block/vold/179:33 /data/data/com.google.android.music/files/music vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

edit 2: even after mounting /data read-write and setting up the source and destination and then telling it to copy the files still results in Unknown error [Link Name]
[Android Software Development] egingell:
You won't find a symlink. They're not symlinked. At any rate, there's an in-app option to submit a bug report. Use that.
[Android Software Development] madmack:
The unknown error is due to the fact that FM wasn't able to move the stuff. I actually wrote a big fat warning in a popup when you click on "/ path" mentioning exactly that. You'll simply need to move the files manually by using any root explorer app or shell/su.

The mount entry looks good to me. i.e. /data/data/com.google.android.music/files/music is getting bound to your vold dev block which is your extSdCard. I personally have that exact setup and it works fine here. Not sure why you're not seeing the same files in src/dst.
[Android Software Development] egingell:
Maybe the warning dialog isn't scary enough.
[Android Software Development] madmack:
Maybe :rolleyes:
[Android Software Development] bsoplinger:
I'm pretty sure Google Music was already mentioned in this thread. There's a problem because Music starts before FolderMount runs. This means Music already has the internal directory setup as the place it looks. Then when FM comes along and attempts to bind the external directory to the internal one things end up with a mixture of both. You need to force stop Music and then run FM then restart Music for it to work. Search back for the previous posts for more info.

Sent from my Nexus 7 using Xparent Purple Tapatalk 2
[Android Software Development] egingell:
No. You only need to force stop Play Music after FM mounts.

Sent from my SGS4.