0
  1. /sdcard -> /storage/sdcard0
  2. /storage/sdcard0 -> /storage/emulated/legacy
  3. /storage/emulated/legacy -> /storage/emulated/0

Based on the above, if all the locations point to the same virtual storage, what's the point in having separate storage locations for each different user?

If /storage/emulated/0,1,2,3,etc. all point to /storage/sdcard0, and saving files in any storage location make it appear in all other locations, how is it possible to have user designated storage if all information is the same for all users?

Or is it not supposed to be designed this way...that every user's storage should be the exact same, but if that were the case, then why does having multiple folders with different numbers for multiple users exist? Am I missing something here? Am I missing some key piece of information? Why allocate folders for a specific user if they all point to the same location and contain the same exact information?

16
  • 1
    See my comments on your similar question: When files are created in Android 4.2 and above, are files ever stored in one location? – and do read the Wikipedia article on symbolic links I told you instead of re-asking the same again. As I already wrote, you're looking at it from the wrong end, symbolic links work the other way around: it's not /storage/emulated/* pointing to /storage/sdcard0, but just the opposite – so sdcard always points to the current user's storage.
    – Izzy
    Commented Apr 29, 2017 at 10:23
  • 1
    @Izzy On my 5.1.1, /storage/sdcard0 points to /storage/emulated/legacy. All hail the Symlink Hell!
    – Grimoire
    Commented Apr 29, 2017 at 13:53
  • 1
    @DeathMaskSalesman Yes, same as in Narcotixs post. Now, where does /storage/emulated/legacy point to? #3 above. So what is accessed finally, and where are data written to and read from when accessing /sdcard? The storage area of the logged-in user (in the example above that's the device owner, as the 0 in emulated/0 indicates, because the device owner is logged in – if you follow the chain of Narcotixs' questions, OP never tried with a "secondary user").
    – Izzy
    Commented Apr 29, 2017 at 13:58
  • 1
    @Izzy Yes, from the output of mount, I can now see that /dev/fuse is mounted on /mnt/shell/emulated. Pretty hacky way to handle things, especially if you consider that the internal storage visible to a non-rooted user is just a subset of the /data partition (i.e. /data/media).
    – Grimoire
    Commented Apr 29, 2017 at 14:10
  • 1
    @Izzy , I finally understand now, it all makes sense. Symlinks just redirect content and data to the current user's designated storage location.They don't actually hold any data at all, there merely reflect what is in that location. So if that's the case, then for example, let's say I'm "user3" and my designated storage is "/storage/emulated/3". All the symlinks would only point that location, because that is the current user that is logged in. Thus, multi-user actually works.
    – Narcotixs
    Commented Apr 29, 2017 at 18:30

0