Go Back   AnandTech Forums > Software > *nix Software

Forums
· Hardware and Technology
· CPUs and Overclocking
· Motherboards
· Video Cards and Graphics
· Memory and Storage
· Power Supplies
· Cases & Cooling
· SFF, Notebooks, Pre-Built/Barebones PCs
· Networking
· Peripherals
· General Hardware
· Highly Technical
· Computer Help
· Home Theater PCs
· Consumer Electronics
· Digital and Video Cameras
· Mobile Devices & Gadgets
· Audio/Video & Home Theater
· Software
· Software for Windows
· All Things Apple
· *nix Software
· Operating Systems
· Programming
· PC Gaming
· Console Gaming
· Distributed Computing
· Security
· Social
· Off Topic
· Politics and News
· Discussion Club
· Love and Relationships
· The Garage
· Health and Fitness
· Merchandise and Shopping
· For Sale/Trade
· Hot Deals with Free Stuff/Contests
· Black Friday 2014
· Forum Issues
· Technical Forum Issues
· Personal Forum Issues
· Suggestion Box
· Moderator Resources
· Moderator Discussions
   

Reply
 
Thread Tools
Old 12-13-2012, 05:39 PM   #1
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default Android: Can someone explain to me its folder structures?

The whole root, system partition, sdcard thing confuse me. As you will see I am a total noob in this area so please bear with me and hopefully someone will educate me.

I have heard some people talking about moving their applications to sdcard to save space in the system partition (is that the correct term?). I do not know what that means so I decided to see for myself, and gained root access in my Nexus 7. Browsing the folder structure, I am completely lost because I have no idea which is which. I tried to draw what I am trying to learn about;



1. /sdcard/ (along with /root/ directory and other system-level directory)
2. /storage/emulated/0/
3. /storage/emulated/legacy/
4. /storage/sdcard0/

Prior to root access, I believe I was looking at #2, which would be /storage/emulated/0/. That's where I saw some application folders as well as data folders. Upon gaining root access, however, I found three more folders that seem to contain identical contents.. I suppose they are not duplicates (four copies of everything?), but I am terribly confused.

My questions (for now):

- What are these 4 for? And which one is "real" in a physical sense? (does it even make sense to refer it as "real" instead of "shortcuts" or "aliases"?)
- Which one is the system partition, or ROM? Are they referring to the same thing?
- Which one is "external storage"? Do "external storage" and "sdcard" mean the same thing? And which is "internal storage"?
- When people talk about moving stuff to sdcard (e.g. "app to sdcard"), which one is the starting point and which one is the end point?

Obviously appreciated.

Last edited by lopri; 12-13-2012 at 07:19 PM.
lopri is offline   Reply With Quote
Old 12-13-2012, 06:17 PM   #2
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

That's different from my current, and previous tablets. Both of mine have /mnt/sdcard and /mnt/extsd

/mnt/sdcard is builtin(extra) storage, and /mnt/extsd is a removable sdcard. I'd guess /sdcard is the proper place, but I don't know for sure.

Edit:
BTW, if you want to manipulate files on the device itself, GhostCommander will let you manipulate files as root as long as you have root access. It gives a nice dual pane commander-like interface

http://f-droid.org/repository/browse...ander&fdpage=7

^^^That's the main repository I use for apps. It's sparse compared to Play store, but it's all libre apps that have source code available. Most are completely clean, but three's a couple that have hindrances. They either track, or have ads. Those are very few, and clearly marked though. I guess someone just has to rip out the offending bits.

Last edited by lxskllr; 12-13-2012 at 06:25 PM.
lxskllr is online now   Reply With Quote
Old 12-13-2012, 06:20 PM   #3
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

I have a Nexus 7, and it doesn't have any slots for external/removable sd cards. Yet people refer certain part as "internal storage" (system partition, or ROM?) and "external storage" (which was another confusion that I understood quickly)

Last edited by lopri; 12-13-2012 at 06:23 PM.
lopri is offline   Reply With Quote
Old 12-13-2012, 06:28 PM   #4
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

Quote:
Originally Posted by lopri View Post
I have a Nexus 7, and it doesn't have any slots for external/removable sd cards. Yet people refer certain part as "internal storage" (system partition, or ROM?) and "external storage" (which was another confusion that I understood quickly)
My "internal" storage is /data/app
lxskllr is online now   Reply With Quote
Old 12-13-2012, 06:28 PM   #5
postmortemIA
Diamond Member
 
postmortemIA's Avatar
 
Join Date: Jul 2006
Location: Midwest USA
Posts: 6,500
Default

