ext2/3/4 reserved blocks percentage purpose
Solution 1
The man page of tune2fs
gives you an explanation:
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.
It also acts as a failsafe; if for some reason the normal users and their programs fill up the disk up to 100%, you might not even be able to login and/or sync files before deleting them. By reserving some blocks to root
, the system ensures you can always correct the situation.
In practice, 5% is an old default and may be too much if your hard drive is big enough. You can change that value using the previously mentioned tune2fs
tool, but be sure to read its man page first!
Solution 2
The purpose of reserving a small number of blocks for root's use only is to give root a chance to log in and give them a little bit of breathing room to make space in case the disk becomes completely full. Without it, root could be prevented from logging in because the login process fails when it gets unexpected errors writing files (like utmp
and wtmp
, files in /dev/pts
, etc...). One could hope that the login process is robust and will work even with a full disk, but disk full errors during the login process is probably usually a less well tested code path.
Nowadays, of course, even a small percentage of blocks represents way more space than is necessary for this purpose!
Related videos on Youtube
Karlson
Updated on September 18, 2022Comments
-
Karlson over 1 year
I know that this feature dates back 20 years but I still would like to find out
What is the purpose of the reserved blocks in ext2/3/4 filesystems?
-
Colin 't Hart almost 3 yearsA really good answer over on Super User: superuser.com/a/1257550/42854
-