diskusage icon indicating copy to clipboard operation
diskusage copied to clipboard

How to delete System data

Open molli0707 opened this issue 9 years ago • 16 comments

huge issue with system data. i see it in diskusage but cannot get further into the folder. how do i delete this data?

molli0707 avatar Sep 04 '16 15:09 molli0707

You need root access to do that. Strictly speaking "System data" in DiskUsage is storage space reported by filesystem as allocated, but without corresponding files to be found.

Application without root access cannot see all files, some of them are hidden by system, such files are reported as "system data".

On Mon, 5 Sep 2016, 1:07 AM molli0707 [email protected] wrote:

huge issue with system data. i see it in diskusage but cannot get further into the folder. how do i delete this data?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/IvanVolosyuk/diskusage/issues/39, or mute the thread https://github.com/notifications/unsubscribe-auth/AG8PHUtYkz3xaQeS8vxcTmgVbaNTgZNPks5qmt6tgaJpZM4J0jiO .

IvanVolosyuk avatar Sep 04 '16 23:09 IvanVolosyuk

screenshot_20170914-192200

There seems to be some kind of bug in DiskUsage. My system partition is definitely not 60GB, while my music folder (here 7gb) should be around 60gb.

ByteHamster avatar Sep 14 '17 17:09 ByteHamster

Dear, I see you've got a 128GB Android device. Congratulations! Your vendor partitioned 113GB for user data leaving the rest for system purposes. This partition is mounted to /data in Android and you see it as Storage card in the app. That partition contains your installed apps and their data, all these you can see as System data. BTW noone wants it to be deleted, for their own sake. The blue rects in the second column (media, Apps) are those you can reach from your SDCARD.

Now regarding the sizes. Do you have multiple USERS on your device? For better understanding you could provide more in-depth info like console commands df and du, preferably with root permissions.

ildar avatar Sep 15 '17 04:09 ildar

Hi, I do not have root permissions. I have only set up one user and it does not seem like there are multiple partitions

~ df -H
Filesystem                              Size  Used Avail Use% Mounted on
rootfs                                  2.9G  6.2M  2.9G   1% /
tmpfs                                   2.9G  664k  2.9G   1% /dev
none                                    2.9G     0  2.9G   0% /sys/fs/cgroup
tmpfs                                   2.9G     0  2.9G   0% /mnt
/dev/block/dm-0                         3.0G  2.8G  176M  95% /system
/dev/block/bootdevice/by-name/cache     260M  7.9M  247M   4% /cache
/dev/block/bootdevice/by-name/dsp        12M  4.3M  7.6M  37% /dsp
/dev/block/bootdevice/by-name/modem     100M   88M   12M  89% /firmware
/dev/block/bootdevice/by-name/bluetooth 1.0G  115k  1.0G   1% /bt_firmware
/dev/block/dm-1                         122G   71G   45G  62% /data
tmpfs                                   2.9G     0  2.9G   0% /storage
/data/media                             121G   77G   45G  64% /storage/emulated
tmpfs                                   2.9G     0  2.9G   0% /storage/self

ByteHamster avatar Sep 15 '17 08:09 ByteHamster

Okay, now that is strange:

du -hs /sdcard/Musik
6.5G    /sdcard/Musik

but the integrated file manager shows: (this size looks better)

screenshot_20170915-105124

ByteHamster avatar Sep 15 '17 08:09 ByteHamster

du -hs /storage/emulated/0/Musik/ ?

Also mount command output could be helpful.

BTW, I trust more to UNIX command then to Android graphical nice windows :)

ildar avatar Sep 15 '17 09:09 ildar

du -hs /storage/emulated/0/Musik/
6.5G    /storage/emulated/0/Musik/

I have the same folder on my PC (Linux ;) ). There it also shows around 60GB.

