How to change the reserved percentage for root directory in linux
The GNU/Linux reserve 5% of the the storage of a partition for the root directory, so for example if you got a apartition of 500 GB , this mean that your root directory will got 25 Go !!! Very much for a root directory .
Well, lets see approximatively how much space the root partition need.
/tmp : So for example for temporary files they get deleted every once in a while to save space.
/usr : Requires a few gigabytes of space for installing applications. It will of course grow over time as you install more applications.
/var : May require some space, depending on what you use the machine for. For example, database software often stores databases there, and various other applications keep persistent data there so it may require some space and grow over time.
/srv : might need some space and grow over time if you’re hosting web services or FTP services, otherwise chances are your /srv will never take up much space.
Some third party software sometimes installs into /opt. If you’re installing anything like that you may need some space there, otherwise it will hardly take up any space.
/etc : May grow a bit over time since it contains configuration files for just about everything you install, but those files don’t take up that much space so it will never get too big.
With the obvious exception of /home, the rest of the toplevel directories in / hardly need much space (some like /dev /proc and /sys don’t take up any disk space) and are unlikely to grow much with time.
So depending on how you use your machine and what you install you can even get away with as little as 5GB to 10 GB max for your / partition (and that’s including /usr).
Now if you we take the example above of a partition of 500 Go, then 1% will be enough for the root directory, type the command bellow to change the procentage to 1% :
tune2fs -m1 /dev/partition
This way the system will reserve 1% for the root directory.