On Fri, 4 Dec 2020 09:28:12 -0000 (UTC), Arlen Holder wrote:
> Note: I'm on Android 10, & not rooted where the "mount" command
> seems to tell me my internal storage is "exfat" & external is "sdcardfs"
UPDATE:
Based on this 9-year old thread, the type of "file system" may matter:
o Is possible to make symbolic links in the android filesystem? (and how?)
<
https://android.stackexchange.com/questions/4044/is-possible-to-make-symbolic-links-in-the-android-filesystem-and-how>
"Android does support symbolic links, but certain file systems
(e.g. FAT or RFS) do not and you cannot create symbolic links in those
partitions. If your device uses a filesystem that supports symbolic
links (e.g. ext2, ext3, ext4, yaffs2) then you should be able to use
ln -s from the Terminal Emulator."
Given this is the "ln -s" symbolic link syntax:
o Process symlink = Runtime.getRuntime().exec("ln -s /path/to/file /path/to/symlink");
<
https://stackoverflow.com/questions/41384370/is-it-possible-to-create-a-symbolic-link-on-android>
I tried this in Android 10 Termux, which said:
o Failed to create symbolic link 'ss': Operation not permitted:
All these failed on my non-rooted Android 10 device using Termux:
o ln -s /storage/emulated/0/Pictures/Screenshots /storage/emulated/0data/pic/ss
o ln -s /storage/emulated/0/Pictures/Screenshots /storage/B31E-4294/1data/pic/ss
o cd /storage/emulated/0data/pic/; ln -s /storage/emulated/0/Pictures/Screenshots ss
o cd /storage/B31E-4294/1data/pic; ln -s /storage/emulated/0/Pictures/Screenshots ss
etc.
This implies it "should" work if I used the "fuse shim around /data/media":
o [Q] Not possible to create a symlink in /mnt/sdcard?
<
https://forum.xda-developers.com/t/q-not-possible-to-create-a-symlink-in-mnt-sdcard.1442729/>
Where I tried this based on output from the mount command, but failed:
o mount | grep media | grep B31E-4294
Which reported: /mnt/media_rw/B31E-4294/ type sdcardfs, rw
o ln -s /storage/emulated/0/Pictures/Screenshots /mnt/media_rw/B31E-4294/1data/pic/ss
Which reported; Permission denied
That same article suggests "FolderMount" but it requires root:
o <com.devasque.fmount>
This suggests that the sdcardfs file system is problematic:
o <
https://android.stackexchange.com/questions/199526/how-to-remount-sdcardfs-to-allow-setting-file-permisions-ownerships>
"You cannot change permissions and ownerships of files on sdcardfs"
"Android's internal (confusingly called external) storage which is
accessible by installed apps at /sdcard, is not an actual but virtual
/ emulated filesystem exposing /data/media (which is a real filesystem)
through sdcardfs. sdcardfs and its predecessor FUSE expose the emulated
filesystem with a fixed set of uid, gid and mask (mode). So the commands
chmod and chown have no impact, whether executed through CLI
(adb shell or terminal emulator) or GUI (file explorer).
It's possible to change permission bits of file on underlying actual
filesystem, but accessing /data/media requires root access because only
UID/GID 1023 (aid_media_rw) has read access to the directory. And still
the permissions will remain same when viewed from emulated view /sdcard."
Q: Have you been successful creating symbolic links on your Android phone?
--
See also:
o What is /storage/emulated/0
<
https://android.stackexchange.com/questions/205430/what-is-storage-emulated-0/205494#205494>
"/storage/emulated/0/ is actually /data/media/0/ exposed through an
emulated / virtual filesystem, not the actual one."