As almost everyone knows, your linux filesystem sets aside a portion of the free space as “reserved”. This is 5% of the drive space, by default.


[root@pabu ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/disk1 931G 166G 719G 19% /home/disk1

If you do the math there, 166+719= 885GB. That means the file system is reserving 46GB. This 5% reservation made a lot more sense when hard drives were 120MB than when we are looking at TB or higher file systems.

Fortunately, it is fairly easy to change. If I want to modify it to be 2% rather than 5%, I just do:


[root@pabu ~]# tune2fs -m 2 /dev/mapper/disk1
tune2fs 1.41.14 (22-Dec-2010)
Setting reserved blocks percentage to 2% (4883788 blocks)
[root@pabu ~]#

And, tadah!


[root@pabu ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/disk1 931G 166G 747G 19% /home/disk1

Now I am getting 913GB of my drive, rather than 885.

I would caution you to be careful on how you tweak this. I would never set 0%. Ever. However, setting it to 1-2% on drives, depending on what they are doing (and giving consideration for how large a buffer that provides you for when you do eventually fill that drive) will most likely help you recover from a “my file system says it is 100% full but I can see there is still 50GB there!” issues.


Category: file systems

Leave a Reply

Categories


gives good tech

tech.superhappykittymeow.com
Kale is one of the smartest people I know

Racker Hacker
Major is always good for leet deetz