Growing ZFS pool

recently one of the drives in my storage pool died. Considering that I already was running out of free space:

#zfs list storage
NAME USED AVAIL REFER MOUNTPOINT
storage 3.21T 820G 236K /storage

I decided to not only replace the failed 1.5TB drive but get two 4TB drives and upgrade whole vdev. Imagine my surprise that despite my memory telling me that it should grow on it’s own. It didn’t.

Some searching later I found out that replacing drives is only part of the solution.
First you have to make sure that autoexpand is on

#zpool get autoexpand storage
NAME PROPERTY VALUE SOURCE
storage autoexpand off default

#zpool set autoexpand=on storage
NAME PROPERTY VALUE SOURCE
storage autoexpand on local

That still didn’t do the trick, but I’ve noticed that now it was showing:

#zpool get expandsize storage
NAME PROPERTY VALUE SOURCE
storage expandsize 2.27T -

To make it use that space you need do zpool online -e for all replaced devices:

#zpool online -e storage wwn-0x5000c500654c1adc
#zpool online -e storage wwn-0x5000c500652efbc2

and now:

#zfs list storage
NAME USED AVAIL REFER MOUNTPOINT
storage 3.21T 3.04T 236K /storage

7 thoughts on “Growing ZFS pool”

  1. Thanks for this post! I was wondering why my pool wasn’t expanding when I came across your article. Now it’s working great :)

  2. Thank you. I ran into exactly the same problem. I had set my autoexpand property to ON, but apparently when I updated ZFS, it changed it back to OFF. So I’ve noticed that I have to periodically recheck my config settings to make sure they are where I want them, and not at the defaults.

  3. I think that if you have autoexpand=on BEFORE you replace the devices with larger ones, the pool expands automatically.

    Only if you accidentally left autoexpand=off when you replace the devices, and then switch it to on, do you have to do the online -e step.

    At least thats what I remember from the last time I did it…

    …but it’s been a while…

    …and that was on FreeBSD, not ZOL.

  4. Thanks again! autoexpand was on originally for my pool but must’ve gotten defaulted to OFF from the reinstalls over the year. Thought I was going nuts thanks

Leave a Reply

Your email address will not be published. Required fields are marked *