• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Storage Truth App Results Question

Mikestony

~30% Carbon Black ±
In checking with this fantastic app, Storage Truth , I noticed that it reads my external sd card memory.
I thought the app only displayed the internal storage available.

Capture+_2016-08-07-21-15-17.png


As seen in the title bar, I was curious as to why it displays 58.29 GB when my device is only 32GB.
My external SD card is 64GB, and I understand the 58.29 being shown (as some memory is taken up by other stuff).
So according to the notes written in the screenshot "the number displayed in the title bar indicates the size of the internal storage area......"

Confused, so I hit up Scary and ran an adb command, "adb shell cat /proc/partitions"
and here are the results.
I'll let @scary alien fill in some of the info :)

major minor #blocks name

254 0 972388 zram0
8 80 8192 sdf
8 81 2048 sdf1
8 82 2048 sdf2
8 83 512 sdf3
8 84 4 sdf4
8 48 8192 sdd
8 49 2048 sdd1
8 50 32 sdd2
8 51 4 sdd3
8 52 4 sdd4
8 0 30912512 sda
8 1 49152 sda1
8 2 32768 sda2
8 3 10240 sda3
8 4 6144 sda4
8 5 32768 sda5
8 6 16384 sda6
8 7 8192 sda7
8 8 40960 sda8
8 9 47104 sda9
8 10 512 sda10
8 11 512 sda11
8 12 512 sda12
8 13 512 sda13
8 14 512 sda14
8 15 32768 sda15
259 0 4718592 sda16
259 1 1261568 sda17
259 2 24649728 sda18
259 3 3540 sda19
8 16 32768 sdb
8 17 3072 sdb1
8 18 3072 sdb2
8 19 4096 sdb3
8 20 16384 sdb4
8 21 2048 sdb5
8 22 1024 sdb6
8 23 1024 sdb7
8 24 4 sdb8
8 96 8192 sdg
8 97 2048 sdg1
8 98 4 sdg2
8 32 8192 sdc
8 33 3072 sdc1
8 34 3072 sdc2
8 35 4 sdc3
8 64 237568 sde
8 65 40960 sde1
8 66 40960 sde2
8 67 40960 sde3
8 68 2048 sde4
8 69 2048 sde5
8 70 2048 sde6
8 71 2048 sde7
8 72 4096 sde8
8 73 4096 sde9
8 74 512 sde10
8 75 512 sde11
8 76 512 sde12
8 77 512 sde13
8 78 512 sde14
8 79 512 sde15
259 4 128 sde16
259 5 128 sde17
259 6 88064 sde18
259 7 512 sde19
259 8 512 sde20
259 9 512 sde21
259 10 512 sde22
259 11 512 sde23
259 12 512 sde24
259 13 512 sde25
259 14 512 sde26
259 15 512 sde27
259 16 512 sde28
259 17 4 sde29
179 0 61120512 mmcblk0
179 1 61104128 mmcblk0p1
253 0 4681404 dm-0
253 1 24649728 dm-1
 
Thanks, @Mikestony!

That's exactly what I needed to see...

The "179 0 61120512 mmcblk0" row (fourth row from the bottom) is what the app looks for to figure-out and later show (in the title bar) the size of the internal memory....

I'm pretty sure we (me and @EarlyMon) selected this file and info as the source for the total size of internal memory and that it would/should exclude the internal.

Do you actually have a removable, external SD card for your device? (or is the "SD card" area partitioned from a portion of /data?)
 
Thanks, @Mikestony!

...snipped quote

Do you actually have a removable, external SD card for your device? (or is the "SD card" area partitioned from a portion of /data?)
Yup, I do. I also did not make the SD card as "adoptable storage" as some folks have done (even though it is possible on my device).
I was a little rusty on my ADB and was surprised ADB saw my device (had issues in the past) :D
 
Hey Mike, it looks like the good folks at stackoverflow.com have come through again :).

In this page:


