Native filesystems supported by the Linux kernel (namely, those of extN
family) have the concept of the space reserved for the superuser (that with UID
0). The idea is that when the filesystem appears to be full, and various programs start to fail due to this, the superuser still has certain scratch space available to perform recovery tasks (think of text editor's buffer swap/backup files, the need to copy files around etc). Hence what you're seeing here is the difference between what your root user sees and what your regular users see.
The typical reservation of free space is 5% when the filesystem is created (which was sensible back in the day, but not really these days, with multi-gigabyte or -terabyte filesysems). Luckily, this parameter might be tuned after the fact (using the tune2fs
program for the extN
filesystems). I usually set it manually to 100MiB after creating a typical reasonably large extN
filesystem.
To see how many space is reserved, go like this:
Ask the filesystem about its current parameters:
# tune2fs -l /dev/sda1 | grep -Ei 'reserved|block size' Reserved block count: 25600 Block size: 4096 Reserved GDT blocks: 1012 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root)
The actual space reserved, in bytes is
Reserved block count
×Block size
.Tweak this to suit your needs, if you want.
For instance, to set this to 10 MiB, you can do
# tune2fs -r $((10*1024*1024/4096)) /dev/sda1
Here 4096 is the block size and 10×1024×1024 is 10 MiB.