You can execute the commands from the live system.
I was reading this in the
handbook on disks and it mentions to use the following setting on a live system - Is this applicable to my case of zfs + geli ?
# sysctl kern.geom.debugflags=16
I can't tell for sure, the handbook is referring to UFS2. If not someone here in forums can answer the question explicitly, maybe somebody on the freebsd-fs@ mailing list can. That list is more frequented by FreeBSD filesystem developers than forums.
Anyway, the kernel state would apply only to the ZFS. The
geli(8) provider is acting here only as a container.
Be advised, if you are thinking to operate from a FreeBSD installation media, the instructions from
VladiBG won't work. Those work from the mounted system only.
If a installation media is used, use the instructions I gave in post
# 29.
Also the autoexpand isn't automatically set to on
zpool get autoexpand
NAME PROPERTY VALUE SOURCE
zroot autoexpand off default
I assumed it's on when testing, but actually it isn't needed to be set to expand the size of the pool after resizing the partition. Executing
zpool online [-e] pool device
alone is enough.
From
zpoolprops(7):
Rich (BB code):
DESCRIPTION
...
expandsize Amount of uninitialized space within the pool or device
that can be used to increase the total capacity of the
pool. On whole-disk vdevs, this is the space beyond
the end of the GPT – typically occurring when a LUN is
dynamically expanded or a disk replaced with a larger
one. On partition vdevs, this is the space appended to
the partition after it was added to the pool – most
likely by resizing it in-place. The space can be
claimed for the pool by bringing it online with
autoexpand=on or using zpool online -e.
Again, it would be best to make a backup before resizing the
geli(8) provider (partition).
Alternatively, if no backup device is available at the moment, don't resize the
geli(8) provider, create in the free space a separate (
geli(8) encrypted) partition with another ZFS pool inside and add it to the system.