Reputation: 306
i'm developing the gentoo extractor of the dSploit application and i've found a problem.
now that user can choose a custom directory for the gentoo root, we must ensure that we can make symlinks in that folder.
from android 4.2 and above, the storage infrastructure uses FUSE. create symlink where the ext FS is mounted on is fine. create symlink where the FUSE is mounted on will fail.
root@mako:/ # ln -s /system /storage/emulated/0/gentoo/test
link failed Function not implemented
root@mako:/ # ln -s /system /data/media/0/gentoo/test
this happens because /storage/emulated/0
is a fuse bind mount of /data/media/0
.
i think that the solution is to find what is mounted where and how.
how can i get FUSE mounts ?
/proc/mount
will show /dev/fuse
as source block device.
i need to have something that say:
source destination
/data/media/0 /storage/emulated/0
in order to replace /storage/emulated/0
with /data/media/0
and got symlink to work.
thanks in advance for any help and suggestion.
-- tux_mind
Upvotes: 2
Views: 3561
Reputation: 70822
The way I use was to bind mount instead of symlink:
Copy than remove because mv
won't work accross filesystems
cp -a /sdcard/DCIM /Removable/MicroSD/DCIM
rm -r /sdcard/DCIM
Create a mount point to bind DCIM
on SD card.
mkdir /sdcard/DCIM
Finaly bind mount:
mount -o bind /Removable/MicroSD/DCIM /sdcard/DCIM
This work fine, but on reboot, You will have to re-mount your binds
Upvotes: 1
Reputation: 306
i found a workaround/hack to list them.
when you open a file on the mountpoint the fuse FS handler will open it too.
i used this information and i wrote a small C program that use proc to find source directories.
if you are interested the project is hosted on github.
regards, tux_mind.
Upvotes: 1