This is just a quick note to jot down what I did to resize and expand a ZFS partition to entire disk. I never had to do this before; it tured out it was quite easy.

First ensure that the autoexpand option is set on the zpool. Then, stop the VM in order to resize the disk volume.

[root@phnomaural ~]# zpool set autoexpand=on immich

[root@phnomaural ~]# poweroff
[root@phnomaural ~]# Connection to phnomaural closed by remote host.

The original size of ZFS disk was 256 GiB, and it has been increased to 512 GiB. This was done by stopping the VM running on XCP-ng, and go to the disk and change the size to 256 GiB.

[root@phnomaural ~]# lsblk /dev/xvdb
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
xvdb    202:16   0  512G  0 disk
├─xvdb1 202:17   0  512G  0 part
└─xvdb9 202:25   0    8M  0 part

The zpool still reported the old size:

[root@phnomaural ~]# zfs list
NAME     USED  AVAIL     REFER  MOUNTPOINT
immich   119G   127G      119G  /var/lib/podman/containervols/immich/upload
[root@phnomaural ~]# zpool status
  pool: immich
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        immich      ONLINE       0     0     0
          xvdb      ONLINE       0     0     0

To exand the zpool immich to use up the entire disk, run:

[root@phnomaural ~]# zpool online -e immich xvdb
[root@phnomaural ~]# zpool list
NAME     SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
immich   510G   119G   391G        -         -     0%    23%  1.00x    ONLINE  -

That’s it.

Reference: