Wiebe was looking over my shoulder while I was running df to check the disk space that was still available on my Lenovo ThinkPad:
# df -h /dev/sda2 Filesystem Size Used Avail Use% Mounted on /dev/sda2 90G 79G 7.3G 92% /
He noticed that there was a huge gap between the total space (79 used + 7.3 available = 88.3) and the actual size of the file system. According to him this was due to the reserved block count, which is set to five percent by default in ext2 and ext3 file systems—clearly a legacy from a time where disks were smaller.
# dumpe2fs /dev/sda2|grep -i 'reserved block count' dumpe2fs 1.40.8 (13-Mar-2008) Reserved block count: 1196559 # dumpe2fs /dev/sda2|grep 'Block count' dumpe2fs 1.40.8 (13-Mar-2008) Block count: 23931180 # echo 'scale = 2; 1196559 / 23931180'|bc .05
I changed the reserved block count with tune2fs:
# tune2fs -m 1 /dev/sda2 tune2fs 1.40.8 (13-Mar-2008) Setting reserved blocks percentage to 1% (239311 blocks)
# dumpe2fs /dev/sda2|grep -i 'reserved block count' dumpe2fs 1.40.8 (13-Mar-2008) Reserved block count: 239311
# df -h /dev/sda2 Filesystem Size Used Avail Use% Mounted on /dev/sda2 90G 79G 11G 88% /
Now, the reserved blocks take up roughly 700 Meg; I’ve freed 13 Gig with this little file system tweak.

2 Comments ( Add comment / trackback )
This helped me to get the current % of reserved blocks.
Thank You
Very helpful, thanks. But the numbers in your closing remark are well off. Your reserve is 934 MiB and you freed 3.7 GiB.
May God Bless.