growfs_postboot(7)

growfs_postboot7

Automatically grow file systems during runtime

Overview

The growfs_postboot script expands filesystems automatically. Typically it is run via devd(8) in response to a SIZECHANGE notification. It will enlarge the final partition of a partitioned disk; expand a UFS file system; or expand a zpool device, as appropriate.

The following option in /etc/rc.conf controls the behavior of growfs_postboot:

growfs_postboot_enable

(“NO”) If set to “YES”, the script will enlarge partitions and file systems when disks expand.

Note that the growfs(7) startup script will normally place a swap partition at the end of the disk containing the root file system, which will prevent the file system growing further; as such, in most cases it will be advisable to set growfs_swap_size to “0” in virtual machine images if growfs_postboot is being enabled. If the system has already booted without that setting, a swap partition may have already been created, in which case it must be removed before this script can grow the root file system.

Files

/etc/rc.conf

Exit status

The growfs_postboot utility exits 0 on success, and >0 if an error occurs.

Caveats

I/O may be paused while file systems grow, so this functionality should be used with care on systems with strict latency requirements.

History

The growfs_postboot script first appeared in FreeBSD 16.0.

Authors

Colin Percival ⟨[email protected]⟩

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.