This question already has an answer here:
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?
|
This question already has an answer here: 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? |
|||
marked as duplicate by lesmana, Jeff Schaller, dr01, Stephen Kitt, don_crissti May 12 '16 at 16:58This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||
|
|
|||
|
The man page of
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 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 |
|||||
|
|
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 Nowadays, of course, even a small percentage of blocks represents way more space than is necessary for this purpose! |
|||
|
|
|
Part of the purpose of reserve % is to allow "empty pockets" to exist between files to help prevent fragmentation. Modifying a file later won't necessarily force the file to be broken into fragments because something was parked right at the tail of the file when originally written. There is also the emergency recovery aspect where root needs to be able to log in and clean things up because something went amiss and filled up the drive (be it user or malconfigured program). Appropriate reserve percentages depend kind of heavily on the partition's use case. If the partition is an OS disk, then 5-10% reserve for root seems completely reasonable, even for very large partitions. For user-data partitions, there is often no need for any reserve, except maybe to help with preventing fragmentation. |
|||
|
|