Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,951 Members 52,697 Now Online
XDA Developers Android and Mobile Development Forum

what is /storage/emulated/legacy etc. and /storage/emulated/0 etc.

Tip us?
 
donec
Old
#1  
donec's Avatar
Senior Member - OP
Thanks Meter 106
Posts: 694
Join Date: Aug 2012
Default what is /storage/emulated/legacy etc. and /storage/emulated/0 etc.

I am not rooted.

I have researched and every time someone talks about this topic they start refering to doing things in root. I am a Linux user specifically a Linux Mint 13 KDE. However! I don't work with the terminal and have not since my DOS days, nor do I want to. IMO I'm too old to bother with it.

Now I use ES File Explorer as my file browser and I see there seems to be a duplication of almost everything on my device yet there is not enough room on the Nexus 4 16GB to hold 2 of everything I have loaded onto it.

So I assume the extra stuff I see are sym-links (I don't realy understand what they are just that they are not real). Am I correct?

Why when an app looks for duplicates does it show the stuff in /storage/emulated/legacy etc. and in /storage/emulated/0 etc. and report them as the same size?

Why am I allowed to create a folder in /storage/emulated/0 or /storage/emulated/legacy if they just contain sym-links? IMO I should not have access to those folders without being rooted.

Why when I add a folder in /storage/emulated/0 or /storage/emulated/legacy does it show up in /sdcard?
Galaxy Note II 16Gb white unlocked and GNote 10.1 grey version GT-N8013 not rooted
Linux user #449322 running Linux Mint 13 KDE
 
Eric Weir
Old
#2  
Junior Member
Thanks Meter 0
Posts: 5
Join Date: Apr 2013
Quote:
Originally Posted by donec View Post
I use ES File Explorer as my file browser and I see there seems to be a duplication of almost everything on my device yet there is not enough room on the Nexus 4 16GB to hold 2 of everything I have loaded onto it.

So I assume the extra stuff I see are sym-links (I don't realy understand what they are just that they are not real). Am I correct?

Why when an app looks for duplicates does it show the stuff in /storage/emulated/legacy etc. and in /storage/emulated/0 etc. and report them as the same size?

Why am I allowed to create a folder in /storage/emulated/0 or /storage/emulated/legacy if they just contain sym-links? IMO I should not have access to those folders without being rooted.

Why when I add a folder in /storage/emulated/0 or /storage/emulated/legacy does it show up in /sdcard?
I was going to post a simpler version of this question: Why do I have [Android 4.2.2 on a Nexus 7] /storage/emulated/0/, /storage/emulated/legacy/, and /storage/sdcard0/ when they seem to have exactly the same contents? When, if I create something in /storage/emulated/0/ it's duplicated in the other two locations?

But I noticed this thread and decided to check it out. I am shocked that it'' gotten no response in five months.
 
Nuu~
Old
(Last edited by Nuu~; 6th May 2013 at 02:50 PM.)
#3  
Nuu~'s Avatar
Senior Member
Thanks Meter 85
Posts: 223
Join Date: Nov 2012
Quote:
Originally Posted by Eric Weir View Post
I was going to post a simpler version of this question: Why do I have [Android 4.2.2 on a Nexus 7] /storage/emulated/0/, /storage/emulated/legacy/, and /storage/sdcard0/ when they seem to have exactly the same contents? When, if I create something in /storage/emulated/0/ it's duplicated in the other two locations?

But I noticed this thread and decided to check it out. I am shocked that it'' gotten no response in five months.
They are basically the same thing. 2 mount points pointing to the same storage device and partition.
If you create something in one folder, it will show up in the other. Same applies for deleting stuff.
They do not take away more storage space, as it is only available once but shown twice.

You also don't need to worry about it in any way because file browsers normally set their default directory to one of these locations.

As far as i know, Google changed the mount points in Android 4.2 to /storage/emulated/0/ due to them switching to MTP and EXT4(?) for the sdcard. The other mount points are still there for compatibility.
Don't quote me on that, though.
The Following User Says Thank You to Nuu~ For This Useful Post: [ Click to Expand ]
 
spaceman860
Old
#4  
spaceman860's Avatar
Senior Member
Thanks Meter 1205
Posts: 1,892
Join Date: Jan 2012
They changed it for multi-user feature

Sent from my Nexus 4
Phone/NEXUS 5
Rom/DIRTY UNICORNS
Kernel/FRANCO
Recovery/TWRP
G1>N1>GN>N7>N4>N5

The Following User Says Thank You to spaceman860 For This Useful Post: [ Click to Expand ]
 
DEFI4NT
Old
#5  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Nov 2013
Default Can I delete "legacy"

Quote:
Originally Posted by Nuu~ View Post
They are basically the same thing. 2 mount points pointing to the same storage device and partition.
If you create something in one folder, it will show up in the other. Same applies for deleting stuff.
They do not take away more storage space, as it is only available once but shown twice.

You also don't need to worry about it in any way because file browsers normally set their default directory to one of these locations.

As far as i know, Google changed the mount points in Android 4.2 to /storage/emulated/0/ due to them switching to MTP and EXT4(?) for the sdcard. The other mount points are still there for compatibility.
Don't quote me on that, though.
Can I delete the legacy folder without harming anything?
 
lapocompris
Old
#6  
Member
Thanks Meter 4
Posts: 74
Join Date: Dec 2012
Quote:
Originally Posted by DEFI4NT View Post
Can I delete the legacy folder without harming anything?
Did you read the post that you quoted ?

"If you create something in one folder, it will show up in the other. Same applies for deleting stuff."
The Following User Says Thank You to lapocompris For This Useful Post: [ Click to Expand ]
 
dethrat
Old
#7  
Senior Member
Thanks Meter 92
Posts: 361
Join Date: Jan 2012
Quote:
Originally Posted by DEFI4NT View Post
Can I delete the legacy folder without harming anything?
Why would you even want to delete it in the first place? You wouldn't be gaining anything is just another mount point.

Sent from my Nexus 4 using Tapatalk
 
eksasol
Old
(Last edited by eksasol; 26th December 2013 at 06:40 AM.)
#8  
Senior Member
Thanks Meter 691
Posts: 2,738
Join Date: Nov 2009
....
 
opssemnik
Old
#9  
opssemnik's Avatar
Senior Member
Thanks Meter 711
Posts: 1,097
Join Date: Jun 2013
Location: Porto Alegre,Rio Grande Do Sul,Brasil
/storage, /sdcard are sym linked folders,that means when you open one of those, it redirects to the original(/data/media/0), as for the 0 is just a multi user feature implemented in android 4.2, but only enabled on tablet androids.
Why do this Sym-Link?: simple so it dosent break apps(not only file explorer type of app, but all apps).
Still dont get, why it would break?.Simple. android api have lots of ways to write/read files from folders, u can do manually,u can get the data path, u can get the sdcard path, etc,etc. so to not break that they just does these sym links, thats why in one app the storage contentents are listed on /sdcard but on others, is /storage, etc,etc. one example of an app that broke because of these changes to android is titanium backup, u need to change the internal storage on it, so it work.
 
dwipen
Old
#10  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: Jun 2012
Location: Mumbai
Post Are they really symlinks?

I want to make sure that they are sym linked files/ folders and not additional copies as it will directly impact the storage.
Emulated storage is the only reason i have not upgraded yet to Android 4.4 yet, despite ROMs being available ages ago..

1. Please let me know for confirmation, if there is no impact on storage space.
2. Can Link2SD be used in 4.4 with emulated storage?
3. If there is a file and its sym link/ copy; are the rights equally assigned to both files/ folders?
I mean to ask if there is a provision to have root previlege on the original file and read only rights on the sym link ? Is it possible??
the main reason for this question is that, if by mistake i do something on the sym lilnk, it should not affect the original file.
and whatever change i wish to operate on, i can do it on the original file itself.


Regards
Dwipen



Quote:
Originally Posted by opssemnik View Post
/storage, /sdcard are sym linked folders,that means when you open one of those, it redirects to the original(/data/media/0), as for the 0 is just a multi user feature implemented in android 4.2, but only enabled on tablet androids.
Why do this Sym-Link?: simple so it dosent break apps(not only file explorer type of app, but all apps).
Still dont get, why it would break?.Simple. android api have lots of ways to write/read files from folders, u can do manually,u can get the data path, u can get the sdcard path, etc,etc. so to not break that they just does these sym links, thats why in one app the storage contentents are listed on /sdcard but on others, is /storage, etc,etc. one example of an app that broke because of these changes to android is titanium backup, u need to change the internal storage on it, so it work.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes