Image

Imagejhf wrote in Imagelinux

ExtX and reserved blocks

By default, mkfs.extX reserves 5% of a filesystem for the root user.

The purpose of root-reserved space has always been to ensure that root can login and carry out various administrative actions that might require a bit of disk space, such as touching files in /var to indicate a new login. Sometimes you have to spend a bit of space to make space.

But 5% is a huge amount, these days. On a 160GiB disk, that's 8 GiB! Even the lowest you can specify with mkfs.extX, 1%, is 1.6 GiB! That's excessive.

You can, however, turn the root-reserved blocks down after mkfs-time with tune2fs. The -r option is what you want. -r takes an argument specified in blocks, which on any FS big enough to futz with the reserved size will be 4k. So, pass to tune2fs the number of megabytes you want reserved for root * 256.

I often figure 50MB is enough for a filesystem not mounted on /. So, that's tune2fs -r 12800 /dev/path/to/device/node.

On a root FS, 500MB might be wise, especially if you have a /-is-everything partition scheme. So, tune2fs -r 128000 /dev/path/to/device/node. That's still a lot less than 1.6GiB on a 160GiB disk!

The moar you know.