Page MenuHomeFreeBSD

rc+devd: Add growfs_postboot
Needs ReviewPublic

Authored by cperciva on Sat, Aug 1, 12:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 13, 10:48 AM
Unknown Object (File)
Thu, Aug 13, 2:05 AM
Unknown Object (File)
Wed, Aug 12, 3:29 PM
Unknown Object (File)
Tue, Aug 11, 8:49 AM
Unknown Object (File)
Tue, Aug 11, 4:30 AM
Unknown Object (File)
Mon, Aug 10, 8:38 AM
Unknown Object (File)
Sat, Aug 8, 3:48 PM
Unknown Object (File)
Fri, Aug 7, 11:14 AM
Subscribers

Details

Reviewers
imp
jmg
ziaee
Summary

In VM and cloud environments it is often possible to enlarge virtual
disks; this can be useful, for example, if a system is launched with a
small root disk and it later becomes clear that more space is needed.

On kernels which support run-time resizing of disks (for NVMe, this was
added in November 2025; some other disk types have supported this for
longer) a SIZECHANGE notification is sent to userland via devd.

Add a "nostart" rc.d script (runnable manually but not automatically at
boot time) and a devd script which invokes it when a notification
arrives. The rc.d script enlarges the "final partition" on partitioned
geoms, or the UFS filesystem or zpool device when triggered on a disk
containing either of those.

MFC after: 2 weeks
Relnotes: Disk partitions and filesystems can be enlarged

		automatically when disks grow by setting
		growfs_postboot_enable=YES in /etc/rc.conf.

Sponsored by: Amazon

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75326
Build 72209: arc lint + arc unit

Event Timeline

This is all I can find so far, but I didn't test it yet.

libexec/rc/rc.d/growfs_postboot
3–4

Please consider using this format for consistency with style guides and C style comments.

26
share/man/man7/growfs_postboot.7
1–24

Please consider using this format recommended by out style guides for consistency with C comments.

26

No change requested here, just note:

  1. both this and growfs(7) really shouldn't exist and should be part of rc.conf(5) for discoverability
  2. failing that, system operation commands do belong in section 8 per intro(8)
  3. failing that, we might as well match growfs(7) like the patch is currently doing... for now

Hopefully one day we can rewrite growfs(7), growfs_fstab(7), and this manual into a combination of rc.conf(5) and improved comments on the scripts themselves.

30
34
44

Macros inside list widths are cursed

84–85

Since you wrote everything, optionally consider using traditional style. Alternatively, it may make sense to append .An -nosplit after line 83 to change the line wrapping for when the AUTHORS section contains prose.