Exanding zpool help

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

vegaman

Member
Sep 12, 2013
60
3
8
Auckland, New Zealand
Hi,

I'm running low on space and have started to upgrade to 4TB drives, but I'm not sure if ZFS will work the way I want here. I know I can expand a zpool by replacing the drives with larger ones, but my zpool is 2 6 drive RAIDZ2 vdevs. Can I expand just one of the vdevs? Or do I have to replace all the drives in the zpool?

Here's a zpool status (resilvering at the moment because I replaced one of the drives before thinking of this):
Code:
  pool: sprite
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
  continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Wed Apr 15 22:21:39 2015
  441G scanned out of 8.77T at 566M/s, 4h17m to go
  27.3G resilvered, 4.91% done
config:

  NAME  STATE  READ WRITE CKSUM
  sprite  DEGRADED  0  0  0
  raidz2-0  DEGRADED  0  0  0
  gptid/b9c9d2b2-e1d0-11e4-bc17-0025908680ce  ONLINE  0  0  0
  gptid/fd97f39c-e243-11e4-bc17-0025908680ce  ONLINE  0  0  0
  gptid/3c12d182-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/3e01f46f-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/7ab74a98-e287-11e4-bc17-0025908680ce  ONLINE  0  0  0
  replacing-5  REMOVED  0  0  0
  10960347024451614254  REMOVED  0  0  0  was /dev/gptid/4207e711-e258-11e3-80d4-0025908680ce
  gptid/33c30984-e359-11e4-bc17-0025908680ce  ONLINE  0  0  0  (resilvering)
  raidz2-1  ONLINE  0  0  0
  gptid/bedac0a1-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/bf311930-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/bf8f918e-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/bfe5eb1e-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/c0424e65-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0
  gptid/c09c366d-e258-11e3-80d4-0025908680ce  ONLINE  0  0  0

errors: No known data errors
 

5teve

Active Member
Jan 23, 2015
106
35
28
49
Perth, Australia
I'm just doing the same with my freenas box, offline a drive and remove - replace - wait for it to resilver - repeat. I'm a complete novice at this.. so take my advice with a pinch of salt..

In freenas (i assume freebsd too, but i've only ever toyed with freenas) you can turn auto expand on, although I think it defaults to on for everything but the boot pool in freenas.

Code:
zpool get all <pool> | grep autoexpand

turn it on

zpool set autoexpand=on <pool>
In theory after the last disk is inserted it should expand to fill the empty space.

If auto expand is off and you have already replaced the disks I have just used.. (for a mirror though)

#zpool offline <pool> <device>
#zpool online -e <pool> <device>

for each drive and it will expand them

Steve
 

toomuchstuff

Member
Nov 4, 2013
37
9
8
As a note, if you have an extra drive bay zpool replace would be the way to go.
20.3. zpool Administration

Make sure you set autoexpand on for the pool like previously stated, but use the zpool replace command to swap online drives.
I have done this with several pools and rolling back from a failed replacement was painless.