Rate this page

Flattr this

Reduce the space reserved for root on an ext2, ext3 or ext4 filesystem

Tested with ext2 on

Debian (Lenny, Squeeze)
Ubuntu (Lucid)

Tested with ext3 on

Debian (Lenny, Squeeze)
Ubuntu (Lucid)

Tested with ext4 on

Debian (Squeeze)
Ubuntu (Lucid)

Objective

To reduce the amount of space reserved for use by root on an ext2, ext3 or ext4 filesystem

Background

By default, ext2 and its successors reserve 5% of the capacity of each filesystem for use by the root user. This reduces fragmentation, and makes it less likely that the administator or any root-owned daemons will be left with no space to work in. Whether these considerations justify the loss of capacity depends on what the filesystem is used for.

Reserved space is least useful on large filesystems with static content that are not critical to the basic functionality of the operating system. In such cases it is quite reasonable to reduce the reservation to zero. Filesystems that may be better left with the default 5% include those containing the directories /, /root, /var, /tmp, and (preferably) /home.

Scenario

Suppose that /dev/sda1 is a 2TB partition that is used for archiving video files. The default 5% reservation would reduce the usable capacity by 100GB, for little practical benefit. You wish to reduce the reservation to zero.

Method

The reservation can be changed using the -m option of the tune2fs command:

tune2fs -m 0 /dev/sda1

The number is the required percentage (without a percentage sign). If successful, tune2fs should report the new reservation with a message of the form:

tune2fs 1.41.12 (17-May-2010)
Setting reserved blocks percentage to 0% (0 blocks)

The -m option can also be used as an argument to mke2fs when creating a new ext2, ext3 or ext4 filesystem.

See also

Further reading

Tags: ext2 | ext3 | ext4