Why does du /sys give an erroneous result? Using the file manager, properties shows it has a size of 619 MB, which is feasible. But du -hs /sys shows 0 MB? There are smaller-sized folders such as /etc, which the file manager shows a size of 8.4 MB, although du shows it as 15 MB. So there seems to be a lot of inconsistency.
1 Answer
Filesystems such as those typically mounted on /sys and /proc are representations of kernel structures and do not exist other than virtually.
You cannot usefully measure the "size" of these filesystems as there is none. (And on that basis, du -s /sys returning 0 is arguably correct.)
On a Pi here,
mount | grep -E '/(etc|proc|sys) '
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
and
sudo du -hs /etc /proc /sys 2>/dev/null
7.8M /etc
0 /proc
0 /sys
-
dustands for "disk usage", so 0 is exactly right.vonbrand– vonbrand2021-05-27 17:40:25 +00:00Commented May 27, 2021 at 17:40