0

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 1

4

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
1
  • du stands for "disk usage", so 0 is exactly right. Commented May 27, 2021 at 17:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.