The /
is the root of the system. Everything else is mounted on subdirectories of /
. You can see this more clearly if you look at the output of mount
or lsblk
. For example, on my system:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 186G 0 part
├─nvme0n1p4 259:4 0 1000M 0 part
├─nvme0n1p5 259:5 0 56.6G 0 part /
├─nvme0n1p6 259:6 0 680.1G 0 part
│ └─home 254:0 0 680.1G 0 crypt /home
└─nvme0n1p7 259:7 0 30G 0 part [SWAP]
This tells me that the partition nvme0n1p5
is mounted at /
and the partition nvme0n1p6
is mounted on /home
, a subdirectory of /
.
When you do du /
, that will search through /
and any subdirectories, even if they are on a different file system. This is why you see 222 GB: you are also checking other partitions in addition to nvme0n1p2
because they are presumably mounted somewhere under /
. Most likely your /home
is on a different partition, as is the case on my system, since your /home
is reported at 176G and 222G - 176G = 46G, which agrees with the output of df
.
To see only the usage of /
and nothing else, you need the -x
flag. From man du
:
-x, --one-file-system
skip directories on different file systems
Again, using my system as an example, your original command gives me:
$ sudo du -h --max-depth=1 / | sort -h
0 /proc
0 /sys
12K /srv
16K /lost+found
2.1M /run
23M /tmp
27M /etc
54M /dev
71M /boot.old
72M /boot
315M /root
2.1G /opt
20G /var
21G /usr
228G /home
270G /
But if I add -x
, I get the expected output:
$ sudo du -xh --max-depth=1 / | sort -h
12K /srv
16K /lost+found
27M /etc
71M /boot.old
72M /boot
315M /root
2.1G /opt
20G /var
21G /usr
43G /