Skip to Content

Protect Your zpools From Running Out of Space

One quirk of ZFS is that deleting a file actually uses a small amount of additional drive space to record the deletion, which causes significant problems if a zpool is ever allowed to fill up 100%.

Fortunately, it’s easy to prevent. As Benedict says:

Don't let your zpool fill up completely by creating a dataset with
reservation.

# zfs create -o refreservation=<5% of total pool space> <poolname>/reserved

You can always shrink the reserve if you need the space, but your pool will
always have space left this way.

                -- Benedict Reuschling [...]

Easy. Use zfs create to reserve the space.

$ su
Password:

# zpool list -H -o size backup
3.62T

# bc
3.62 * 0.05 * 1024
184.32
^C
Broken pipe

# zfs create -o refreservation=185G backup/reserved

In case of emergency, use zfs set to reclaim the space.

# zfs set refreservation=1G backup/reserved

Thanks, Benedict.