You may want to glance over this exhaustive explanation of some issues from U&L.
In short, this is normal and you'll see the same discrepancy on any default formatted ext filesystem. For example, here's something from a ~150 MB partition on my laptop:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda7 149290292 13884224 127799440 10% /
If you do a little math here, however, you'll notice 149290292 - 13884224
= 135406068, not 127799440, a difference of 7606628 blocks, i.e., ~5% of the partition.
This is because when the filesystem is formatted, 5% of the space is reserved for the root user only. The purpose of this is to leave a bit for use in emergency recoveries.
This is not generally considered wasted space, however, since filling any filesystem beyond 70-80% -- unless the intended purpose of that filesystem is exclusively long term static storage -- will result in serious performance degradation, so by the time you hit 90-95% you've might have already made a big mistake.
Or not, because the logic behind that I think is mostly to do with traditional spinning disks, where the more of the disk is used, the harder it is to prevent fragmentation, and the further the disk head may have to travel to get the bits and pieces of various files. The effects of fragmentation do not apply to solid state hardware such as SD cards. Although some of their own peculiar characteristics (having to do with erasing and re-writing entire blocks of a certain surprisingly large minimum size) may create a similar problem, I couldn't find any benchmarks to confirm or deny this, but I did not look very hard.
Do note that the percentage use of an SD card, however, will directly relate to its lifespan, because they have an internal controller that will spread stuff around to average the wear (wear leveling); obviously if the card is full this is not likely possible, and if you are using it as a root filesystem and the life cycle of a given segment is only 1000 uses, you may end up with corruption happening sooner rather than later.
You might consider moving some stuff to a USB stick, which is also likely to be a bit faster since the SD card reader is limited to 20-25 MB/s.
Anyway, to double check how many blocks actually were reserved for the purpose described above:
sudo dumpe2fs -h /dev/mmcblk0p2 | grep "Reserved block"
The grep
pipe at the end is just because that command spits out a fair bit of other information. Finally, you should be able to change the percentage with, e.g.,
sudo tune2fs -m 1 /dev/mmcblk0p2
Will reduce it to 1%. This all presumes /dev/mmcblk0p2
actually is the partition.
Both those programs are in the e2fprogs
package (on Raspbian) but I believe it will already be installed.
raspi-config
to expand the filesystem?