ext4 partition size / free space discrepancies

Let me explain the issue first:

I was not able to ‘save’ a file in my ‘home’ directory and it was complaining that, there is NO SPACE,

So, I checked “df” output

Hmmmmm.. pretty confusing .. Isn’t it ?

For those who did n’t figure it out or for those who already know the answer :

I was thinking ‘Used’ and ‘Size’ should match , because 100% (Avail ) has reported:

Obviouly there is some gap .. I mean “235-223” = ~ 12GB.

This is ext4 filesystem .

Why So ?

if you dont know the answer: It is  the space “reserved-for-root”. Ext4 reserves 5% for “root” .

Now, next question is ‘How can i prove it” ?

Lets do ‘stat’ or ‘dumpe2fs’ on the subjected filesystem ..

In below output, look at the count ‘3117465‘.

Ok.. we came to know it is reserved , How can I tune it ?

Use ‘tune2fs’.

List it first using ‘tune2fs -l” command
————-

  -m reserved-blocks-percentage
              Set the percentage of the filesystem which may only be allocated by privileged processes.   Reserving some  number  of  filesystem
              blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8),
              to continue to function correctly after non-privileged processes are prevented from writing  to  the  filesystem.   Normally,  the
              default percentage of reserved blocks is 5%.

Lets remove the restriction using “-m” option:

 
[root@humbles-lap humble]# tune2fs -m 0 /dev/mapper/vg_humbles-lap-lv_home
tune2fs 1.41.14 (22-Dec-2010)
Setting reserved blocks percentage to 0% (0 blocks)
[root@humbles-lap humble]#

Now, verify it :

Cooooooool..

There U go…    Hope it helps..

Leave a Reply

Your email address will not be published. Required fields are marked *