As a security measure the ext3 file system reserves 5% of device space for administrative processes. This protects the system by allowing root processes to continue using the disk if a user process runs wild and fills it up. With today’s larger disk capacities, 5% equates into gigabytes of arguably wasted space. Thankfully with the tune2fs command you can reduce this percentage and free most if not all of the reserved space.
The tune2fs command utility operates exclusively on ext2/ext3 file systems.
To run these commands you must run the command as root or use sudo.
You can run tune2fs on the ext3 partition with the ‘-l‘ option to show you all the filesystem details. The important information to focus on are the “Reserved block count” and “Block size” lines. Multiply these lines together to see how many bytes are currently reserved on the filesystem.
$ tune2fs -l /dev/sda1
... Reserved block count: 1929908 ... Block size: 4096 ...
That’s more than 7GB of space that is reserved.
Run the df command to see the current used space on the device before you make any changes.
$ df -h
Filesystem Size Used Avail Use% Mounted on /dev/sda1 145G 3.1G 135G 3% /
Run the tune2fs command to change your reserved block percentage. The ‘-m‘ option sets the new reserved percentage.
In this example I am setting the percentage to 0 and completely removing the reserved space. This will effectively disable the security feature but free the most space. You may choose to reduce the reserved percentage instead in order to preserve the security benefit while still freeing some space.
$ sudo tune2fs -m 0 /dev/sda1
You can confirm the changes have taken effect by viewing the filesystem details.
$ tune2fs -l /dev/sda1
... Reserved block count: 0 ...
You can directly see the changes by looking at your system disk space usage. We now have an additional 7GB available.
$ df -h
Filesystem Size Used Avail Use% Mounted on /dev/sda1 145G 3.1G 142G 3% /