Grow a zpool ZFS On Linux + LVM

I’m actually heavily testing ZFS On Linux. As hard drive, I’m using a volume from LVM (named data-zfs2) :

 NAME STATE READ WRITE CKSUM
 backup ONLINE 0 0 0
   data-zfs2 ONLINE 0 0 0

 

But my volume is now nearly full :

[10:31:23]root@direct:~$ zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
backup 599G 584G 15.2G 97% 1.00x ONLINE -

So first, let’s tell ZFS to auto-expand :

zpool set autoexpand=on backup

And now, extend the volume underneath :

lvextend -L +100G data/zfs2
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
zfs2 data -wi-ao---- 700.00g

Let’s see what zpool is now reporting :

zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
backup 599G 584G 15.2G 97% 1.00x ONLINE -

Not good 🙁

You need to « refresh » the device :

zpool online backup data-zfs2

And now :

zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
backup 699G 584G 115G 83% 1.00x ONLINE -

Voilà !

Une réflexion sur « Grow a zpool ZFS On Linux + LVM »

  1. the command to ‘refresh’ device list is not working for me, must use the LV device path:
    zpool online backup /dev/data/zfs2

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *