By default, a linux filesystem reserves 5% of the space for root (the user) usage and maintenance. If the device was 100% full, you couldn't even create the temporary files necessary to allow a user to log in... like perhaps.... root!
Total space: 395.00G (from your example)
minus 5%: 19.75G (reserved space)
============ =======
User space: 375.25G (Available to users)
Used space: 355.00G (from your example)
Avail space: 21.00G
============ =======
Total: 376.00G (equals 'User Space' from above)
Since everything's being rounded due to the use of the -h
(human sizes) option, these values are essentially equal.
For a filesystem holding a running linux system, you want SOME space reserved, 5% used to be a good value when disks were much (much!) smaller than today. 1% would be better today, and it's still overkill.
Filesystems used as storage can be formatted/setup with 0% reserved space if you wish, no harm there. It's the 'running system' filesystems that need some space.
During the format, you can specify how much space to reserve (in percentage), by using the -m
option:
mkfs.ext4 -m 1 /dev/sdz3
(From the man page)
-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the super-user. This avoids fragmentation, and allows root-owned daemons, such as sys‐
logd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. The default percentage is 5%.
You can also use tune2fs
to adjust the reserved percentage on a filesystem after it's been formatted: (also -m
option!)
tune2fs -m 1 /dev/sdz2
Again, please don't set -m
to 0
on a filesystem which holds an operating system, you may never encounter any problems, but if your drive fills up, it'll bite you because you can't even log in to fix things. (You'd need a live/rescue cd/usb-stick to fix it!)