---
title: "Resize drive and partition on FreeBSD 12 (pfSense)"
url: https://michalasobczak.pl/posts/resize-drive-and-partition-on-freebsd-12-pfsense.html
author: "Michał Sobczak"
description: "Recently I described how to increase drive, partition and filesystem on FreeBSD in Azure virtual machine. It turned out that this scenario was little bit different from a virtual machine running on top of VMware."
published: 2022-09-12T09:04:15.000Z
updated: 2022-09-12T10:35:23.000Z
language: en
categories: ["Technology"]
tags: ["FreeBSD", "pfSense"]
license: CC BY-NC-ND 4.0 (https://creativecommons.org/licenses/by-nc-nd/4.0/)
---
# Resize drive and partition on FreeBSD 12 (pfSense)

Recently I described how to increase drive, partition and filesystem on FreeBSD in Azure virtual machine. It turned out that this scenario was little bit different from a virtual machine running on top of VMware. First of all, with or without vm-tools I was not able to get updated drive size:

```text
camcontrol rescan all
```

It gives messages that rescanning was successful, but actually it did not apply new values. However we can check new drive size with the following command:

```text
camcontrol readcap da0 -h    # daX
```

If on your system you get same results, then you need to reboot.

There is also a difference of having swap space. First disable it:

```bash
cat /etc/fstab               # pick swap device to use
swapoff /dev/label/swap0     # as an example
```

Then remove swap partition as freebsd-ufs partition need to be a continuous space:

```text
gpart delete -i 2 da0s1      # refer to gpart show
```

Then as previously run resizing commands:

```bash
gpart resize -i X da0        # X would be probably 1
service growfs onestart
```

Now you are done.
