'Merging' mirrors question

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73
I have a pool consisting of 3 mirrors:
2 mirrors use 2TB disks (these are pretty old disks that I expect to have to replace)
1 mirror uses 4TB disks

I'd like to merge the 2 mirrors of 2TB disks into 1 mirror of 4TB (or larger) disks. Is that in any way doable? If so, what's the (easiest) way forward?

Cheers,

H
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Stop all your shares, services, VMs and jails.

Create a new pool with a mirror of 4+TBs... if you have the free space, zfs send | recv the contained datasets to the new pool.
If all the data is confirmed in the new pool, rename the old pool and then destroy the old pool. You could then add the 1TB mirror to the new pool (if that's what you intended... seems maybe you were saying that).
Rename the new pool to the same name as the old pool.
Restart all your shares, services, VMs and jails.

(How do I rename a pool?: zpool export poolname, zpool import poolname newname, zpool export newname, import newname in GUI)
 

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73
OK, thanks for the fast response. That poses a bit of a challenge since my current pool consists of 6 disks:
mirror 1:
ada1 2TB
ada4 2TB
mirror 2:
ada2 2TB
ada3 2TB
mirror 3:
ada5 4TB
ada6 4TB

my objective is to replace mirrors 1 and 2 with one mirror consisting of 4-6TB drives. Your suggested approach would require me to create a new pool of >= size of the existing pool (ie a total of 8ish TB minus free data), correct? Having < 2TB of free space, that would mean using 8TB disks :-(.

Is my conclusion correct that there's no 'simple' way to migrate data from one mirror onto another one and delete that migrated mirror?

Thanks again! much appreciated.

H
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Actually you can do it like that...

zpool remove poolname mirror-1

If you have enough space in the pool to lose that top level VDEV, it will do the data move and take out the mirror.

So I would recommend first upgrading your FreeNAS version to a version that supports top-level VDEV removal (above 11.2, I think), then add the new mirror, then remove the mirrors (one at a time... and it will take a while) you don't want.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Keep in mind that a removed mirror requires RAM for the indirection table. Less of it as the data that was on that mirror is deleted. How much RAM is on that FreeNAS server?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Adding: If that whole business with redirection tables and RAM gets to be too much, it can be a good idea to get an external 10TB drive, copy all the data over, verify it’s there, destroy the pool and recreate it, and copy the data back in.

While ZFS can remove a mirror, it comes at a RAM cost, and that can be an issue depending on the amount you have installed.
 

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73
Ah, brilliant! Unfortunately, I don't have enough free sata ports to just add 2 new 6TB disks. Is my understanding correct that I could replace the 2TB drive in a mirrot with a 6TB, resilvber and then replace the other mirror with a 6TB as well? I read that Freenas will then understand that there is more storage space which then allows me to remove the second 2TB mirror as you described...
Thanks again!
 

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73
Keep in mind that a removed mirror requires RAM for the indirection table. Less of it as the data that was on that mirror is deleted. How much RAM is on that FreeNAS server?

I have 16TB or ECC
 

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Is my understanding correct that I could replace the 2TB drive in a mirrot with a 6TB, resilvber and then replace the other mirror with a 6TB as well? I read that Freenas will then understand that there is more storage space which then allows me to remove the second 2TB mirror as you described...
Yes, that will work.
 

Herman Eggink

Explorer
Joined
Jan 27, 2014
Messages
73
Quick update: everything worked as planned/suggested:
one by one replaced 2 of teh 2TB drives with 6TB drives
Freenas recognised the extra space
Then zpool removed the mirror with the 2TB drives. This only worked after a reboot and errored the first time.
Took the 2TB drives out once the mirror was removed.
On weird thing is that freenas, whilst recognising the extra space, is still listing the drives as 2TB instead of 6TB and still sees the old disk data (serial, type etc). Is there any way to force freenas to recheck and update the drive info?
EDIT:
Just updated to 11.3-U2.1 (was on U1) and that fixed everything.
 
Last edited:
Top