mount
rootfs on / type rootfs (ro,seclabel,size=2843404k,nr_inodes=710851)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=2920652k,nr_inodes=730163,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
none on /sys/fs/cgroup type tmpfs (rw,seclabel,relatime,size=2920652k,nr_inodes=730163,mode=750,gid=1000)
none on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=2920652k,nr_inodes=730163,mode=755,gid=1000)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,reserved=100MB)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,reserved=100MB)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,reserved=100MB)
none on /config type configfs (rw,relatime)
/dev/block/dm-0 on /system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/bootdevice/by-name/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/bootdevice/by-name/persist on /persist type ext4 (rw,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/bootdevice/by-name/dsp on /dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/bootdevice/by-name/modem on /firmware type vfat (ro,context=u:object_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/bootdevice/by-name/bluetooth on /bt_firmware type vfat (ro,context=u:object_r:bt_firmware_file:s0,relatime,uid=1002,gid=3002,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/dm-1 on /data type f2fs (rw,seclabel,nosuid,nodev,noatime,nodiratime,background_gc=on,discard,user_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=2920652k,nr_inodes=730163,mode=755,gid=1000)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,reserved=100MB)
tmpfs on /storage/self type tmpfs (rw,seclabel,relatime,size=2920652k,nr_inodes=730163,mode=755,gid=1000)

By the way, I am using Android 7.1.1 on a OnePlus 3T. My friend also uses 7.1.1 on another phone and also has wrong sizes. Most other disk usage apps on Google Play display my expected values

ByteHamster avatar Sep 15 '17 10:09 ByteHamster

ls and du provide different output. Not yet sure why.

du -ch *
1.6M    01 - Going for the One.mp3
2.2M    02 - Turn of the Century.mp3
1.8M    03 - Parallels.mp3
1.1M    04 - Wonderous Stories.mp3
4.4M    05 - Awaken.mp3
6.0K    Folder.jpg
11.1M   total

vs

ls -lah
total 11370
drwxrwx---    2 root     everybod    4.0K May 28 16:15 .
drwxrwx---    4 root     everybod    4.0K May 28 15:20 ..
-rwxrwx---    1 root     everybod   12.7M May 28 16:15 01 - Going for the One.mp3
-rwxrwx---    1 root     everybod   17.5M May 28 16:15 02 - Turn of the Century.mp3
-rwxrwx---    1 root     everybod   14.2M May 28 16:15 03 - Parallels.mp3
-rwxrwx---    1 root     everybod    8.8M May 28 16:15 04 - Wonderous Stories.mp3
-rwxrwx---    1 root     everybod   35.4M May 28 16:15 05 - Awaken.mp3
-rwxrwx---    1 root     everybod   39.7K May 28 16:15 Folder.jpg

ByteHamster avatar Sep 18 '17 08:09 ByteHamster

tricky :) du usually differs from ls, but it's usually bigger. Could you please download the files and figure out what's lying?

ildar avatar Sep 18 '17 08:09 ildar

Download the files?

The only explanation I found for the different output are sparse files. But as far as I know, they are only used for blocks that are filled with a lot of zeroes. Should not be the case for mp3 files...

ByteHamster avatar Sep 18 '17 09:09 ByteHamster

I mean: download to the PC and check there.

ildar avatar Sep 18 '17 09:09 ildar

On my PC, both commands display 13M. The md5sum of the files matches.

ByteHamster avatar Sep 18 '17 09:09 ByteHamster

other checks would be ls -la and stat

ildar avatar Sep 18 '17 09:09 ildar

ls -la is just the hard-to-read version of ls -lah ;) Gives an output of 13315522 bytes (matches the 12.7M) on both phone and PC.

Output of stat

PC

stat 01\ -\ Going\ for\ the\ One.mp3 
  File: 01 - Going for the One.mp3
  Size: 13315522        Blocks: 26008      IO Block: 4096   regular file
Device: 811h/2065d      Inode: 31195696    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/hans-peter)   Gid: (  100/   users)
Access: 2017-09-18 11:15:37.461881480 +0200
Modify: 2017-05-25 20:12:29.290365158 +0200
Change: 2017-05-25 20:12:29.290365158 +0200
 Birth: -

Phone

stat 01\ -\ Going\ for\ the\ One.mp3
  File: 01 - Going for the One.mp3
  Size: 13315522        Blocks: 3257       IO Block: 4096   regular file
Device: 15h/21d Inode: 48992       Links: 1
Access: (0770/-rwxrwx---)  Uid: (    0/    root)   Gid: ( 9997/everybody)
Access: 2017-05-28 16:15:07.140453796 +0200
Modify: 2017-05-28 16:15:07.510453796 +0200
Change: 2017-05-28 16:15:07.510453796 +0200
Birth: -

As you can see, the number of allocated blocks differs a lot. Here, the block number on the PC looks strange to me: 26008 blocks * 4096 Bytes/block = 101 MBytes. If using the value from my phone, it is around the expected 13M.

ByteHamster avatar Sep 18 '17 09:09 ByteHamster

OnePlus has a bug where they report size in blocks incorrectly. https://docs.google.com/document/d/1tNReLmUwd99N1fb4WrhA7ouRWlqdZbRi4rraWLpIO08/edit

IvanVolosyuk avatar Oct 01 '17 01:10 IvanVolosyuk

e2fsck helps me.

Kesantielu avatar Dec 25 '18 15:12 Kesantielu