Contents:
Background of Android storage (Pre-Nexus 5)
How the Nexus 5 is different
You lost me at file system
Did I REALLY need to know ALL that?
A bit more info for the Nexus 5
Deleting data
Wow, all this time I've been stressing, is it really that simple?
Phone won't boot, can I get my data back from internal memory?
Display and Digitiser won't work, can I get my data back from internal memory?
Data corruption
Wiped /cache and now data is lost
Preventing data loss
Usable space
Where are CWM backups / Storage menu doesn't show all my data (Available space is less than adding up used space / What is "system data"?)
USB OTG storage
I have duplicate sdcard data
Other info
Nexus 5 Data (loss / recovery / prevention)
This thread is intended to give you an overview of some of the Storage of the Nexus 5 from a Data Loss and recovery perspective. It is not intended to cover USB sticks or mods for other storage. It is solely to cover day-to-day data concerns and give a background to how these things work
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Before we get started...
Here are a couple of threads you should get familiar with before posting on XDA.
A message from the moderators - All users please read
QUESTIONS DO NOT GO IN GENERAL - There is a Q&A Forum - Please Use It
Backround of Android storage (Pre-Nexus 5)
Firstly, I think we need to understand how Android worked historically as this will help us to understand how the Nexus 5 works now.
A legacy android device, lets pretend the Nexus 1 on Android 2.2 as this was a standard configuration at the time. It had 2 major partitions (and several minor ones which are irrelevant to this topic). It has the /system partition and the /data partition. These were partitions of the internal NAND flash memory.
/system is where the Android operating system lives. The user could not delete or change anything in here (unless you were rooted). All the software that came with the phone was installed in the /system partition
/data is where all the userdata goes. Whenever you installed an app from the market, it installed to /data/app and it put all it's important data into /data/data. Also any system settings you changed (Wallpaper, ringtones etc) all were stored in /data/data. When you did a factory reset, it wiped /data and everything in it.
Of course, having these 2 partitions was not enough for everyday use. There was no where to store your music, photos, documents etc. /data is just for app data and settings. So this is where /sdcard comes in
/sdcard is the Android mount point for the External SD card in this legacy android device. This means that when you inserted a Micro SD card, Android used /sdcard as it's internal reference to where the card's storage is. The /sdcard was a necessity before you could take photos. Over time, bigger apps started to put other data here. For example, a GPS / Map application would store its apk (application package) in /data/app and store your personal configuration settings in /data/data but it may download and store offline maps somewhere on the /sdcard. In older devices, the internal Memory (NAND Flash) was usually too small to allow much data on it. Many users would have to root to get more storage space or keep uninstalling apps to keep the "low on space" warnings at bay
How the Nexus 5 is different
Well, the Nexus 5 is substantially different. There are of course SOME similarities. For example, the Nexus 5 still has internal NAND Flash Memory. This is often referred to as the eMMC (Embedded MultiMedia Card) - which still contains the /system and /data partitions, used in exactly the same way.
The main difference is /sdcard. The Nexus 5 is designed specifically to not have an SD card. It has a larger NAND Flash internal memory (eMMC) so it can also have an "internal SD card". This is where people start to get confused. The entire internal memory is an eMMC which is essentially an internal SD card, however a partition of that internal memory is /sdcard.
OK, I know - let me explain. /sdcard is a mount point that Android uses to know where to store /sdcard data. But on the Nexus 5, instead of storing it on a required external sd card, it points to an internal memory partition. Now here is the clever bit. The /sdcard actually points to /data/media/0. So you continue to have your /data partition, but within /data you have:
/data/app
/data/data
/data/media/0
The clever thing is that the file system that android uses for /system and /data is a Linux file system called Extended FS. In our case, we use the Ext 4 file system. This is important to understand because these file systems do not work with Windows so an external SD card would usually be Fat 32 file system, or exFAT so we could plug it into our windows computers and read the contents. What Google have had to do is use the FUSE file system to allow /sdcard (or /data/media/0) to be accessed from windows. Clever stuff. But it has it's pro's and cons...
Ext 4 is seen as a safer file system to FAT, or any of the Windows friendly ones. This is because it has something called journalling which keeps data safer from corruption and errors. Ext 4 also preserves permissions on files, so the data is safer from anything that may be malicious on your phone. Using FUSE with MTP and PTP means we have maximum compatibility across computer OS platforms.
You lost me at file system
All electronic systems that have an operating system and store data use a file system. Think of it in it's simplest form. Imagine a school text book. It has lots of chapters about different things. It has a "Table of Contents" in the first few pages, telling you where each chapter in the book is so if you want to know what page chapter 13 is on, you look in the contents and find the page and go straight there - The alternative is looking through each page individually to find the chapter. Not a quick process.
Well data storage works the same. When you put a file on a hard drive, sdcard, USB stick (or whatever) it is written to a specific location. When it is written to this location, the location is added to the file system. So when you put word.doc onto the drive, The file system is informed of the (very complicated) location of the file. When you tell Windows, Android (or whatever) that you want to open word.doc, the operating system consults the File system and goes to retrieve the data from its true and real (yet very complicated) location on the drive.
Did I REALLY need to know ALL that?
You know what? Probably not but it may go some way to help understand the limitations we will cover later on.
A bit more info for the Nexus 5
One thing many of you have probably noticed is that with the Nexus 5, there is no option to mount the /sdcard as USB Mass storage on your computer. You must use MTP or PTP.
PTP - Photo Transfer Protocol. When you connect your Nexus 5 to your computer using PTP, Your computer sees it as a camera. It will show photos on your "camera" and will set about implementing the default camera options (such as suggesting you import your photos) etc. It won't show documents or other media necessarily.
MTP - Media Transfer Protocol. When you connect your Nexus 5 to your computer, it will be seen as a media player. This should allow you full access to all the files on there, including word documents and the such like.
One of the reasons for this is that because /sdcard points to something using the FUSE file system and is not a true partition, it would be difficult to allow it to be used as USB Mass Storage. It may or may not be possible but the biggest advantage of using MTP / PTP is that the computer and the Nexus 5 can both access the internal memory at the same time. With USB Mass Storage (UMS) this is quite awkward and can result in errors.
The draw back of these protocols is that you cannot give your device a Windows "Drive letter"
Deleting data
This is partially why we needed to understand a little about file systems. So I could explain to you how data is handled when it is deleted.
As I explained earlier, when you write a file to memory, a corresponding entry is written to the file system to advise the OS where the data is. Sure, you may think you are writing the file to /sdcard/documents/work directory on the internal memory, but in reality these directories or folders do not actually exist at a memory hardware level. The data is written to a block and the file system is informed where that block is, how big the file is, what directory it should appear in to the OS etc. When a file is written the memory, the OS see's the available space go down and the used space go up. All this information comes from the file system.
When you delete the file, the actual data is NOT deleted. It remains where it is on the memory. The block is not overwritten. When the OS is told by the user to delete the file, the File system entry is deleted. This changes the free/used space as the file system is no longer accounting for the data, however the truth is the data still exists. When the next request to write a file to the memory comes from the OS, the file system will think the block where the old data was is empty and will overwrite it.
It is this difference between the file system and reality that allows data to be recovered by external software. if you do not write any data to the memory, external software can scan the memory for data whilst bypassing the file system all together. Ff course the window is small. You only have a very limited time to recover data before the file system allows the data to be overwritten with a new entry.
This is not just true of a deleted file. Even formatting the memory (which is actually just re-creating a new, blank file system) leaves all the data in tact behind-the-scenes and can all still be recovered until you start writing data to the memory. Cool huh?
Wow, all this time I've been stressing, is it really that simple?
Awwww snap! You got me. No it is not that simple. All this PC software, example: Piriform recuva only works on a computer drive. In windows, imagine this is anything with a Drive Letter. C: drive etc. The only way to get a drive letter on your /sdcard is to use USB Mass Storage mode, which as previously discussed - is not possible on your Nexus 5.
It is not realistically possible to get your data back once deleted from internal memory. Once gone, it's gone forever*
* Please see This post as pointed out by @efrant as a possible method which was touted as "not for the faint of heart"
* Some people have reported success with DiskDigger
Phone won't boot, can I get my data back from internal memory?
Let's start by saying, it depends why your phone won't boot. If your internal eMMC (NAND FLash memory) has failed, then probably not. However, if you believe this is not the case then you can get your /sdcard data using adb BUT you need a custom recovery to be flashed, which also requires your bootloader to be unlocked - Read THIS
However, if out of curiosity - you do still want to get your data off, using adb , read below:
Pre requisite is having adb "installed" on your windows PC. Download THIS file and follow the instructions in the readme.
1) Boot into recovery, connect usb and go to "mounts and storage". Toggle the "mount data" options to mount these partitions. Tip, when mounted, the option then becomes "unmount data"
2) Open "cmd" in Windows and type the below code, which will copy all your data to a folder called sdcard on your windows desktop
Code:
adb pull /data/media/0/ c:\users\rootsu\desktop\sdcard
Also note, this assumes you have windows vista or newer. Also, it assumes your windows username is rootsu.
That's it, simple.
Display and Digitiser won't work, can I get my data back from internal memory?
You can use adb and a custom recovery to pull data from your /sdcard or even app data from /data/data
Pre requisite is having adb "installed" on your windows PC. Download THIS file and follow the instructions in the readme.
1) Boot into recovery, connect usb and go to "mounts and storage". Toggle the "mount data" options to mount these partitions. Tip, when mounted, the option then becomes "unmount data"
2) Open "cmd" in Windows and type the below code, which will copy all your data to a folder called sdcard on your windows desktop
Code:
adb pull /data/media/0/ c:\users\rootsu\desktop\sdcard
Other things you may want to pull.....
Code:
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db c:\users\rootsu\desktop\sdcard
Code:
adb pull /data/data/com.android.providers.contacts/databases/contacts2.db c:\users\rootsu\desktop\sdcard
Also note, this assumes you have windows vista or newer. Also, it assumes your windows username is rootsu.
That's it, simple.
FYI, if you want to use adb pull in Android (Kitkat+) it's different. Instead of /data/media/0, use /sdcard (yes you could use /sdcard in recovery too, but not all recoveries mount everything correctly to /sdcard).
Otherwise, in Android you'd need to mount /data rw....
Code:
adb root
restarting adbd as root
adb shell
mount -o rw,remount /data
exit
adb pull <whatever>
Data corruption
When data becomes corrupt, there's really not a lot you can do. The file system knows where the data is already. If it's corrupt, you're stuck. Most common causes of corruption is dirty unmount (phone shuts off when writing) or dodgy flash / wipe. If your data is corrupt, there really isn't much you can do to restore it. This is why backups are important.
Wiped /cache and now data is lost
It's quite common during a bad /cache wipe that data appears to be lost or even cannot connect to the mobile network. The data is still there however, you just can't see it.
If your bootloader is unlocked, you can usually fix this by using fastboot to flash the stock cache image
Code:
fastboot flash cache c:\path_to\cache.img
Of course unlocking the bootloader wipes data so if you haven't, you won't want to. All you can do is try to reformat /cache via stock recovery a few times.
Factory images (to get cache.img) can be found here: https://developers.google.com/android/nexus/images
Preventing data loss
Time to wise up guys. It is possible to recover data off your removable media, but internal memory - very unlikely. No apps on your PC or Android will help with deleted data. So you need to backup.
Dropbox - Use dropbox to automatically upload your photos to online storage.
Foldersync - Use FolderSync to upload important sdcard files to your dropbox account, or better yet - got a computer thats always on at home? Set foldersync to schedule a sync over wifi whilst you're asleep.
I personally use Tasker with Foldersync. I have tasks that upload new photos over sftp to my NAS, no matter where I am and tasks that backup /sdcard overnight to my NAS whilst I sleep.
Useable space
32 GB Nexus isn't 32 GB. 16 GB Nexus isn't 16 GB
Here is how it works.
A true GB is 1024 MB, which is 1024 KB, which is 1024 B. This is how Software (including operating systems) report a true GB (Now referred to as GiB).
Hardware manufacturers however, refer to a GB as 1000 MB, which is 1000 KB, which is 1000 B. So there is a disparity here that gets bigger, the higher the number.
So you need to employ mathematics to work out the TRUE capacity of the Nexus 5.
Take your 32 GB reported hardware, and multiply it by 1000 a total of 3 times. Then, take the result and divide it by 1024 a total of 3 times. This is the total true capacity
32 x 1000 MB x 1000 KB x 1000 B = 32,000,000,000 B
32,000,000,000 B / 1024 B / 1024 MKB / 1024 MB = 29.8 GB
So in summary, any SD card, SSD, Device, HDD that reports to have "32 GB" capacity, it is only ever 29.8 GB (or 29.8 GiB) capacity.
So now it starts to add up a bit more. Then obviously there is a recovery partition, cache partition, System partition and more..... which is excluded from the total "storage"
Here are the main partitions (excluding /data which was 12.6GB) for the N5 (taken from a 16GB) - use "df" from terminal
/system 1009.3M
/cache 689.8M
/persist 15.8M
/firmware 64.0M
However, there are technically 29 partitions, they obviously don't add up to much between the others - use "ls -lR /dev" from terminal
Code:
lrwxrwxrwx root root 1970-01-15 02:15 DDR -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1970-01-15 02:15 aboot -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1970-01-15 02:15 abootb -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1970-01-15 02:15 boot -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1970-01-15 02:15 cache -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1970-01-15 02:15 crypto -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1970-01-15 02:15 fsc -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1970-01-15 02:15 fsg -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1970-01-15 02:15 grow -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1970-01-15 02:15 imgdata -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-15 02:15 laf -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1970-01-15 02:15 metadata -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1970-01-15 02:15 misc -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-15 02:15 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1970-01-15 02:15 modemst1 -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1970-01-15 02:15 modemst2 -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1970-01-15 02:15 pad -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1970-01-15 02:15 persist -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1970-01-15 02:15 recovery -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1970-01-15 02:15 rpm -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1970-01-15 02:15 rpmb -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1970-01-15 02:15 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1970-01-15 02:15 sbl1b -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1970-01-15 02:15 sdi -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1970-01-15 02:15 ssd -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1970-01-15 02:15 system -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1970-01-15 02:15 tz -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1970-01-15 02:15 tzb -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1970-01-15 02:15 userdata -> /dev/block/mmcblk0p28
USABLE space for the user is:
26.7 GB for the 32 GB
12.55 GB for the 16 GB
Where are CWM backups / Storage menu doesn't show where all my data is
Please note, rooted users with clockworkmod recovery will find that their backups to not go to /data/media/0/clockworkmod as it is supposed to. The reason for this is CWM has not been updated to this location, instead it uses the legacy location of /data/media/clockworkmod. The Storage menu can see that the space is used but it cannot include it in it's breakdown. Please check this location. You'll need to move it to 0 if you want to access it on a computer
/data/media is the OLD location of /sdcard. All recoveries should use /data/media/0 as /sdcard but CWM itself is antiquated. Really you should upgrade to Philz or TWRP recovery.
A handy app is "Disk Usage" on Play. It can help identify exactly where this data is....
USB OTG storage
The Nexus 5 by default does not automatically mount USB Storage. There are a few options for you however.
1) Buy Nexus Media Importer - No-root required (Read description before purchase)
2) Use OTG USB Helper or Stickmount which are both free but require root
3) Use a custom kernel such as Chaos Kernel with automount of USB OTG
I have duplicate sdcard data
I bet you haven't. All these locations all point to the same place. If you're looking in any of these, you're looking at your sdcard data so don't delete it.
/sdcard
/data/media/0
/data/media/legacy
/storage/sdcard0
/storage/emulated/0
/storage/emulated/legacy
Other info
This is a work in progress. Please let me know if you think I need to reword something or add something.
You have a lot of good information in there.
However, there are a couple of things that I would consider not entirely accurate:
1)
rootSU said:
Well, the Nexus 5 is substantially different.
Click to expand...
Click to collapse
The issue with this is that the changes to the file system are not related to the Nexus 5, but are related to the version of Android. The changes you talk about came with Android 4.2, and any device using 4.2 (or newer) with no external sdcard (e.g., Galaxy Nexus, Nexus 4, etc.) will have the same file system structure. What you see on the N5 is no different that the Galaxy Nexus for example.
2)
rootSU said:
It is not realistically possible to get your data back once deleted from internal memory. Once gone, it's gone forever.
Click to expand...
Click to collapse
This is not true. There are ways to dump your userdata partition to your PC and you can recover your deleted files. See here for an example. It is not for the faint of heart, but it is doable.
efrant said:
You have a lot of good information in there.
However, there are a couple of things that I would consider not entirely accurate:
1)
The issue with this is that the changes to the file system are not related to the Nexus 5, but are related to the version of Android. The changes you talk about came with Android 4.2, and any device using 4.2 (or newer) with no external sdcard (e.g., Galaxy Nexus, Nexus 4, etc.) will have the same file system structure. What you see on the N5 is no different that the Galaxy Nexus for example.
2)
This is not true. There are ways to dump your userdata partition to your PC and you can recover your deleted files. See here for an example. It is not for the faint of heart, but it is doable.
Click to expand...
Click to collapse
Thanks.
2) ill have a look at that tomorrow.
1) i've been using FUSE since 4.0.4 and //data/media/0 since 4.2 but this is a Nexus 5 thread. I'm showing how the Nexus 5 specifically is different from earlier android versions. My S3 version of this thread states that the S3 is substantially different too. It's not relevant to talk about FUSE in pre 4.2 android context in a device thread that launched with 4.4 - the outline is to distinguish between having to have an sdcard and not having to have an sdcard today - but I don't really think different iterations of internal /sdcard need to be mentioned. The journey isn't as important as the disparity between the start and "end" points
-----------------------
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
rootSU said:
[snip]
1) i've been using FUSE since 4.0.4 and //data/media/0 since 4.2 but this is a Nexus 5 thread. I'm showing how the Nexus 5 specifically is different from earlier android versions.
Click to expand...
Click to collapse
Maybe I misunderstood then.
You say you are showing "how the Nexus 5 specifically is different from earlier android versions." What do you mean exactly?
Do you mean you are showing:
a) how 4.4 specifically is different from earlier android versions, or
b) how the Nexus 5 specifically is different from earlier android devices?
In any case, in terms of what you are discussing (i.e., /sdcard, directory structure, data recovery, etc.):
a) 4.4 is no different than 4.2.
b) the Nexus 5 is no different than the Nexus 4
so I'm not entirely sure I understand what you are getting at.
If I misunderstood, and 4.4 is different than 4.2, or the N5 is different than the N4 (in the context of the discussion here, i.e., /sdcard, directory structure, data recovery, etc.), then I would be interested in hearing your thoughts. Since having both devices, I have seen no difference at all.
EDIT: The only reason I am mentioning any of this, is that in my opinion, it is misleading to refer to "Pre-Nexus 5", as it implies that everything before was different, when in fact it wasn't. In any case, after re-reading your reply, I think you are showing the comparison of the Nexus 5 and Android 4.4 versus an older device (pre-GNex) with a version of Android pre-4.2.
Nice write up.
Sent from my Nexus 5 using xda app-developers app
efrant said:
Maybe I misunderstood then.
You say you are showing "how the Nexus 5 specifically is different from earlier android versions." What do you mean exactly?
Do you mean you are showing:
a) how 4.4 specifically is different from earlier android versions, or
b) how the Nexus 5 specifically is different from earlier android devices?
In any case, in terms of what you are discussing (i.e., /sdcard, directory structure, data recovery, etc.):
a) 4.4 is no different than 4.2.
b) the Nexus 5 is no different than the Nexus 4
so I'm not entirely sure I understand what you are getting at.
If I misunderstood, and 4.4 is different than 4.2, or the N5 is different than the N4 (in the context of the discussion here, i.e., /sdcard, directory structure, data recovery, etc.), then I would be interested in hearing your thoughts. Since having both devices, I have seen no difference at all.
EDIT: The only reason I am mentioning any of this, is that in my opinion, it is misleading to refer to "Pre-Nexus 5", as it implies that everything before was different, when in fact it wasn't. In any case, after re-reading your reply, I think you are showing the comparison of the Nexus 5 and Android 4.4 versus an older device (pre-GNex) with a version of Android pre-4.2.
Click to expand...
Click to collapse
Ok, to be succinct...
The reader of this thread should have a nexus 5. This thread is about the Nexus 5. Regardless of whether anything is an "android feature" or a "nexus 5 feature", this thread is being read because the reader owns a Nexus 5.
Android 4.2, Nexus 4, Galaxy S3 - they do not matter. They are not important. I only wish to show what /sdcard used to mean to android in a pre-fuse context and what /sdcard means to android -specifically on a Nexus 5. What /sdcard means on the Nexus 4 is irrelevant. Got A Nexus 4? Read a nexus 4 thread. I cannot attest to that.
When someone tries to sell loft-insulation to a home owner, they sell it in context "your home could benefit" rather than "a house could benefit". I don't want anyone to look at this and say "that's not true on my phone" because i've generalised "android this" or "android that" and I don't feel it necessary to further caveat that by "well except this version of android" or "unless you have a Galaxy S2". Its a Nexus 5 thread.
Thanks for your feedback but I wont be changing that. Hope you understand.
Not so succinct afterall
Please feel free to pm me if you wish.
Edit... just so you know, i'm not taking this personally. Its all constructive. ...and I do hope im not coming off as rude. Im just trying to clarify my point
-----------------------
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
Deleted
!dea
Your contents are rather informative and had let me think this way. As in androids with SD Card feature come with two partitions, why can't we Partition Internal memory to two drives and let use one for Android kernel and another as /sdcard If this is possible, USB Mass Storage would become possible and guarantee File transfers, well as one does with SD (that too in Maxi Speed!). Is this possible?:cyclops:
arvindgr said:
Your contents are rather informative and had let me think this way. As in androids with SD Card feature come with two partitions, why can't we Partition Internal memory to two drives and let use one for Android kernel and another as /sdcard If this is possible, USB Mass Storage would become possible and guarantee File transfers, well as one does with SD (that too in Maxi Speed!). Is this possible?:cyclops:
Click to expand...
Click to collapse
Then you would need to have a set a limited size /data partition. So instead of having
/data (including /sdcard) = 12.35 GB
You have:
/data = 2GB
/SDcard = 10.35 GB
But is 2 GB enough for /data? Usually not...
Also, you cannot then use /sdcard if it is plugged into the computer.
Its more trouble than it is worth. Just backup your /sdcard data regularly.
rootSU said:
Then you would need to have a set a limited size /data partition. So instead of having
/data (including /sdcard) = 12.35 GB
You have:
/data = 2GB
/SDcard = 10.35 GB
But is 2 GB enough for /data? Usually not...
Also, you cannot then use /sdcard if it is plugged into the computer.
Its more trouble than it is worth. Just backup your /sdcard data regularly.
Click to expand...
Click to collapse
Thank u for response. Sure 2GB not gonna be sufficient. If I illustrate needs you could understand,
I use Ttorrent Client for downloading files and often USB MTP Mode does not list recently downloaded files especially through Ttorrent. Reboot suffixes Bug, yet remain Troublesome.
Also, I have habit watching Large-size Movies which mostly seem above 2GB's. For copying such .mkv (or) .avi through I need to disable Security lock or else, file copy gets interrupted! (Not that adb push). Also, if interrupted s/w like Teracopy help resume copy. Another significant drawback on MTP is, every time I copy some non-proprietary contents it issues warning like "This content may not play in your device". For one instance it is Okay. But, for months, and for long run it is annoying!.
Maybe for time I remember only these. Your comment about non-availability of /sdcard is agreeable but rather said drawbacks, I could manage that one. As said surely 2GB won't be sufficent, Say if I split partitions to some 7GB+remaining. It would suffix the needs. Next time, Link me(us) some source or post me instructions to do so, such that I'd consider trying...
Sorry is ttorrent on pc or android? Please can you describe set up / actions in detail so I can better understand the problem?
-----------------------
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
Thank much for your clear instruction! Reallly helps me to figure out how android system works.It is crystal clear!
Sent from my Nexus 5 using XDA Premium 4 mobile app
Reply
rootSU said:
Sorry is ttorrent on pc or android? Please can you describe set up / actions in detail so I can better understand the problem?
-----------------------
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
Click to expand...
Click to collapse
Sure on phone. PC's consume more power to do same I do, over phones!!!:angel: Running torrent client on phone, fore-said things are to be considered.:fingers-crossed:
arvindgr said:
Sure on phone. PC's consume more power to do same I do, over phones!!!:angel: Running torrent client on phone, fore-said things are to be considered.:fingers-crossed:
Click to expand...
Click to collapse
OK I am still struggling to understand your problem. I think we can find a solution but I still dont understand where the issue is. Please can you simplify the issue for me?
Thank you for this summary. Though I have a question about this.
The /sdcard actually points to /data/media/0. So you continue to have your /data partition, but within /data you have:
/data/app
/data/data
/data/media/0
Click to expand...
Click to collapse
As I did not do a nandroid backup via Recovery yet, I wonder how /data is backed up besides /system, as /sdcard is a mount of /data/media/0 instead of an external device. So /data is backed up to itself recursively which will not make much sense.
Does the backup system detect /data/media/0 and exclude it from the backup or do I misunderstand something about this whole
concept ?
Also, do I understand correctly that, if the /data partition itself gets corrupt I will not be able to flash a backup of it because /data
can not be mounted and in consequence /data/media/0 can not be mounted at /sdcard to access the backup ?
Also I did not find reliable information on what nandroid actually backs up and what it doesn't.
Thank you all in advance for answers.
Edit:
I hope this is not a violation of QUESTIONS DO NOT GO IN GENERAL as I think this fits here quite well.
Luddi said:
I hope this is not a violation of QUESTIONS DO NOT GO IN GENERAL as I think this fits here quite well.
Click to expand...
Click to collapse
No, it's fine. It's what the thread is for, to service these kind of queries instead of creating new threads.
Luddi said:
As I did not do a nandroid backup via Recovery yet, I wonder how /data is backed up besides /system, as /sdcard is a mount of /data/media/0 instead of an external device. So /data is backed up to itself recursively which will not make much sense.
Does the backup system detect /data/media/0 and exclude it from the backup or do I misunderstand something about this whole
concept ?
Also, do I understand correctly that, if the /data partition itself gets corrupt I will not be able to flash a backup of it because /data
can not be mounted and in consequence /data/media/0 can not be mounted at /sdcard to access the backup ?
Also I did not find reliable information on what nandroid actually backs up and what it doesn't.
Click to expand...
Click to collapse
You are right, in that the /sdcard or /data/media/0 is not backed up in a nandroid backup. nandroid backs up /system, /cache and /data (excluding legacy and 0, 1, 2 etc). It may backup more depending on what recovery you are using and what options you have configured for backups.
In regards to /data corruption, it is really hard to say because each corruption case is different. All i can really tell you is backup your backups off device.
rootSU said:
OK I am still struggling to understand your problem. I think we can find a solution but I still dont understand where the issue is. Please can you simplify the issue for me?
Click to expand...
Click to collapse
Let's cut to chase.
1. I'm not comfortable with MTP type connection.
2. I want to split internal memory to two partitions.
3. How to do that? (Like 7GB for Internal Android files and remaining space like 5.9GB for /sdcard)
4. Enable /sdcard partition to mount as Mass Storage drive when I connect device to computer...
Previously I've been telling the need for that. Just reply whether it's possible to and how to...
Can u get me now?
Sent from my Nexus 4 using Tapatalk
arvindgr said:
Let's cut to chase.
1. I'm not comfortable with MTP type connection.
2. I want to split internal memory to two partitions.
3. How to do that? (Like 7GB for Internal Android files and remaining space like 5.9GB for /sdcard)
4. Enable /sdcard partition to mount as Mass Storage drive when I connect device to computer...
Previously I've been telling the need for that. Just reply whether it's possible to and how to...
Can u get me now?
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
I got THAT and NO IT IS NOT Possible. I wanted to understand the problem so I could offer alternative solutions but since you cannot be bothered to explain yourself correctly, I no longer want to try and help you. Get me now?
I won't have wrote much times if I have not bothered. I'm glad that you got the thought.
rootSU said:
Then you would need to have a set a limited size /data partition. So instead of having
/data (including /sdcard) = 12.35 GB
You have:
/data = 2GB
/SDcard = 10.35 GB
But is 2 GB enough for /data? Usually not...
Also, you cannot then use /sdcard if it is plugged into the computer.
Its more trouble than it is worth. Just backup your /sdcard data regularly.
Click to expand...
Click to collapse
This reply implied as if it is possible. Actually this is not some problem. Since you have asking me detail problem, I want to portray the need. Rather than asking to detail problem for more times, you could have quoted have specific part, so that more information is gathered. Thank you for your time spent ... ^_^
Artistic Viable Ndugu on Mako
---------- Post added at 02:50 AM ---------- Previous post was at 02:43 AM ----------
I won't have posted many times of I didn't bother. Better as you were unable to understand it I was unable to explain, there is better way to split to specific parts of my question so that more efficient time is spent.
rootSU said:
Then you would need to have a set a limited size /data partition. So instead of having
/data (including /sdcard) = 12.35 GB
You have:
/data = 2GB
/SDcard = 10.35 GB
But is 2 GB enough for /data? Usually not...
Also, you cannot then use /sdcard if it is plugged into the computer.
Its more trouble than it is worth. Just backup your /sdcard data regularly.
Click to expand...
Click to collapse
This implied as if my wish us possible. Thank you for your time spent, maybe I'll keep looking for some solution and would post if I narrow down...
Artistic Viable Ndugu on Mako
So is this why es file explorer had recycle bin option? Because the data isn't really gone until it's overwritten?
Sent from my white Nexus 5 using xda-developers app.
Please press the thanks button if I help you.
At the risk of sounding like a complete n00b, I come to you all with an issue I'm experiencing. I know it's an operator error, so bear with me;
I just recently flashed Milaq's KK build. I increased the /system partition using the new CWM w/ data/media to 512 mbs. Everything is running well, but all the apps I install are installed to the internal memory, which maxes out around 1.4 gbs. My question is, how do I make the default install location the virtual ext SD card?
I hope this makes a bit of sense to you all - because I'm about to pull my hair out here.
Thanks for any/all input on my current situation.
I understood the partition/directory structure in my previous CM7/CM9 installs.
But with the new datamedia storage configuration I'm confused to all the various labels for the memory storage areas.
I've read the document at http://teamw.in/DataMedia
but the situation is still not very transparent.
• Under Android settings I see "Internal Storage" and "SD Card" and "USB Storage".
• In ES File Explorer I observe:
/sdcard ->
/external_sd -> /storage/sdcard1
/usbdisk -> /storage/usbdisk
/storage/emulated
/storage/sdcard0 ->
/storage/sdcard1
/storage/usbdisk
• In X-plore I also observe:
/storage/0
/storage/legacy
• CM File Manager app top level directory is labeled as "0":
It appears there is various crossover in directory mappings. Is there a definitive guide as to the partitions, directory structures/mappings and symlinks that apply to the above memory areas. There is already enough contradictory posts in various development threads on this so not asking for assumptions/presumptions. Hoping to hear from an expert/developer who knows this stuff on back of their thumb.
And what controls/manages where new apps are installed?
Good Question I also would like to know
While looking around the internet, I found this as a potential option;
In terminal;
su
pm set-install-location 2
I attempted it, but haven't noticed any difference.
/bangshead/
Stryeguy said:
While looking around the internet, I found this as a potential option;
In terminal;
su
pm set-install-location 2
I attempted it, but haven't noticed any difference.
/bangshead/
Click to expand...
Click to collapse
I think you are looking at this wrong. Instead of making Android use the external storage by default, you just need to make the data partition bigger and use that as your default storage. Milaq himself suggested this partition layout:
system - 600mb
cache - 200mb
media - 400mb
data - [remaining space] (i.e. ~11.5gb for 16gb TouchPads)
If you are going to go with Milaqs builds, The best way to do it is to move all your stuff from your sd card to your computer, wipe your sd card, use tailor in webOS to repartition to match what Milaq suggested and move all your stuff back onto your device in, I think, the sdcard0 folder (which should now have the majority of the space).
jsgraphicart said:
I think you are looking at this wrong. Instead of making Android use the external storage by default, you just need to make the data partition bigger and use that as your default storage. Milaq himself suggested this partition layout:
system - 600mb
cache - 200mb
media - 400mb
data - [remaining space] (i.e. ~11.5gb for 16gb TouchPads)
If you are going to go with Milaqs builds, The best way to do it is to move all your stuff from your sd card to your computer, wipe your sd card, use tailor in webOS to repartition to match what Milaq suggested and move all your stuff back onto your device in, I think, the sdcard0 folder (which should now have the majority of the space).
Click to expand...
Click to collapse
Thank you for your response - it was exactly what I was looking for. I knew I was overlooking a step.
I'll get around to doing that tonight.
Again, thanks so much.
:cheers:
I had the same question. But I just used tailor to resize the partitions. If it says file system error, let it fix it. As long as there are free space, all your files will stay.
Just posting a follow up;
Installed Tailor and repartitioned as per Milaq's instructions, and everything is working as it should be.
Thanks for the help, guys. Glad to know it was just my reading skills that were lacking.
I'm very confused about the storage on my Moto G 2nd Gen 2014, running stock KitKat.
If I look at System Settings - Storage, for the Internal Storage it shows Total 5.51GB, Available 1.08GB, Apps 6.06GB (what!), Pictures 7.09MB, Audio 220KB, Downloads 24.49MB, Cached data 389MB, Misc 316MB.
Link2SD - Storage Info shows the same 5.51GB Total, 1.08GB Available for Internal /data and SD Card /storage/emulated/legacy.
When I look with ES File Explorer, it shows 5.51GB Total and 4.43GB Used for my internal SD (/storage/sdcard0 or storage/emulated/0). However, checking the properties of the folders, they don't add up to anything like that and if I run SD Card Analyst with Root Explorer and Show Hidden Files enabled and tap Directory Analyse it finds a total of 735.78MB, with Apps being only 42.30MB, Others 460.79MB, Audio 194.90MB, Picture 15.19MB, Document 17.79MB and Video 4.82MB. In the folder view sorted by size it shows Android 402.12MB, Recordings 109.34MB, voix 82.82MB, TunnyBrowser 50.58MB, com.alk.copilot.mapviewer 27.20MB, Download 24.41MB, six more folders under 10MB and 40 more under 1MB, with about half of those showing 0.00B.
So can anyone explain what's going on here, as I'm completely baffled?
Just bumping in the hope someone will see this who can help me.
Depending on how an app works when it stores it's data on the microSD it can still show in the Settings>Storage as on the internal memory (WoT Blitz did this when I had that installed) so that can make your apps look like you have 6.6GB on the internal memory, also in a file explorer the directory in which Android, DCIM, Music, Ringtones ect. is not the 'top most' directory, in ES File Explorer you can hit the '/' (also called Device) in the top bar and there are a load more files there. If you do a 'Select all'>Properties does that come close to the 4.4GB space used?
jay2the1 said:
Depending on how an app works when it stores it's data on the microSD it can still show in the Settings>Storage as on the internal memory (WoT Blitz did this when I had that installed) so that can make your apps look like you have 6.6GB on the internal memory, also in a file explorer the directory in which Android, DCIM, Music, Ringtones ect. is not the 'top most' directory, in ES File Explorer you can hit the '/' (also called Device) in the top bar and there are a load more files there. If you do a 'Select all'>Properties does that come close to the 4.4GB space used?
Click to expand...
Click to collapse
Hmm, I am using Obb2SD to move all my game data from Android/Obb to the external SD card, so maybe that's confusing it but that seems like it could be a problem as if it think the internal storage is full even when there's really plenty of space free, I imagine it will start throwing up errors and won't allow me to store anything else on it, which rather defeats the point of moving the games in the first place.
If I do select all->properties from / that includes my external SD as well and totals 46.42GB. Even if I unselect /mnt and /storage it still comes to 8.03GB which can't be just the internal storage as that's only 8GB in total and I supposedly have 1.43GB free on that. Just /data is 6.21GB.
You do know that your internal storage is a combination of your phone storage and internal storage right?
In case you didn't know just open root explorer and go to data folder (long press and select properties) and calculate how much storage it use...then do the same things with systems folder...then combined data storage + system storage + internal storage used and you will get almost the same amount like in settings/storages show you...
Sent Using My Xiaomi Redmi Note 4G
When I say Internal storage I simply mean that which is not the external SD card. I don't know what the difference between phone storage and internal storage is though, as far as I'm aware there's just 8GB internal storage.
Checking the properties for /data shows it as 6.21GB (6.31GB Used), so I suppose with 1.08GB available that totals 7.39GB which could be close enough to 8GB to be correct. /system is 1.17GB. Still doesn't make any sense that Settings - Storage and Link2SD shows Total 5.51GB, 1.01GB Available but Apps as 6.06GB. Nor does it make any sense that the Homepage in ES File Explorer shows 4.28GB used on 0 but tapping that, which takes me to emulated/0 and selecting everything, Properties only shows 700MB used.
Doing directory analyse on /data shows the majority in Others 3.70GB, then Apps 1.95GB. It's a pain there's no way to see how much storage is used by each folder without checking Properties for each one individually but if I untick all the folders starting with a then the total is 4.06GB (4.15GB used), so there's about 2.15GB in those folders. Unticking all the folders starting with b through d drops it down to 2.07GB (2.12GB Used) so they account for another 2GB. Digging deeper I can see that /data/app uses 1.73GB, /data/app-lib uses 432.15MB, /data/data uses 1.25GB, data/dalvik-cache uses 717.77MB, /data/media/ uses 554.41MB, /data/sdext2 uses 272.20MB, /data/user uses 1.25GB and everything else is inconsequential. Adding those up comes to roughly 6.2GB, which exceeds the Total 5.51GB that Settings - Storage shows, even without adding the 1.17GB from /system.
None of this helps me understand what in those folders is using up all the space though, so does anyone know of an app that will show the space used by folder, like Treesize for Windows?
Can no-one help me make sense of this? The weirdest thing is that 0 (Internal storage) in ES File Explorer's Home screen shows 4.28GB but opening that folder and selecting all the folders gives a total of only 700MB, which doesn't make any sense.
I see that Titanium Backup can produce a list of apps sorted by space used, so I'll try adding those up manually and see what they total. I have linked a few large apps to the external SD with Link2SD though, so they shouldn't be using any internal storage and I'll have to subtract their amounts from the total.
Well I decided to wipe data and dalvik-cache (i.e. factory reset) from TWRP and start again, to try and get to the bottom of this.
TWRP showed about 370MB out of 5.51GB used after wiping. After booting, this was about 560MB (I guess due to the dalvik cache repopulating, currently 258.98MB) and by the time Google Play had finished updating the pre-installed apps, this had risen to 1.27GB.
The majority of this, 1.17GB, is in /Data. Settings - Storage shows 4.24GB out of 5.51GB available. ES File Explorer is a bit stupid, as it shows the same in the Homepage the same for 0 (i.e. 1.27GB used out of 5.51GB) but tapping that links to emulated/0 (which is just an alternative path to /storage/sdcard0), which only has a total of 4.32MB in it. What the Homepage shows is actually the used space from root (i.e. /) so it should show and link to that, not /storage/ emulated/0.
Another anomaly is that /data/data and /data/user are alternative paths to the same place, containing 230.99MB, which results in it getting counted twice, so really there's only a total of 965.51MB of files in /data, not 1.17GB. Obviously as /data/data grows, that's going to result in even more space being doubly allocated and thus unavailable, i.e. if I have 1GB in /data/data, it's going to reduce my free space by 2GB.
I also notice that /data/app contains all the apks for the apps that are installed. I thought apks were just install packages, like Windows msi or exe installs and that when installed they unpacked to somewhere, so isn't it just wasting space keeping all of the apks here? It's only 357.19MB at the moment but when I checked it before I factory reset it was 1+, maybe 2+ GB, so that's obviously a lot of space to waste out of 5.51GB.
Hopefully someone can help me clear up these questions, as I don't want to start reinstalling all my apps yet if I might need to wipe it all again to reset it. I've backed up everything with Titanium but it's still quite a hassle, as there doesn't seem to be a way to make a list of installed (as opposed to backed up but not installed, or frozen) apps before wiping and then restore just those afterwards, so I'll have to go through the list and try and remember what I didn't have installed before and de-select those.