break raidz2 in order to create mirror

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
Having looked at how I use the space on my raidz2, I have come to the conclusion that a 3-way mirror will do just fine instead.

I have backups - but they're offsite, so a complete nuke + rebuild would take a long time.

My issue is, that I can't seem to find info on howto "pull" a disk from the raidz2 (leaving it in degraded state), wipe the disk, and use it to create a new pool.

Anyone got some pointers on where I have to look? I'm leaning towards pulling the disk physically and wiping in another machine, but would prefer to do it all in TrueNAS.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi,

To do that, you need to offline a disk. You will drop to Degraded but will still have redundancy because Raid-Z2 uses 2 drives for that.

Once the disk is offline, you can remove it and wipe it (or at least the beginning of the drive). That way, TrueNAS will not recognize it when you plug it back in. You then create a single drive vDev with that drive and a new pool with that single drive. You ZFS replicate from your actual pool to that one.

Once done, you offline a second drive in your old pool (beware : no more redundancy from here) and wipe it. Once clean, you add it to the 1-drive vDev you created and turn it to a regular mirror. Once resilver is completed, you got some redundancy back. Once that is done, you can completely destroy the first pool and add a third drive in your new vdev to get that 3-way mirror you are looking for.

Be sure to understand every step, find every command, document them and re-double check everything before taking any of these actions. Done properly, you will be good. Do it wrong and you can destroy everything...
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
To do that, you need to offline a disk. You will drop to Degraded but will still have redundancy because Raid-Z2 uses 2 drives for that.
Done that part already :smile:

Once the disk is offline, you can remove it and wipe it (or at least the beginning of the drive). That way, TrueNAS will not recognize it when you plug it back in. You then create a single drive vDev with that drive and a new pool with that single drive. You ZFS replicate from your actual pool to that one.

This is where I'm stuck right now - was hoping to be able to wipe the disk in TrueNAS, but no luck so far (gpart destroy, dd and ... can't remember more right now). Think it's time to boot a livecd via ipmi :smile:

Once done, you offline a second drive in your old pool (beware : no more redundancy from here) and wipe it. Once clean, you add it to the 1-drive vDev you created and turn it to a regular mirror. Once resilver is completed, you got some redundancy back. Once that is done, you can completely destroy the first pool and add a third drive in your new vdev to get that 3-way mirror you are looking for.

Be sure to understand every step, find every command, document them and re-double check everything before taking any of these actions. Done properly, you will be good. Do it wrong and you can destroy everything...
Sounds like what I've planned.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
This is where I'm stuck right now - was hoping to be able to wipe the disk in TrueNAS
Just zero the first blocks of the disk. Something like this to wipe drive 'ada4' should do:
dd if=/dev/zero of=/dev/ada4 count=1M

Triple check what to fill in as drive name for output: There's no coming back!
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
Just zero the first blocks of the disk. Something like this to wipe drive 'ada4' should do:
dd if=/dev/zero of=/dev/ada4 count=1M

Triple check what to fill in as drive name for output: There's no coming back!
done as well - but no luck trying to create the new pool. Got the serial noted to be sure to nuke the right disk :smile:
Just going to nuke it with a linux (then I'm fairly certain no safeguards are in place to keep me from destroying stuff :P )
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
nuking with linux systemrescuedisk fixed my issues. Now it's send/receive time :smile:
 
Top