---
name: "growfs_fstab"
section: "7"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/growfs/7"
---

# growfs\_fstab(7)

start up scripts to grow the root file system and add swap

Part of [growfs(7)](/growfs/7.md).

## NAME

**growfs**, **growfs\_fstab** – start up scripts to grow the root file system and add swap

## DESCRIPTION

The **growfs** script normally runs at the first boot after system installation. If the boot disk is larger than the root file system and boot partitions, and the root file system is in the last partition, **growfs** can expand the root file system. It can also add a swap partition, with a default size of 10% of the boot disk. Swap is limited to twice the memory size up to 4 GB, 8 GB up to 8 GB of memory, and memory size over 8 GB. It is also limited to the [sysctl(8)](/sysctl/8.md) value of vm.swap\_maxpages divided by 2. By default, no swap partition is created if an existing swap partition is found or is listed in */etc/fstab*, or the disk is under 15 GB. The **growfs\_fstab** script adds any new swap partition to */etc/fstab* after the root file system is made writable, and enables its use as a dump partition if the *dumpdev* variable from [rc.conf(5)](/rc.conf/5.md) is set to AUTO.

The following options in */etc/rc.conf* control the behavior of **growfs**:

- *growfs\_enable*

  (“NO”) If set to “YES”, the first time the machine boots, the root file system will be automatically expanded, if possible, to fill up all available space after it, after optionally adding a swap device at the end.

- *growfs\_swap\_size*

  (“”) If set to “0”, the addition of a swap partition is disabled. An empty value (“”) allows the creation of a swap partition with the default size. If set to another value, the swap partition will be created with the specified size in bytes, even if another swap partition is detected.

A setting for *growfs\_swap\_size* can be set in the kernel environment, in which case it overrides the value from */etc/rc.conf*.

To expand the root file system without rebooting, run the following command:

```
% /etc/rc.d/growfs onestart
```

In addition, if a swap partition is added, run the command:

```
% /etc/rc.d/growfs_fstab onestart
```

Note that if a disk is expanded again, and if the root file system had previously been expanded and a swap partition added, it is necessary to delete the swap partition before this procedure in order to expand the root file system to the new size. A new swap partition can be created during the expansion.

## IMPLEMENTATION NOTES

The **growfs** script only attempts to expand the root file system, and free space must be available immediately after the root partition. It is normally used on images that have a single file system. The script requires that [awk(1)](/awk/1.md) be present and in the path. This usually means that */usr* must be available prior to running the script.

## FILES

- */etc/fstab*

  - */etc/rc.conf*

  ## EXIT STATUS

The **growfs** utility exits 0 on success, and \>0 if an error occurs.

## SEE ALSO

[fstab(5)](/fstab/5.md), [rc.conf(5)](/rc.conf/5.md), [growfs\_postboot(7)](/growfs_postboot/7.md), [growfs(8)](/growfs/8.md), [zpool(8)](/zpool/8.md)

## HISTORY

The **growfs** manual page first appeared in FreeBSD 10.1. The ability to add a swap partition was added in FreeBSD 13.2.

## AUTHORS

The man page and script were written by John-Mark Gurney ⟨*jmg@FreeBSD.org*⟩. The ability to create a swap partition was added by Michael Karels ⟨*karels@FreeBSD.org*⟩.