they reference the logic used in the Settings app (presumably in the Settings -> Storage & USB -> Internal storage screen):


I've tested this on my Nexus 6P and I get a value of 28.13 GB vs. the 29.12 GB that /proc/partitions reports for "mmcblk0".

I'm pretty confident that this new way is a better and more accurate way of doing things, but I'd like to research it a bit more.

Ping me back if you'd like me to send you an .apk of the test app (I think I can actually have you be a beta tester and download it directly from the Play Store--I've never done that before ;) :)...lemme know :)).
 
Thanks a bunch!!
I'll try to run that command and I'd be glad to be a tester for your app if/when you are ready.
Work will be busy today, so I would doubt (maybe) I'll have enough time to concentrate to run those commands at work here:)
 
Hey Mike, after some more thought and digging, it looks like the Settings code mentioned in the above links simply finds (and reports) the user data directory (i.e., "/data") and get the size info programmatically--which is essentially what my app already does in displaying the "/data" row.

So, the question / dilemma is to whether or not I should try to estimate the true internal storage size (for reporting in the title bar) in a fashion similar to how RAM Truth does this for RAM (which is also a fuzzy number that is very hard to actually identify).

Internal storage would likely be the sum total of /data, /system, /cache and then some other filesystems that might be different between devices (/vendor, /persist, /firmware, etc...).

Hmm....
 
Hey, Mike, just for grins, when you get time, can you post the output of a df and a mount command, please?

Still looking at things on my devices...

Thanks!
adb shell, then df?

C:\Users\Mike\Desktop\adt-bundle-windows-x86_64-20130917\sdk\platform-tools>adb
shell
shell@h1:/ $ df
Filesystem Size Used Free Blksize
/ 1.78G 11.79M 1.77G 4096
/dev 1.85G 176.00K 1.85G 4096
/sys/fs/cgroup 1.85G 12.00K 1.85G 4096
/mnt 1.85G 0.00K 1.85G 4096
/system 4.32G 3.93G 408.13M 4096
/cache 1.17G 16.29M 1.15G 4096
/persist 27.48M 176.00K 27.31M 4096
/firmware 85.95M 69.34M 16.61M 16384
/sns 1.89M 80.00K 1.81M 4096
/persist-lg 5.83M 1.05M 4.77M 4096
/mpt 27.48M 48.00K 27.44M 4096
/eri 3.86M 48.00K 3.81M 4096
/vzw/quality 11.73M 84.00K 11.65M 4096
/storage 1.85G 0.00K 1.85G 4096
/data 23.01G 6.12G 16.89G 4096
/mnt/runtime/default/emulated: Permission denied
/storage/emulated 23.01G 6.12G 16.89G 4096
/mnt/runtime/read/emulated: Permission denied
/mnt/runtime/write/emulated: Permission denied
/mnt/media_rw/0123-4567: Permission denied
/mnt/secure/asec: Permission denied
/mnt/runtime/default/0123-4567: Permission denied
/storage/0123-4567 58.26G 3.21G 55.04G 131072
/mnt/runtime/read/0123-4567: Permission denied
/mnt/runtime/write/0123-4567: Permission denied
1|shell@h1:/ $

