Transitioning from 2x2 mirror to 4+2 raidz2 with data on box?

ermac318

Cadet
Joined
May 10, 2020
Messages
6
Hello all,

First post, I believe I've searched and haven't found a good answer to my question, but also would like advice on if there's a better way to approach what I'm attempting.

I have a pair of mirrored VDEVs which are backing up my main zpool on my home NAS running FreeNAS 11.2u7 (waiting on 11.3u3 to upgrade). I am receiving two more drives (10TB, matching my existing drives) so I will have a total of 6 drives. My system is getting full, but rather than just add another mirrored VDEV (which was my initial plan), I thought about transitioning to a RAIDZ2 setup.

My DIY Nas has 8 drive bays, so I was reticent to go to a 4+2 since that would make going to a 6+2 later impossible (until way in the future when expanding VDEVs is a thing, still waiting 2+ years so I'm not holding my breath). But I thought going with 4+2 would tide me over until such a time as I want to throw away all my 10TB drives and start over with bigger ones anyway.

I've got everything backed up to another location, but restoring from that backup takes a long long time. I was hoping to avoid having to get data from off-box to speed up the process. But again, I have a backup so I'm not worried about data loss at the moment.

My plan (if I decide to go to RAIDZ2) was to "fail" or "offline" one drive in each mirrored pair. If I understand right, this would leave my array in a degraded state but all my data would still be online. I would then create a new RAIDZ2 array, but use two "dummy" drives using sparse files (found a tutorial on this online), then offline those fake disks right away. I now am running a 4-drive 2x2 mirror with only two real drives, and a RAIDZ2 with four "living" drives but two offline drives.

I would then migrate all my data from the first zpool to the new one, then delete the old zpool, and adopt those drives into the new one and let it resilver.

Is this an absolutely atrocious idea? Is there a better way I could approach this? And again if there's any guides or other resources I should check on how to do this (or a better approach) I would appreciate the feedback.

Thanks very much for reading.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
My plan (if I decide to go to RAIDZ2) was to "fail" or "offline" one drive in each mirrored pair. If I understand right, this would leave my array in a degraded state but all my data would still be online.
Correct.
Is this an absolutely atrocious idea?
It is technically feasible assuming that you have accepted the risks you mention and prepared for the worst-case scenario (seems you have).

Best of luck with it if you decide to go down that path.

Is there a better way I could approach this?
Without using more disks than you have, there is no other way to get to your desired result without a restore from backup.
 

ermac318

Cadet
Joined
May 10, 2020
Messages
6
Correct.

It is technically feasible assuming that you have accepted the risks you mention and prepared for the worst-case scenario (seems you have).

Best of luck with it if you decide to go down that path.


Without using more disks than you have, there is no other way to get to your desired result without a restore from backup.
Thank you for the reply. So as its written my plan should work?
I also believe my best replication strategy is to use zfs send to copy data between the two zpools. I'll try to make sure I get the syntax correct, but that would be preferable to a simple CP command, right?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

ermac318

Cadet
Joined
May 10, 2020
Messages
6
It seems like it will to me.


Yep. Take a look at this suggestion so you can see how it's going while it does the copy https://docs.oracle.com/cd/E36784_01/html/E36835/gnheq.html
I'm taking the time to write down all the commands I'll want to do. If I offline the drives in the FreeNAS GUI, will I be able to join them to another ZFS zpool? What is the best way to liberate those disks from the existing zpool?

My zpool1 looks like this:
Code:
 zpool1     0     0     0     ONLINE
    MIRROR     0     0     0     ONLINE
        da0p2     0     0     0     ONLINE
        da1p2     0     0     0     ONLINE
    MIRROR     0     0     0     ONLINE
        da2p2     0     0     0     ONLINE
        da3p2     0     0     0     ONLINE


I need to offline da1 and da3, then add them to the new pool. If I just offline the disks, will the ZFS create command barf and say they're in use?
 

ermac318

Cadet
Joined
May 10, 2020
Messages
6
Hey everyone, just providing an update here, I chickened out and just added another mirrored vdev. I came to the decision that I can always add another pair of 10TB drives to get to 40, which is the max I could get with raidz2 (which I'd never be able to expand). I'd rather deal with a data migration/zfs pool rebuild down the road when I have 8 drives than right now.
 
Top