Build CM12 for Xperia E3 and Xperia T

XDA Senior Member Vynikalput together this guide to help you learn how to build your own nightlies … more

Lollipop for OnePlus One Enters Testing Stage

Cyanogen just announced on their twitter that their CyanogenMod Lollipop build for the OnePlus … more

Xiaomi Business Model Unlike Usually Conceived

This article explains how Xiaomi sells phones not just to be a mobile OEM, but also to seed … more

Note 4 Launcher Theme Collection

If you like the features and integration of the TouchWiz Launcher on your Note 4, FrenchFamousTeam put … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Ghengis042

10th January 2014, 02:23 PM   |  #1  
OP Member
Thanks Meter: 7
 
69 posts
Join Date:Joined: Nov 2007
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?
10th January 2014, 02:37 PM   |  #2  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 14,610
 
26,082 posts
Join Date:Joined: Aug 2010
More
Quote:
Originally Posted by Ghengis042

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
The Following User Says Thank You to rootSU For This Useful Post: [ View ]
10th January 2014, 06:27 PM   |  #3  
OP Member
Thanks Meter: 7
 
69 posts
Join Date:Joined: Nov 2007
Quote:
Originally Posted by rootSU

http://forum.xda-developers.com/show....php?t=2534010

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....
10th January 2014, 06:38 PM   |  #4  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 14,610
 
26,082 posts
Join Date:Joined: Aug 2010
More
Quote:
Originally Posted by Ghengis042

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
Last edited by rootSU; 10th January 2014 at 06:41 PM.
10th January 2014, 07:33 PM   |  #5  
OP Member
Thanks Meter: 7
 
69 posts
Join Date:Joined: Nov 2007
Quote:
Originally Posted by rootSU

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...
10th January 2014, 09:23 PM   |  #6  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 14,610
 
26,082 posts
Join Date:Joined: Aug 2010
More
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
The Following User Says Thank You to rootSU For This Useful Post: [ View ]
10th January 2014, 09:31 PM   |  #7  
OP Member
Thanks Meter: 7
 
69 posts
Join Date:Joined: 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...
10th January 2014, 09:37 PM   |  #8  
rootSU's Avatar
Senior Member
Flag Oxenhope, West Yorkshire, UK
Thanks Meter: 14,610
 
26,082 posts
Join Date:Joined: Aug 2010
More
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

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes