Replace VDEV in pool

Status
Not open for further replies.

stemplar

Cadet
Joined
Jan 3, 2018
Messages
4
I currently have a zpool with two vdevs: it began years ago as a single vdev with (8) 2tb drives, eventually had each of the drives replaced with 4tb drives, then was expanded by adding a second vdev of (6) 4tb drives. So I currently have:
zpool1:
vdev1 - raidz2 with (8) 4tb drives
vdev2 - raidz2 with (6) 4tb drives

I'm going to step through a few upgrades, the first of which will be replacing each of the 4tb drives in vdev1 with 8tb drives. When that's settled and known good, I'd like to replace vdev2 with a new vdev (call it vdev3) comprised of (8) 8tb drives, then retire vdev2 entirely. I'd like to end up with:

zpool1:
vdev1 - raidz2 with (8) 8tb drives
vdev3 - raidz2 with (8) 8tb drives

It seems straight forward enough to replace a vdev with another using the 'zpool replace' command, but can it be done through the freenas gui? Also, reading cyberjock's guide I don't see this as an option for "upgrading" a zpool. Has anyone done this?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
When that's settled and known good, I'd like to replace vdev2 with a new vdev (call it vdev3)
Not possible. You can replace disks, but not vdevs. Once a vdev has been created, the number of disks in that vdev can't be changed*. Once it has been made part of a pool, it can't be removed.

* Except that you can add disks to single-disk vdevs to turn them into mirrors, or to n-disk mirrors to turn them into n+1-disk mirrors.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
* Except that you can add disks to single-disk vdevs to turn them into mirrors, or to n-disk mirrors to turn them into n+1-disk mirrors.
Or remove them until only one is left. That works because all disks are trivial copies of each other.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
It seems straight forward enough to replace a vdev with another using the 'zpool replace' command, but can it be done through the freenas gui?
It does make sense that a vdev should be able to replaced by another vdev in the same way you can replace a disk with another disk. It could probably be implemented but that feature does not exist. Maybe if you put in a feature request?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Maybe if you put in a feature request?
This is a bit beyond "feature request" territory, it's deep ZFS internals territory.

I'll try to ask around and see if there's a technical reason holding this back or if it's totally doable but nobody's asked for it loudly enough, yet.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Anyway, the way to do what you want is to create the new pool and transfer to it.

Which, because I assume you might have trouble getting 31 or 23 or 19 disks online at the same time might be a good time to think about designating your old system as a backup for a new system.

You could get clever. And use one 8TB disk partitioned twice to replace two 4TB disks. Thus freeing up 7 disks slots. Then you use your other 8 disks to make a new pool. Transfer to that. Then add the next 8 disk vdev.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Which, because I assume you might have trouble getting 31 or 23 or 19 disks online at the same time might be a good time to think about designating your old system as a backup for a new system.
This is how I ended up with a primary server and a backup server. I wanted to change my vdev configuration because I started with 1TB drives and RAIDz1. When I went to 2TB drives I wanted to switch to RAIDz2 and that was enough of a change that the 'easy' way to do it was to build another server and move my data to it. I then reconfigured the drives in the 'old' server and copied the data back so both servers were running 2 x RAIDz2 vdevs with 6 x 2TB drives; 12 drives total in each server at the time.
My wife was very patient with me while I built the new server and rebuilt the 'old' server, on the dining room table...
 
Status
Not open for further replies.
Top