ZFS

This tutorial builds off of the bsdnow ZFS tutorial

Growing a ZFS mirror

To grow a mirror, expansion will need to be set on the pool:

zpool set autoexpand=on mypool

Here our pool name is 'mypool'. For a two drive disk pool (mirrored) to increase in size these two drives will need to be replaced, one at a time.

The new drives will need to be the same size, since they will be mirrored. Let's assume that the pool is on ad1 and ad2.

Before we start, we can run a scrub on mypool to ensure the data integrity.

Replace the first drive (ad1) with one of the larger new drives (ad3).

Offline (remove) ad1 from mypool:

zpool offline mypool ad1

mypool will now be in degraded mode. The pools state will change to DEGRADED.

Next we replace ad1 with ad3:

zpool replace mypool ad1 ad3

After replacing the drive, mypool will resilver itself. We need to wait until this operation completes. The size of mypool will still read the same as it did before, no increase in size will be visible.

Replace the second drive (ad2) with the other larger new drives (ad4).

Here we will follow the same steps that we did for the first drive.

Offline (remove) ad2 from mypool:

zpool offline mypool ad2

mypool will now be in DEGRADED mode.

Finally we replace ad2 with ad4:

zpool replace mypool ad2 ad4

After the drive has been replaced, mypool will resilver. After the resilver process completes, we can check the size of mypool with:

zfs list

The size of mypool will now register the increased size of the drives.