Solved ZFS on LVM backend and later resize

I am about to install FreeBSD as a fully virtualised Xen VM. It will use a Linux LVM volume for data storage.

If I want to resize the LVM volume later, can I grow and/or shrink the ZFS file system and if so, how?
 
  1. Offline the disk in the ZFS pool.
  2. Grow the LVM logical volume.
  3. Replace the disk in the pool with itself:
    # zpool replace <poolname> <disk name>

Do the above for each disk in the vdev.

If the autoexpand property on the pool is set, the new space will be available right away. If not, export/import the pool to make it available.
 
That's great, thanks Phoenix. Does this also work for a shrink operation? Not that I think shrinking will be very necessary, I ask mainly out of curiosity.
 
Back
Top