growfs(8)

growfs8

Expand an existing ufs file system

Usage

growfs {[-Ny] [-s size] special | filesystem}

Overview

The growfs utility makes it possible to expand an UFS file system. Before running growfs the partition or slice containing the file system must be extended using gpart(8). The growfs utility extends the size of the file system on the specified special file. The following options are available:

-N

“Test mode”. Causes the new file system parameters to be printed out without actually enlarging the file system.

-s size

Determines the size of the file system after enlarging in sectors. Size is the number of 512 byte sectors unless suffixed with a b, k, m, g, or t which denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. This value defaults to the size of the raw partition specified in special (in other words, growfs will enlarge the file system to the size of the entire partition).

-y

Causes growfs to assume yes as the answer to all operator questions.

Exit status

Exit status is 0 on success, and >= 1 on errors. Errors recoverable by user action are indicated by 2. OS errors, which are usually not recoverable, are indicated by 3 or greater.

Examples

Expand root file system to fill up available space:

growfs /

Refresh the LUN size, resize the partition to use all available capacity, and expand the filesystem accordingly:

camcontrol reprobe da0
gpart recover da0
gpart resize -i 1 da0
growfs /dev/da0p1

Caveats

When expanding a file system mounted read-write, any writes to that file system will be temporarily suspended until the expansion is finished.

Releases

65 releases since FreeBSD 4.4-RELEASE; the text changed 44 times.

  1. 4.4–4.5
  2. 4.6–4.7
  3. 4.8–4.9
  4. 4.10–4.11
  5. 5.0–5.1
  6. 5.2–5.2.1
  7. 5.3
  8. 5.4–5.5
  9. 6.0–6.3
  10. 6.4
  11. 7.0
  12. 7.1
  13. 7.2
  14. 7.3
  15. 7.4
  16. 8.0
  17. 8.1
  18. 8.2
  19. 8.3
  20. 8.4
  21. 9.0
  22. 9.1
  23. 9.2
  24. 9.3
  25. 10.0
  26. 10.1
  27. 10.2
  28. 10.3
  29. 10.4
  30. 11.0
  31. 11.1
  32. 11.2
  33. 11.3
  34. 11.4
  35. 12.0
  36. 12.1
  37. 12.2
  38. 12.3
  39. 12.4
  40. 13.0–13.2
  41. 13.3–13.5
  42. 14.0
  43. 14.1
  44. 14.2–14.5
  45. 15.0–16.0

History

The growfs utility first appeared in FreeBSD 4.4. The ability to resize mounted file systems was added in FreeBSD 10.0.

Authors

Christoph Herrmann ⟨[email protected]⟩ Thomas-Henning von Kamptz ⟨[email protected]⟩ The GROWFS team ⟨[email protected]⟩ Edward Tomasz Napierala ⟨[email protected]⟩

Bugs

Normally growfs writes cylinder group summary to disk and reads it again later for doing more updates. This read operation will provide unexpected data when using -N. Therefore, this part cannot really be simulated and will be skipped in test mode.

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