47

Some devices (like my Nexus 4) don't have an external slot for an SD Card. Instead, there's a root folder called /sdcard/ that is treated the same way. But I also find other paths that all point to the same files -- there must be some kind redirects going on (I think this is called symlinks in Linux).

All these paths contain the same files:

/sdcard/
/storage/sdcard0/
/storage/emulated/0/
/storage/emulated/legacy/

Which path is the "actual" one? What about the other paths? What are they used for, why do they exist?

2 Answers 2

39

Recommended lecture: Why did /sdcard/ turn into /sdcard/0/ with 4.2?.

In short: It has to do with the multi-user functionality introduced with Jelly Bean:

  • /storage/emulated/0/: to my knowledge, this refers to the "emulated MMC" ("owner part"). Usually this is the internal one. The "0" stands for the user here, "0" is the first user aka device-owner. If you create additional users, this number will increment for each.
  • /storage/emulated/legacy/ as before, but pointing to the part of the currently working user (for the owner, this would be a symlink to /storage/emulated/0/). So this path should bring every user to his "part".
  • /sdcard/: According to a comment by Shywim, this is a symlink to...
    • /mnt/sdcard (Android < 4.0)
    • /storage/sdcard0 (Android 4.0+)
  • /storage/sdcard0/: As there's no legacy pendant here (see comments below), the "0" in this case rather identifies the device (card) itself. One could, eventually, connect a card reader with another SDCard via OTG, which then would become /storage/sdcard1 (no proof for that, just a guess -- but I'd say a good one)

Though one might get to the conclusion there should be a /storage/sdcard/legacy as well, there isn't (see comments) -- which completely makes sense with my assumption of the numbers here are not related to the user, but rather to possible multiple cards: "0" would always be the one in the card-slot of the device, so no need for a "legacy symlink" here.

8
  • Thanks! And no, there's no /storage/sdcard/legacy path. Feb 13, 2013 at 14:25
  • 2
    Strange. But that might have to do with the fact there are hardly any permissions on a real sdcard (due to the FAT file system not supporting them). Noting the difference (/sdcard0/ versus /emulated/0), the "0" here might be intended for the case one attaches multiple SDCards via a card reader and USB host mode then. Just a guess, not a hard fact -- but I'd say a good one.
    – Izzy
    Feb 13, 2013 at 15:11
  • 2
    /sdcard/ is simply a symlink to /storage/sdcard0/. On older version than 4.0.0, it is /mnt/sdcard/. Feb 14, 2013 at 18:05
  • And I assume, on Android 4.0+, /mnt/sdcard/ is a symlink to /storage/sdcard0/? Since both are navigable on my Nexus 4.
    – MrWhite
    Apr 12, 2013 at 15:22
  • I'd say so, yes.
    – Izzy
    Apr 12, 2013 at 15:36
2

Yea a bit confusing but these are alternate paths for the memory layout

/mnt/sdcard0/ (Internal Virtual SD Card)

and Izzy your correct if more devices are connected, but the naming could be different depending on device.

ex. /mnt/sdcard1/ (Physical SD Card in SD slot)

but other devices such as a Usb flash drive connect with an adapter could be called

/mnt/media_rw/usbdisk (android kitkat 4.4 and above?) or /mnt/usbdisk (jellybean 4.1 - 4.2)

2
  • 1
    Yes, naming might depend on the device/manufacturer/ROM. But usually, /mnt/* is only a symlink in all those cases – with the "real mounts" residing below /storage :)
    – Izzy
    Dec 1, 2014 at 13:21
  • Well, I have a shell folder under mnt too. I switch device ROM frequently and thus, for those roms, which makes external SDcard as the default memory, the shell folder behaves as my internal memory, and for other roms which don't swap sdcard as internal memory, shell doesn't even comes into picture. It just stays there in the folder with all the data intact, but is not accessible by the local file manager. Wanted to know, what exactly it is.
    – Ali_Waris
    May 21, 2015 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .