Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 13 down vote accepted

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.

share|improve this answer
    
Thanks! And no, there's no /storage/sdcard/legacy path. –  Torben Gundtofte-Bruun Feb 13 '13 at 14:25
1  
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 '13 at 15:11
    
Answer updated accordingly :) –  Izzy Feb 13 '13 at 15:17
2  
/sdcard/ is simply a symlink to /storage/sdcard0/. On older version than 4.0.0, it is /mnt/sdcard/. –  Shywim Feb 14 '13 at 18:05
    
Thanks @Shywim -- I updated my answer accordingly :) –  Izzy Feb 14 '13 at 18:16
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.