OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: eleanor-fiona on December 29, 2023, 05:39:36 am

Title: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: eleanor-fiona on December 29, 2023, 05:39:36 am
I am currently running OPNsense version [insert version here] on a Proxmox VM and have encountered an issue with expanding my ZFS pool. I initially allocated 10GB to the VM, but OPNsense only recognizes 1.62GB, and I am unable to expand the pool to use the full disk space.

Here's a summary of what I've done and the issues I've encountered:

- Installed OPNsense on a VM with a 10GB disk, but OPNsense only sees 1.62GB.
- Tried to expand the ZFS pool using various methods (zpool online -e, zfs list, etc.), but the system does not recognize the free space.
- Attempted to force export (zpool export -f) and destroy (zpool destroy zroot) the pool, but it fails to unmount the root filesystem.
- Backed up the entire ZFS pool to a USB stick successfully.
- Running in single-user mode did not resolve the issue.

I am looking for a way to expand my ZFS pool without having to reinstall OPNsense, as I would like to avoid this if at all possible.

Any assistance or insight the community can provide would be greatly appreciated.
Title: Re: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: Free_Norway on January 11, 2024, 02:39:29 pm
Hi Eleanor-Fiona

I have Opnsense running on a Proxmox the last 8-9 years.

Question:



What do you see in the dashboard of OPnsense under Disk usage?
What does the output of the "df" command give you?

Kind regards
Sebastian
Title: Re: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: Patrick M. Hausen on January 11, 2024, 02:43:53 pm
I am currently running OPNsense version [insert version here] on a Proxmox VM and have encountered an issue with expanding my ZFS pool. I initially allocated 10GB to the VM, but OPNsense only recognizes 1.62GB, and I am unable to expand the pool to use the full disk space.
That's probably because the installer put an 8 GB swap partition on that same virtual boot drive. Please post the output of
Code: [Select]
gpart show from a shell in your OPNsense VM.

Can you afford to allocate another, say, 10 GB to that virtual disk in Proxmox? That would be the easiest way. I can tell you how to expand the zpool from within the VM once you answered both these questions.

Kind regards
Patrick
Title: Re: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: majestic on April 07, 2024, 08:01:29 pm
Not OP, but I have the same issue using Hyper-V.

Code: [Select]
$gpart show
=>      40  20971440  da0  GPT  (10G)
        40    532480    1  efi  (260M)
    532520      1024    2  freebsd-boot  (512K)
    533544       984       - free -  (492K)
    534528  16777216    3  freebsd-swap  (8.0G)
  17311744   3657728    4  freebsd-zfs  (1.7G)
  20969472      2008       - free -  (1.0M)

I can afford to allocate another, say, 10 GB to that virtual disk in Hyper-V. Any help to expand the zpool from within the VM would be appreciated.

Thank you.
Title: Re: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: Patrick M. Hausen on April 07, 2024, 08:07:18 pm
Expand the disk, then use gpart recover to fix the backup GPT table, then gpart resize to resize the ZFS partition. It's not hard.

Probably, untested and from memory:
Code: [Select]
gpart recover da0
gpart resize -i 4 da0

If ZFS does not automatically recognize the new space, then maybe
Code: [Select]
zpool online -e zroot da0p4will do the trick.

None of these commands is destructive, just go ahead and try them. Report back if my memory failed me and anything isn't working.
Title: Re: Assistance Needed with Expanding ZFS Pool on OPNsense VM
Post by: majestic on April 07, 2024, 09:04:32 pm
That worked great. Thanks for all your help.