adb shell, then mount?
1|shell@h1:/ $ mount
rootfs / rootfs ro,seclabel,size=1867792k,nr_inodes=466948 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
/dev/block/dm-0 /system ext4 ro,seclabel,noatime,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime
,discard,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,noa
time,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:eek:bject_r:firmwar
e_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharse
t=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/bootdevice/by-name/sns /sns ext4 rw,seclabel,nosuid,nodev,noatime,noa
uto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/drm /persist-lg ext4 rw,seclabel,nosuid,nodev,noat
ime,noauto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/mpt /mpt ext4 rw,seclabel,nosuid,nodev,noatime,noa
uto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/eri /eri ext4 rw,seclabel,nosuid,nodev,noatime,noa
uto_da_alloc,errors=continue,data=ordered 0 0
/dev/block/bootdevice/by-name/operatorlogging /vzw/quality ext4 rw,seclabel,nosu
id,nodev,noatime,noauto_da_alloc,errors=continue,data=ordered 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/dev/block/dm-1 /data ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_al
loc,resuid=1000,errors=continue,data=ordered 0 0
/data/media /mnt/runtime/default/emulated sdcardfs rw,nosuid,noexec,noatime,uid=
1023,gid=1023,sdfs_gid=1015,sdfs_mask6,multi_user 0 0
/data/media /storage/emulated sdcardfs rw,nosuid,noexec,noatime,uid=1023,gid=102
3,sdfs_gid=1015,sdfs_mask6,multi_user 0 0
/data/media /mnt/runtime/read/emulated sdcardfs rw,nosuid,noexec,noatime,uid=102
3,gid=1023,sdfs_gid=9997,sdfs_mask23,multi_user 0 0
/data/media /mnt/runtime/write/emulated sdcardfs rw,nosuid,noexec,noatime,uid=10
23,gid=1023,sdfs_gid=9997,sdfs_mask7,multi_user 0 0
/dev/block/vold/public:179,1 /mnt/media_rw/0123-4567 texfat rw,dirsync,nosuid,no
dev,noexec,relatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,codepage=437,i
ocharset=utf8,min_prealloc_size=64k,max_prealloc_size=59656k,readahead=4M,fail_s
afe,hidden=show,errors=continue 0 0
/dev/block/vold/public:179,1 /mnt/secure/asec texfat rw,dirsync,nosuid,nodev,noe
xec,relatime,uid=1023,gid=1023,umask=0007,allow_utime=0020,codepage=437,iocharse
t=utf8,min_prealloc_size=64k,max_prealloc_size=59656k,readahead=4M,fail_safe,hid
den=show,errors=continue 0 0
/mnt/media_rw/0123-4567 /mnt/runtime/default/0123-4567 sdcardfs rw,nosuid,noexec
,noatime,uid=1023,gid=1023,sdfs_gid=1015,sdfs_mask6 0 0
/mnt/media_rw/0123-4567 /storage/0123-4567 sdcardfs rw,nosuid,noexec,noatime,uid
=1023,gid=1023,sdfs_gid=1015,sdfs_mask6 0 0
/mnt/media_rw/0123-4567 /mnt/runtime/read/0123-4567 sdcardfs rw,nosuid,noexec,no
atime,uid=1023,gid=1023,sdfs_gid=9997,sdfs_mask18 0 0
/mnt/media_rw/0123-4567 /mnt/runtime/write/0123-4567 sdcardfs rw,nosuid,noexec,n
oatime,uid=1023,gid=1023,sdfs_gid=9997,sdfs_mask18 0 0

Hope I did that right because that is all French to me.


Edit: if there is any info there that really shouldn't be shown publicly, just edit it out if you don't mind :D
 
Hey Mike, after some more thought and digging, it looks like the Settings code mentioned in the above links simply finds (and reports) the user data directory (i.e., "/data") and get the size info programmatically--which is essentially what my app already does in displaying the "/data" row.

So, the question / dilemma is to whether or not I should try to estimate the true internal storage size (for reporting in the title bar) in a fashion similar to how RAM Truth does this for RAM (which is also a fuzzy number that is very hard to actually identify).

Internal storage would likely be the sum total of /data, /system, /cache and then some other filesystems that might be different between devices (/vendor, /persist, /firmware, etc...).

Hmm....
good grief you are way over my head now :D
 
adb shell, then df?

Hope I did that right because that is all French to me.

Edit: if there is any info there that really shouldn't be shown publicly, just edit it out if you don't mind :D

Perfect! Thank you!

Nah, that's all generic info..no worries :).

good grief you are way over my head now :D

LOL, I'm just talking to myself up there or EM if he's see this thread...haven't contacted him explicitly yet and I'm still thinking about this.

