Growing ZFS Pool / Replacing disk

Status
Not open for further replies.

Harsesis

Explorer
Joined
Jan 21, 2014
Messages
95
Hi,

I'm running Freenas 9.2.1.3 with and ZFS Pool is a stripe over three mirrors:
mirror: 2x 4TB
mirror: 2x 4TB
mirror: 2x 2TB

Now I would like to replace the the "old" 2x 2TB mirror with an 2x 4TB mirror, because I have some trouble with the 2TB disks. In the wiki I found an article about expanding the pool by replacing old disks, but I would like to go a bit safer way as I have enough free ports to add the new disks additonaly.

Am I right, that it should be possible to add the new disks as additional mirror disks to the 2x 2TB mirror so that there is a 4x mirror (2x 2TB 2x4TB) and after the successfull resilvering remove the two smaller disks to get to the final configuration?

Now to the main question: How should I do this the best way?
The GUI seems not to offer an option to add additional mirror disks. As a sidenote I'm using encrypted drives, so that needs to be considered too.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No, you cannot remove a vdev after its been created. Please read my "noobie guide" to understand this.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
You can actually upsize your mirror this way, see: https://digitalelf.net/2010/04/growing-the-capacity-of-a-zfs-mirror/

But, if you have the connections, I'd think it'd be faster to just create the new 2x4TB mirror and use replication to send over the old 2x2TB data.

...
Ha, never mind. I missed that they're stripped.

Yeah, you need to attach and detach the drives, waiting for the resilver to complete between each. The link I posted above is exactly what you need to do.

Mirror is the one exception to the restriction against adding / removing devices.
 

Harsesis

Explorer
Joined
Jan 21, 2014
Messages
95
@ cyberjock: I thought the mirrors are a bit differnt here, like fracai mentioned?
@ fracai: thanks for the link, but there is not mentioned how to handle encrypted pools. Would be nice to have some steps how to prepare the drives correctly!
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
Encryption shouldn't change anything as the encryption is separate from the ZFS layer.
You also shouldn't need to "prepare" the drives at all.

Just connect the new drives, attach the first new, attach the second new, wait for the resilver to complete (zpool status), detach the first old, run "zpool status" just to be sure the pool is still healthy, detach the second old, "zpool status" to verify everything is healthy. You may need to re-import the pool to see the increased space. You could alternatively attach, resilver, detach, attach, resilver, and detach. I'm not sure if the double resilver will take longer than resilvering two drives at once.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Mirrors are different as you can add and remove disks from that vdev. You can't add/remove vdevs though. Isn't that what you are trying to do? Or are you saying you want to go to a 4-way mirror, then remove the 2 smaller disks from that mirror? I thought you were wanting to add a vdev with your shiny new disks, then remove the vdev that has your 2TB disks.

If you are wanting to expand to a 4-way mirror you can do that, but you will have to do it from the CLI. The proper commands are in the forum for handling the disks in FreeNAS. Don't use FreeBSD documentation for this though as it's not completely appropriate for FreeNAS.
 

Harsesis

Explorer
Joined
Jan 21, 2014
Messages
95
Hi,

thank you both!

@cyberjock: That is exactly what I have planed. I want to ovoid an situation in which my pool is in an degraded status. In my opionion this is an safer way to replace the old disks, isn't it?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It's safer yes. Slightly more work for you, but nothing too terrible.
 

Harsesis

Explorer
Joined
Jan 21, 2014
Messages
95
Status
Not open for further replies.
Top