Quote:
Originally Posted by lopri View Post
I have a Nexus 7, and it doesn't have any slots for external/removable sd cards. Yet people refer certain part as "internal storage" (system partition, or ROM?) and "external storage" (which was another confusion that I understood quickly)
there's separate partition where apps are installed by default, and that is never on external card but on the internal.
__________________
D1. Win7 x64 i7-3770 on Z77, HD7850, 2707WFP, 840, X-Fi D2. Win7 x64 E8400 on P35
L1. OSX 10.9 rMBP 13 L2. Vista x86 E1505
M. Galaxy S4

postmortemIA is online now   Reply With Quote
Old 12-13-2012, 06:30 PM   #6
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

Thank you for the suggestion but I do have a file/folder manager. I am not trying to manipulate files (yet), but rather trying to understand what I see.. Right now I don't even understand what exactly /sdcard/ means. (internal? external? emulated?)
lopri is offline   Reply With Quote
Old 12-13-2012, 06:32 PM   #7
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

Quote:
Originally Posted by postmortemIA View Post
there's separate partition where apps are installed by default, and that is never on external card but on the internal.
Which one would it be, among the 4 I found? Is it #1? (system partition) Where is the line drawn? And why "emulated"?

The thing is, I see exact same contents in all 4 folders I listed. (I could be wrong since I did not check one by one, but they looked the same to me)
lopri is offline   Reply With Quote
Old 12-13-2012, 06:47 PM   #8
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

I spoke wrong earlier. My root apps(ROM) are in /system/app, and downloaded apps are in /data/app

I still don't know about the rest of your setup :^D
lxskllr is online now   Reply With Quote
Old 12-13-2012, 07:06 PM   #9
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

OK I took screenshots. Big pictures below.

This is as deep as I can go with root privilege. Note /sdcard/ and /storage/ are here together, as well as /system/. (is /sdcard/ system partition, and /storage/ external storage?)



And from here, when I go to /sdcard/, I see this (which is #1 in my origianl thread. Check the top tree).

#1 [/sdcard/]

If I go to /storage/ from the first screen, I see this.



Then

#2 [/storage/emulated/0/]:
#3 [/storage/emulated/legacy/]:
#4 [/storage/sdcard0/]:

Last edited by lopri; 12-13-2012 at 07:09 PM.
lopri is offline   Reply With Quote
Old 12-13-2012, 08:03 PM   #10
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

I dunno man. Android is a different beast than GNU/Linux. I was starting to get into it early this year, but broke my tablet, so I quit playing with it. I never got to understanding how it all goes together. I'm wondering how much it varies per manufacturer, because my setup isn't like that.

If you don't get any love here, you may want to read some Android specific forums. If you go that route, take some time to learn before you ask questions. There's a lot of noobs with Android devices, and they get in the forums and ask questions that were answered on the same page they were asking on. It's easy to burn out the people with knowledge when they get asked the same questions over and over. I knew almost nothing, and I was getting burned out repeating what little I did know. You should be able to find some good stuff here...

https://www.xda-developers.com/
lxskllr is online now   Reply With Quote
Old 12-13-2012, 10:17 PM   #11
vshah
Lifer
 
vshah's Avatar
 
Join Date: Sep 2003
Location: Pittsburgh
Posts: 18,748
Default

all the weird /emulated/0 stuff is a result of the new multi user profiles in 4.2.
you'll see what appear to be the same files in several different places. i think it's using a lot of symlinks or something, and it swaps them out when you swap user profiles.

of course, the multi user profiles aren't enabled on the Nexus 4, only the Nexus 10. so us N4 users just get stuck with the weird folder structure.
__________________
Intel Core i7 920 || Asus P6T Deluxe V2 || Noctua NH-U12P|| 12GB DDR3-1600
GTX 670 || Intel x-25m 80gb || 1TB Caviar Black || Antec 902 ||Antec 550w
HEAT
XBL: the4ner85
vshah is offline   Reply With Quote
Old 12-13-2012, 11:42 PM   #12
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

vshah, could you enlighten me as to the following?

- When people talk about "internal storage" and "external storage" (think of an app like app2SD), which folder is "internal storage" and which folder is "external storage" in Jelly Bean? Of course we're not talking about removable disks or SD slots.

- Is it correct to view that some of these folders are indeed partitions on the volume? In other words, unlike alphabets in Windows (e.g. C: drive, E: drive, etc,.) Android uses folders to denominate partitions (mounted, perhaps?)? (but they are actually partition on the disk of Android device?)

- Is it correct to view, both the internal storages and external strages exist on same physical disk, just in different partitions? Or perhaps they are separated by different NAND memory chips? Do you happen to know how much internal storage is reserved in Android?

- Is it correct to view, the folders that I had access to prior to root access (in my case that was /storage/emulated/0/ ) is an external storage, considering that I had the total control of it? So if I use a tool such as "app2sd," that is where the app2sd will try to move stuff to?

Last edited by lopri; 12-14-2012 at 03:25 AM.
lopri is offline   Reply With Quote
Old 12-13-2012, 11:53 PM   #13
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

Or is it the opposite? If you look at the first screenshot I posted earlier,



You can see

/sdcard/
/storage/
/system/

Again, the screen seen above is the highest at the folder hierarchy with root access in my Nexus 7. If you were to guess, which one is which (a partition, a folder, an internal, an external, etc,.?)

If I were to guess that /sdcard/ is external storage partition, and /system/ is a folder residing in /storage/, which is an internal storage partition - does it sound plausible?
lopri is offline   Reply With Quote
Old 12-14-2012, 09:08 AM   #14
vshah
Lifer
 
vshah's Avatar
 
Join Date: Sep 2003
Location: Pittsburgh
Posts: 18,748
Default

on nexus devices since the nexus S, there is only one partition.

/sdcard, /storage/emulated/0 etc. are all pointing to the same place, and that is the "sdcard" or "External storage" as far as apps are concerned.

"internal" storage is everything else you see at the top level:
/data - apps are installed to /data/app and store their data in /data/app-asec among other subfolders.

/system contains components of the android OS. /system/app contains system apps like the launcher. you'll find your SU binary in /system/xbin


it doesn't make any sense to use apps2sd on a nexus device, since it's all one partition. you can fill up the "internal storage" part, or you can fill up the "external storage" part, it makes no difference.
__________________
Intel Core i7 920 || Asus P6T Deluxe V2 || Noctua NH-U12P|| 12GB DDR3-1600
GTX 670 || Intel x-25m 80gb || 1TB Caviar Black || Antec 902 ||Antec 550w
HEAT
XBL: the4ner85
vshah is offline   Reply With Quote
Old 12-14-2012, 09:45 AM   #15
imagoon
Diamond Member
 
imagoon's Avatar
 
Join Date: Feb 2003
Location: Chicagoland, IL
Posts: 4,787
Default

Quote:
Originally Posted by lopri View Post
I have heard some people talking about moving their applications to sdcard to save space in the system partition (is that the correct term?).
This function is built in to Android. You do it in the app management section of the GUI. You don't have to root the system or do anything in the file system.

App management -> click the app -> "Move to SDCard."

As for the rest... Android FS is a maze and I can't offer anything there.
imagoon is offline   Reply With Quote
Old 12-14-2012, 01:20 PM   #16
vshah
Lifer
 
vshah's Avatar
 
Join Date: Sep 2003
Location: Pittsburgh
Posts: 18,748
Default

Quote:
Originally Posted by imagoon View Post
This function is built in to Android. You do it in the app management section of the GUI. You don't have to root the system or do anything in the file system.

App management -> click the app -> "Move to SDCard."

As for the rest... Android FS is a maze and I can't offer anything there.
while it is built in, OP won't see it on his Nexus 7 since there's only one partition so moving an app to "sdcard" would have no effect on storage utlization.
__________________
Intel Core i7 920 || Asus P6T Deluxe V2 || Noctua NH-U12P|| 12GB DDR3-1600
GTX 670 || Intel x-25m 80gb || 1TB Caviar Black || Antec 902 ||Antec 550w
HEAT
XBL: the4ner85
vshah is offline   Reply With Quote
Old 12-14-2012, 02:26 PM   #17
imagoon
Diamond Member
 
imagoon's Avatar
 
Join Date: Feb 2003
Location: Chicagoland, IL
Posts: 4,787
Default

Quote:
Originally Posted by vshah View Post
while it is built in, OP won't see it on his Nexus 7 since there's only one partition so moving an app to "sdcard" would have no effect on storage utlization.
Well ok, then what is the point of the OP request? Also I think the proper term is "one mount point." My Nexus has 1 partition with /sdcard mounted to the internal storage chip.

Anyway my original question stands. I would be interested to see the fdisk list out from a terminal emulator.
imagoon is offline   Reply With Quote
Old 12-14-2012, 02:44 PM   #18
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

Quote:
Originally Posted by imagoon View Post
Well ok, then what is the point of the OP request? Also I
I think it gets slow if the file system gets too full, but I don't know how much "too full" is. I've been moving my apps to the root partition. Deleting a bunch of default apps, and putting my own in.
lxskllr is online now   Reply With Quote
Old 12-14-2012, 05:57 PM   #19
lopri
Elite Member
 
lopri's Avatar
 
Join Date: Jul 2002
Posts: 9,909
Default

I did some reading today and vshah, I thank you very much. Your post (#14 specifically) cleared a lot of things that I was confused about. And your explanation totally makes sense. (obviously, since you're stating facts) No wonder I did not see any kind of physical partitions with those low-level diagnostic tools.

I am still digesting and "indoctrinate" myself on this new knowledge. I am likely to have more questions, but I want to thank everyone trying to help me. Again, I am not done and will probably (more like definitely) have further questions.
lopri is offline   Reply With Quote
Old 12-15-2012, 07:42 AM   #20
vshah
Lifer
 
vshah's Avatar
 
Join Date: Sep 2003
Location: Pittsburgh
Posts: 18,748
Default

Quote:
Originally Posted by lopri View Post
I did some reading today and vshah, I thank you very much. Your post (#14 specifically) cleared a lot of things that I was confused about. And your explanation totally makes sense. (obviously, since you're stating facts) No wonder I did not see any kind of physical partitions with those low-level diagnostic tools.

I am still digesting and "indoctrinate" myself on this new knowledge. I am likely to have more questions, but I want to thank everyone trying to help me. Again, I am not done and will probably (more like definitely) have further questions.
No worries, the new folder structure threw me for a loop when I first encountered it as well
__________________
Intel Core i7 920 || Asus P6T Deluxe V2 || Noctua NH-U12P|| 12GB DDR3-1600
GTX 670 || Intel x-25m 80gb || 1TB Caviar Black || Antec 902 ||Antec 550w
HEAT
XBL: the4ner85
vshah is offline   Reply With Quote
Old 11-28-2013, 07:25 AM   #21
rileyrg
Junior Member
 
Join Date: Oct 2013
Posts: 2
Default

Quote:
Originally Posted by lxskllr View Post
I dunno man. Android is a different beast than GNU/Linux. I was starting to get into it early this year, but broke my tablet, so I quit playing with it. I never got to understanding how it all goes together. I'm wondering how much it varies per manufacturer, because my setup isn't like that.

If you don't get any love here, you may want to read some Android specific forums. If you go that route, take some time to learn before you ask questions. There's a lot of noobs with Android devices, and they get in the forums and ask questions that were answered on the same page they were asking on. It's easy to burn out the people with knowledge when they get asked the same questions over and over. I knew almost nothing, and I was getting burned out repeating what little I did know. You should be able to find some good stuff here...

https://www.xda-developers.com/
If you dont know, then why reply? It stuff like this that litters google and pollutes it with false leads.
rileyrg is offline   Reply With Quote
Old 11-28-2013, 08:48 AM   #22
lxskllr
Lifer
 
lxskllr's Avatar
 
Join Date: Nov 2004
Location: Somewhere over the rainbow
Posts: 38,358
Default

Quote:
Originally Posted by rileyrg View Post
If you dont know, then why reply? It stuff like this that litters google and pollutes it with false leads.
Awe, did someone come here expecting to be spoon fed, and left empty handed? Sucks having to put in effort, doesn't it? That thinking stuff is hard.

This is a discussion forum. Truth is found by bouncing ideas around, and narrowing possibilities to the fewest. It isn't your personal free help desk. if you want personal support, you're free to pay someone for it. If you want discussion, and a degree of self help, you join a forum.
lxskllr is online now   Reply With Quote
Old 11-28-2013, 12:47 PM   #23
000_Cthulhu_000
Junior Member
 
Join Date: Nov 2013
Posts: 1
Default Redirect

I'm gonna bump this one as a new user and get it back on track.

I'm having the same curiousities as the OP.

My file structure on my Galaxy Nexus, 4.3 Jelly Bean is exactly the same.

My 'abnormality' is that I am still working with Windows Vista (...irk...) and as windows explore displays it from My Computer - 'Internal Storage'.

This I assume is the same with other people. As I browse through each file structure; comparing the Android that has;

/sdcard/
/emulated/0
/legacy/

...etc...

Windows has simply...a completely different appearance...what I mean is folders that don't exist on the above mentioned folder structure appear in Windows Explorer...this causes a nuisance with media and other files.

I want to work around this and find the real 'internal storage' on the /root/ that Android does not display. I've also, read that it may be a seperate patition all together. Any thoughts...?

PICTURES....!!!!

https://www.dropbox.com/s/c9793o0elabnmcw/Windows.jpg

https://www.dropbox.com/s/ea7hbew6rmcb6ya/Windows2.jpg

https://www.dropbox.com/s/w71yknm6z2...8-11-34-24.png

https://www.dropbox.com/s/i4u70jtoal...8-11-41-09.png

https://www.dropbox.com/s/3jll4o284o...8-11-42-46.png
000_Cthulhu_000 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:20 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.