Expanding a ZFS RAID0 pool


I was in a situation where I needed to migrate two disks in a ZFS RAID0 pool. The goal was to extend the ZFS pool by replacing the disks with larger ones. Each disk was encrypted with LUKS.


ZFS expanding scheme


First I will do a copy from sda 2To disk to sdc 4To disk thanks to dd tool.


root@host:~# zpool export raid0_01
root@host:~# cryptsetup luksClose zfs01_crypt
root@host:~# dd if=/dev/sda of=/dev/sdc bs=8M status=progress
dd operation on two disks
root@host:~# parted /dev/sdc
(parted) resizepart
Partition number? 1
End?  [2000,0GB]? 4001,0GB
(parted) print
parted operation on two disks
root@host:~# cryptsetup luksOpen zfs01_crypt
root@host:~# cryptsetup resize zfs01_crypt -v
parted operation on two disks

Now we have to do the same operation with sdb disk.

Import and resize the new ZFS pool

root@host:~# zpool import -a
root@host:~# zpool online -e raid0_01 zfs01_crypt
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :