How to add new HDD to zfs pool?

Hello all,

I have the following pool where I want to add a new hdd (sdb)

    NAME         STATE     READ WRITE CKSUM
    nas-storage  ONLINE       0     0     0
      raidz1-0   ONLINE       0     0     0
        sde      ONLINE       0     0     0
        sdc      ONLINE       0     0     0
        sdd      ONLINE       0     0     0
    cache
      nvme0n1    ONLINE       0     0     0

my disks are

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 43.9M 1 loop /snap/certbot/1842
loop1 7:1 0 43.9M 1 loop /snap/certbot/1888
loop2 7:2 0 55.5M 1 loop /snap/core18/2344
loop3 7:3 0 110.8M 1 loop /snap/core/12725
loop4 7:4 0 61.9M 1 loop /snap/core20/1361
loop5 7:5 0 110.7M 1 loop /snap/core/12821
loop6 7:6 0 61.9M 1 loop /snap/core20/1376
loop7 7:7 0 55.5M 1 loop /snap/core18/2284
loop8 7:8 0 67.9M 1 loop /snap/lxd/22526
loop9 7:9 0 67.2M 1 loop /snap/lxd/21835
sda 8:0 1 238.5G 0 disk
├─sda1 8:1 1 243M 0 part /boot/efi
├─sda2 8:2 1 228.9G 0 part /
└─sda3 8:3 1 9.4G 0 part [SWAP]
sdb 8:16 0 14.6T 0 disk
sdc 8:32 0 14.6T 0 disk
├─sdc1 8:33 0 14.6T 0 part
└─sdc9 8:41 0 8M 0 part
sdd 8:48 0 14.6T 0 disk
├─sdd1 8:49 0 14.6T 0 part
└─sdd9 8:57 0 8M 0 part
sde 8:64 0 14.6T 0 disk
├─sde1 8:65 0 14.6T 0 part
└─sde9 8:73 0 8M 0 part
nvme0n1 259:0 0 447.1G 0 disk

When I try to add sdb to the pool

zpool add nas-storage /dev/sdb

I am getting the following message.

invalid vdev specification
use ‘-f’ to override the following errors:
mismatched replication level: pool uses raidz and new vdev is disk

How can I add sdb under raidz1-0?

Thank you for your help.

With RAIDZ, you can’t add a disk to make it a 4-wide RAIDZ. vdevs can’t be changed once they are created (mirrors are an exception to this). But you can always add new vdevs (of equal width).

There are two option you have:

  • delete the pool and create a new one with 4-wide RAIDZ and restore from backup.
  • Add 3 disks with RAIDZ as a new vdev. Also comes with performance increase as data is striped across all vdevs. Basically a RAID 50 so to say.

RAIDZ expansion within a vdev isn’t possible. One of the many downsides of parity RAIDs.

You are lucky ZFS complains a lot :slight_smile: You tried to add another vdev with a single disk, which obviously doesn’t have any redundancy. Don’t do this.

1 Like

RAIDZ expansion is on the way, but it’s not ready yet. To add a 4th drive to a RAIDZ you’d need to recreate the pool.

raidz expansion works fine. i rebased it to latest openzfs master here github nicman23/zfs/tree/ahrens-raidz-expand (new member here)

if you run arch i can give you the pkgbuilds. after compiling / rebooting

  • you first update your zpool with zpool upgrade

  • then you can expand with ie zpool attach zpool raidz1-0 /dev/sdd

do not use blake3 as i have not tested it (neither the original author of the PR)