Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,782,422 Members 43,384 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How is the storage space on the N5 divided?

Tip us?
 
Ghengis042
Old
#1  
Member - OP
Thanks Meter 7
Posts: 69
Join Date: Nov 2007
Drive [Q] How is the storage space on the N5 divided?

I've owned a Galaxy S2, and a Galaxy S1 (Captivate), both of which had external SD card slots. On these devices, there are various system partitions that share the internal 16GB of storage, used for the operating system, caches, user data, app installation, etc. Part of this is user-accessible as /sdcard, which (I think?) had a fixed size. There was also a fixed amount set aside for application installation. Apps could be moved from the application space to /sdcard, or to /sdcard/external, which was the mount point for the MicroSD slot.

That all made sense to me, though of course it would be nice to be able to designate more or less space for the application partition, or the user partition, or caches, etc, as needed.

On the N5, I don't think it works like that. I saw some posts suggesting that the N5 has multiple mounted filesystems for various tasks as above (system data, app data, installed APKs, caches, user files, etc) but that they are dynamically resized somehow. How does this work? Is it documented somewhere? Do I really need to care, or can I just start installing 1GB+ APKs with abandon? Why do they do this instead of mounting one partition on / and just having sub-directories for /system, /data, etc?
 
rootSU
Old
#2  
rootSU's Avatar
Senior Member
Thanks Meter 10,765
Posts: 21,934
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Quote:
Originally Posted by Ghengis042 View Post
I've owned a Galaxy S2, and a Galaxy S1 (Captivate), both of which had external SD card slots. On these devices, there are various system partitions that share the internal 16GB of storage, used for the operating system, caches, user data, app installation, etc. Part of this is user-accessible as /sdcard, which (I think?) had a fixed size. There was also a fixed amount set aside for application installation. Apps could be moved from the application space to /sdcard, or to /sdcard/external, which was the mount point for the MicroSD slot.

That all made sense to me, though of course it would be nice to be able to designate more or less space for the application partition, or the user partition, or caches, etc, as needed.

On the N5, I don't think it works like that. I saw some posts suggesting that the N5 has multiple mounted filesystems for various tasks as above (system data, app data, installed APKs, caches, user files, etc) but that they are dynamically resized somehow. How does this work? Is it documented somewhere? Do I really need to care, or can I just start installing 1GB+ APKs with abandon? Why do they do this instead of mounting one partition on / and just having sub-directories for /system, /data, etc?
http://forum.xda-developers.com/show....php?t=2534010
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following User Says Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
Ghengis042
Old
#3  
Member - OP
Thanks Meter 7
Posts: 69
Join Date: Nov 2007
Quote:
Originally Posted by rootSU View Post
So, I asked "why don't they just make one partition with sub-directories", and it sounds like to a certain extent that's exactly what happens. It sounds like /data is one physical partition. When you say that /sdcard "points to" /data/media/0, does that mean that it's just a subfolder that's treated specially, and softlinked to /sdcard? Maybe a loopback device that's mounted at /sdcard? If it's the latter, then does some system process quietly resize the virtual filesystem if /sdcard starts to get full? That's the thing I'd like to be able to read more about....
 
rootSU
Old
(Last edited by rootSU; 10th January 2014 at 05:41 PM.)
#4  
rootSU's Avatar
Senior Member
Thanks Meter 10,765
Posts: 21,934
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Quote:
Originally Posted by Ghengis042 View Post
So, I asked "why don't they just make one partition with sub-directories", and it sounds like to a certain extent that's exactly what happens. It sounds like /data is one physical partition. When you say that /sdcard "points to" /data/media/0, does that mean that it's just a subfolder that's treated specially, and softlinked to /sdcard? Maybe a loopback device that's mounted at /sdcard? If it's the latter, then does some system process quietly resize the virtual filesystem if /sdcard starts to get full? That's the thing I'd like to be able to read more about....
So to elaborate a little,

/data is a physical partition.

/data/data
/data/app
/data/media

Are all just directories within /data

/data is 11.35 GB on a 16 GB Version so the maximum any directory in /data can be is 11.35 GB. All /data directories combine to make up this total, just like any other /partition/directory structure

The fact that within /data/media is a FUSE file system isn't too relevant to space usage really. Nothing needs resizing. /data/media's free space is the same as /data/app's free space because they're all pulling from the same location as a shared resource. If you put 2 GB in /data/app, that's 2 GB less that can be used in /data/media

Hope that helps

Edit... and yes, /data/media/0 is the mount point for the universally used /sdcard

-----------------------
Sent via tapatalk.

I do NOT reply to support queries over PM. Please keep support queries to the Q&A section, so that others may benefit
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
 
Ghengis042
Old
#5  
Member - OP
Thanks Meter 7
Posts: 69
Join Date: Nov 2007
Quote:
Originally Posted by rootSU View Post
So to elaborate a little,

/data is a physical partition.

/data/data
/data/app
/data/media

Are all just directories within /data

/data is 11.35 GB on a 16 GB Version so the maximum any directory in /data can be is 11.35 GB. All /data directories combine to make up this total, just like any other /partition/directory structure

The fact that within /data/media is a FUSE file system isn't too relevant to space usage really. Nothing needs resizing. /data/media's free space is the same as /data/app's free space because they're all pulling from the same location as a shared resource. If you put 2 GB in /data/app, that's 2 GB less that can be used in /data/media

Hope that helps

Edit... and yes, /data/media/0 is the mount point for the universally used /sdcard
OK, I think I get it. I'd still be interested in seeing what "ls -l /data/media" looks like -- is "0" a *file* or a *directory* or some kind of block-device? I'm just experienced enough at Linux to be intrigued but inexperienced enough not to have dealt with this kind of thing (on a computer) before...
 
rootSU
Old
#6  
rootSU's Avatar
Senior Member
Thanks Meter 10,765
Posts: 21,934
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Here you go...



-----------------------
Sent via tapatalk.

I do NOT reply to support queries over PM. Please keep support queries to the Q&A section, so that others may benefit
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following User Says Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
Ghengis042
Old
#7  
Member - OP
Thanks Meter 7
Posts: 69
Join Date: Nov 2007
Welp, sure looks like a normal directory to me. I'm guessing that /sdcard is just a plain softlink then? Seems like the right way to do it...
 
rootSU
Old
#8  
rootSU's Avatar
Senior Member
Thanks Meter 10,765
Posts: 21,934
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Yeah its a "mount -o bind"

-----------------------
Sent via tapatalk.

I do NOT reply to support queries over PM. Please keep support queries to the Q&A section, so that others may benefit
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.

Tags
partition, storage
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Get Your Tasks Organized on Android Wear with Agenda Wear

Having a checklist of things you need to do is something we all can find useful at … more

Top 5 LG G3 MODs – XDA Developer TV

The LG G3 has been LG’s breakout hit of the summer. Using their knowledge frombuilding some … more

Make Your Calendar Widget Beautiful with Month

For some of us, summer vacation is alreadyover. For those getting ready to school, work, or … more

Integrate Social Networks Into Your Project With ASNE Library

Social network applications and services have developed into major parts ofour … more