0

By default, the ext2/3/4 fs reserves 5% of its capacity to be able to keep running when diskspace is getting low.

I also believe it has something to do with allowing "fragmentation between files" or something like this (I haven't been able to find concrete information about this, and I'm kinda newbie in this domain).

My question is: when do we need to keep these 5%, when can we reduce it to something like 1-2%, or when can we remove it totally ?

The elements that I'm considering atm are the following:

  • The 5% rule was decided something like 20 years ago when the reserved size wasn't way more than ~100Mbs, which is totally different now; if we're only talking about space needed to execute commands and such, do we really need 20Gbs ?

  • Could it ever be a good idea to remove this allowed space ? If some of it is needed for "fragmentation" somehow, I believe we should at least keep 1-2% available

  • Is this space really only useful for partitions that are related in any way to root ? I mean, if we have a partition for some folder in /home (something personal, or data from a database, something else that is not related in any way to the OS), this space may not be needed

I've only seen more and more articles on the web telling about how to reduce the reserved blocks so I believe that it may not be a bad idea 100% of the time, but I've not really been able to have articles explaining deeply the concrete application of "when it can / cannot be used", and "what it exactly does and implies".

So if some of you could provide comprehensive information (as well as a simple answer to the question I exposed above) I would be very thankful.

Yozamu
  • 31
  • 1
  • 5

1 Answers1

2

Those 5% are really kept for root user to be able to login and do some operations in case of full filesystem. And yes, you can decrease the amount (I did this in the past) to 1-2% (depend of the disk size). But be aware for most filesystems this should be defined when you create it and its hard (if possible at all) to change it after.

About zero it - yes, that's also possible. But will be wise to keep some space for root in the /, /root (or whatever is the home of root user), /tmp and eventually /var/tmp

Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31
  • Let's say I got something like 5-6 partitions, two of them being based on a directory located in /home. It would mean I can reduce (or even remove ?) the reserved space ? The partitions are not new at all, so what will happen if I try to use tune2fs to reduce / remove reserved space ? If nothing happens in case of failure, maybe is it safe to try – Yozamu Dec 04 '19 at 14:36
  • @Yozamu, my experience in the past is not successful to change this reserved space. Maybe new versions of software are able to do it. If you have free disk space you can try by creating new (small) filesystem – Romeo Ninov Dec 04 '19 at 14:42