Expanding zroot

Hi,

My first attempt at a FreeBSD 15.1 upgrade did not go well. I started here and 13G free was not enough!
Code:
[strand.202] $ freebsd-version -kru
14.4-RELEASE-p11
14.4-RELEASE-p11
14.4-RELEASE-p12

[strand.203] $ df -h | head -2
Filesystem                                       Size    Used   Avail Capacity  Mounted on
zroot/ROOT/14.4-RELEASE-p12_2026-11-08_161249     34G     20G     13G    60%    /
There's unused capacity, but I can't figure out how to get ZFS to actually use the 15GB it has free in the pool.
Code:
[strand.204] $ zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot  52.5G  37.5G  15.0G        -         -    57%    71%  1.00x    ONLINE  -

[strand.205] $ sudo gpart show
=>       40  115343280  vtbd0  GPT  (55G)
         40       1024      1  freebsd-boot  (512K)
       1064        984         - free -  (492K)
       2048    4194304      2  freebsd-swap  (2G)
    4196352  111144960      3  freebsd-zfs  (53G)
  115341312       2008         - free -  (1004K)

[strand.206] $ zpool status
  pool: zroot
 state: ONLINE
  scan: scrub repaired 0B in 00:02:00 with 0 errors on Tue Feb  7 09:36:08 2023 config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          vtbd0p3   ONLINE       0     0     0

errors: No known data errors

[strand.208] $ sudo zpool get autoexpand zroot
NAME   PROPERTY    VALUE   SOURCE
zroot  autoexpand  on      local

[strand.209] $ sudo zpool online -e  zroot /dev/vtbd0p3

[strand.210] $ zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot  52.5G  37.5G  15.0G        -         -    57%    71%  1.00x    ONLINE  -
How can I get that 15G marked as FREE into the ALLOC pool?

Edit: I am most grateful for boot environments, which facilitated a quick return to the safety of FreeBSD14.4.
 
df -h for a snapshot is not telling you anything about the entire disk usage. I don't even know if there's any meaningful sense to using df with ZFS.

Your free space is about 15.0G as seen in zpool list. That's the free space on the zroot pool. It should be close to "Avail" seen from zfs list for the zroot, but the true free space is what zpool list shows as free.

Your zroot pool already occupies the entire partition it's on. There's nothing to expand.
 
df -h for a snapshot is not telling you anything about the entire disk usage. I don't even know if there's any meaningful sense to using df with ZFS.

Your free space is about 15.0G as seen in zpool list. That's the free space on the zroot pool. It should be close to "Avail" seen from zfs list for the zroot, but the true free space is what zpool list shows as free.

Your zroot pool already occupies the entire partition it's on. There's nothing to expand.
OK. Point taken. The space accounting is somewhat problematic.
 
Don't know which pkg version you're using.
For 15.1-RELEASE and latest pkg v. 2.9.0 has just become available. At the moment not yet available using quarterly as a package. You might want to try that; or OTOH, if you you are already using that, perhaps just switch back to 2.8.4.; from here:
Code:
[1-0] # ls -lah /var/cache/pkg/pkg-2.8.4*
lrwxr-xr-x  1 root wheel   24B Sep 18 00:00 /var/cache/pkg/pkg-2.8.4.pkg -> pkg-2.8.4~2$y8tbtkyk.pkg
-rw-r--r--  1 root wheel   13M Aug 27 03:04 /var/cache/pkg/pkg-2.8.4~2$y8tbtkyk.pkg

It could also be that, as there is actually 13.3G available*, and not:
Code:
[strand.210] $ zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot  52.5G  37.5G  15.0G        -         -    57%    71%  1.00x    ONLINE  -
that "for some pkg reason" you need more space ... allthough IMO 13.3G should be enough.

___
* zpoolprops(7):
Rich (BB code):
free	       The  amount of free space available in the pool.  By con-
		       trast, the zfs(8) available property describes  how  much
		       new  data can be written to ZFS filesystems/volumes.  The
		       zpool free property is not generally useful for this pur-
		       pose,  and  can	be  substantially  more  than  the   zfs
		       available space.  This discrepancy is due to several fac-
		       tors, including raidz parity; zfs reservation, quota, re-
		       freservation,  and  refquota  properties;  and  space set
		       aside by spa_slop_shift (see  zfs(4)  for  more	informa-
		       tion).
 
It was the post-15.1 pkg upgrade that broke the bank (600+ packages to be updated, mostly, I think for shared library changes). Since it's a VM, I think I'll just allocate another larger volume. Need to look into zpool replace for the zroot. Maybe it's safer to mirror the existing single vdev to a larger new one, install the boot code, and break the mirror?

[I'm old enough to remember when a DEC Unibus RL02 (10MB) was big enough for the root. 50GB+ does seem to indicate some bloat...]
 
Back
Top