Basically, I'm wondering if we should report anything in that title bar at all or if I should extrapolate what the internal storage is...(since we kind of know now that /proc/partitions isn't necessarily 100% reliable).

:)
 
Perfect! Thank you!

Nah, that's all generic info..no worries :).



LOL, I'm just talking to myself up there or EM if he's see this thread...haven't contacted him explicitly yet and I'm still thinking about this.

Basically, I'm wondering if we should report anything in that title bar at all or if I should extrapolate what the internal storage is...(since we kind of know now that /proc/partitions isn't necessarily 100% reliable).

:)
Well, if there is anything else I can do, let me know.
It's not a huge deal at all, I was just curious as to why it showed my external sd card size vs. internal only, that's all :)
 
Sorry I didn't see this right away. :p

The phone in question almost certainly is using this Samsung UFS storage chip -

http://www.samsung.com/semiconductor/products/flash-storage/ufs/KLUBG4G1CE-B0B1?ia=2413

Linux users will immediately recognize the sdX references in the /proc/partitions output - UFS uses the SATA Linux interface instead of the one for eMMC.

The solution I'd go with would be to scan for sda, if found use its value, and if not, use the original Storage Truth methods. :)
 
Okay, some screenies and explanation of what this new version does:

upload_2016-8-13_21-23-47.png


upload_2016-8-13_21-24-12.png


upload_2016-8-13_21-25-9.png


upload_2016-8-13_21-25-26.png


1. This version will now scan for "sda" in /proc/partitions just like it does for "mmcblk0"; if "sda" information is found, that will be used for the info in the title bar

@EarlyMon: was thinking / noodling with the idea of rounding that value up to the next likely size boundary (similar to what we do for RAM Truth)...thoughts re. that or let sleeping doges lie?

2. This version now supports turning off the copying to the clipboard in a new settings/preferences menu option; you can explicitly copy screen contents to the clipboard from the settings/preference menu or by touching the last (device info) row (assuming you haven't turned off copying to clipboard in preferences)

3. For the third row (yellow sphere icon), I'm now initially displaying "Touch row to expand and display more information about your device's storage partitions.". Then, when you touch the row it will display the info that it typically would ("Your actual operating system also uses other storage areas, not shown, for your radio hardware and other secure functions. All app information is stored under the /data partition, and apps you add or update are installed to /data/app. Simulated internal and actual external SD cards are not shown.", etc.).

This should make the display a little more compact and eye-friendly, especially for smaller screen devices.

I'm happy to further change/tweak/revert as needed :).

Lemme know if questions or comments.

Current v1.5 .apk is attached (not yet on the Play Store) for those that want to try/test (@Mikestony, @EarlyMon :)).

Thanks! :)

edit: test .apk removed from this post...newer version will appear in post later in this thread (unless it's been vetted an published to the Play Store)
 
Last edited:
Thanks, @AZgl1500 :).

Okay, @Mikestony, I think/believe I know what the issue was...involved the parsing of the /proc/partitions file and some minor changes I made to that area of code.

So, let's try this .apk (attached below) and see...please also post a screenie with the third row (yellow sphere) expanded--I threw some debugging info in there just in case.

Thanks again! :)
 

Attachments

Whew! That's awesome, Mike :).

Okay, I'll do some cleanup and prep this version for publishing to the Play Store!

Thanks for reporting your initial issue--very much appreciate you helping to debug and test.

I found and fixed several minor things in the app that benefited from this process that made the app better and more robust for all (and, of course, @EarlyMon's sage and key knowledge about the sda /UFS information).

Teamwork for the win! :)
 
Play Store updated :), although it might take an hour or two for it to be available (update: it's already live!)

Change log for this version:

v1.5 (14-Aug-2016):

- recognize/support devices with internal UFS / sda storage
- add options / ability for managing copying info to clipboard
- several minor fixes and improvements
 
Last edited:
Back
Top Bottom