0

cd / && du -sh . told me that the filesystem used 2.1G spaces of disk:

root@ubuntu:/# cd / &&  du -sh .
du: cannot access './proc/3874/task/3874/fd/3': No such file or directory
du: cannot access './proc/3874/task/3874/fdinfo/3': No such file or directory
du: cannot access './proc/3874/fd/4': No such file or directory
du: cannot access './proc/3874/fdinfo/4': No such file or directory
2.1G    .

However, df -h told me that all spaces had been used:

root@ubuntu:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.2G  6.8G     0 100% /
devtmpfs        3.6G     0  3.6G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           3.9G   17M  3.9G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup

Here is the output of fdisk -l:

Disk /dev/mmcblk1: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk1p1       2048 15523839 15521792  7.4G 83 Linux

I don't why I have 6.8G spaces used, also, I don't know why df -h showed me the /dev/root instead of /dev/mmcblk1p1. ls /dev/root even showed me No such file or directory error.

5
  • You could be facing an issues with inodes (possibly too many small files). Therefore add the -i flag to df and du. Also use the --max-depth flag with du to delve further and further into your file system file space usage Mar 8, 2019 at 10:28
  • You also could have some deleted files still using disk space. `sudo lsof | grep deleted' will show something if that's the case
    – Tagwint
    Mar 8, 2019 at 10:55
  • I would guess either deleted file hold by a process, or a corrupt SD card. for former case a mere reboot will do, for later case, if possible mount it physically on another device and issue a fsck.
    – Archemar
    Mar 8, 2019 at 10:55
  • You don't want to include /proc. Use du -xsh (although it will not give a larger result :-).
    – sourcejedi
    Mar 8, 2019 at 13:26
  • /dev/root is mysterious to the best of us :-), but you don't need to worry about it. It is genuinely a representation of /dev/mmcblk1p1, there is nothing evil going on there. unix.stackexchange.com/questions/295060/…
    – sourcejedi
    Mar 8, 2019 at 13:44

0

Browse other questions tagged .