meta data for this page
  •  

This is an old revision of the document!


ZFS shrink pool

Shrink zpool is not possible, but trick with 2nd device (or even file) works:

  • add 2nd device to zpool (can be smaller - only to fit data)
  • remove 1st device - zpool will copy all data to another device.
  • to create mirror, use attach not add' <code bash> zpool list rpool -v zpool offline rpool /dev/disk/by-id/SECOND-part3 zpool detach rpool /dev/disk/by-id/SECOND-part3 </code> Resize /dev/disk/by-id/SECOND-part3 to smaller size. <code bash> zpool add rpool /dev/disk/by-id/SECOND-part3 zpool remove rpool /dev/disk/by-id/FIRST-part3 </code> Resize /dev/disk/by-id/FIRST-part3'' to smaller but equal to SECOND-part3 size.
zpool attach rpool /dev/disk/by-id/SECOND-part3 /dev/disk/by-id/FIRST-part3

zpool attach rpool /dev/dusk/by-id existing disk