Convert RAID1 to RAID5 without having to reload from backups

twoblink

Cadet
Joined
Oct 3, 2020
Messages
5
I searched the forums and it says that you cannot convert from RAID1 to RAID5 directly. But the post was from 2012 so I was wondering if this still applies in 2020.

I had 2X8TB HDD's in mirror; and started backing up everything that "should" have had a backup; and found myself less than 2TB left and I haven't even backed up everything. So I purchased another drive, am I gonna need to basically wipe it all; rebuild with RAID 5; or can I muck with how zpool handles it and it will automagically solve this for me? Thanks.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I searched the forums and it says that you cannot convert from RAID1 to RAID5 directly. But the post was from 2012 so I was wondering if this still applies in 2020.

I had 2X8TB HDD's in mirror; and started backing up everything that "should" have had a backup; and found myself less than 2TB left and I haven't even backed up everything. So I purchased another drive, am I gonna need to basically wipe it all; rebuild with RAID 5; or can I muck with how zpool handles it and it will automagically solve this for me? Thanks.

FreeNAS doesn't support RAID1 or RAID5 at all.

ZFS uses mirrors for something that is similar to RAID1, and RAIDZ{1,2,3} for things that are vaguely similar to RAID5 and RAID6 and Does-Not-Exist in RAID-land.

https://www.ixsystems.com/community/threads/terminology-and-abbreviations-primer.28174/

Your pool is made out of one or more ZFS vdevs.

A mirror vdev is two or more disks. You can add and remove disks from the mirror, but they all have the same content. You are only changing the amount of redundancy.

A RAIDZ vdev is able to withstand the loss of 1, 2, or 3 member disks, depending on whether it's RAIDZ1, RAIDZ2, or RAIDZ3. This is *NOT* the same as RAID5, and is a completely different technology. You cannot transform between RAIDZ levels or convert it to a mirror.

You can enlarge a vdev by replacing the component drives, one at a time, with larger drives and allow the system to resilver them.

You can also enlarge your pool by adding another vdev. However, once added, a vdev may not be removed.
 

twoblink

Cadet
Joined
Oct 3, 2020
Messages
5
So let me understand what you are telling me:

Let's say Drives A + B are mirrored; C is my new yet to be used drive.

I can "Break" my mirror between A and B.
I go ahead and install C
Make a vdev as a RAIDZ1 using Drives B and C
Copy everything from drive A to Drives B and C
Remove Drive A logically
Add Drive A back into the RAIDZ1 pool

Correct?




FreeNAS doesn't support RAID1 or RAID5 at all.

ZFS uses mirrors for something that is similar to RAID1, and RAIDZ{1,2,3} for things that are vaguely similar to RAID5 and RAID6 and Does-Not-Exist in RAID-land.

https://www.ixsystems.com/community/threads/terminology-and-abbreviations-primer.28174/

Your pool is made out of one or more ZFS vdevs.

A mirror vdev is two or more disks. You can add and remove disks from the mirror, but they all have the same content. You are only changing the amount of redundancy.

A RAIDZ vdev is able to withstand the loss of 1, 2, or 3 member disks, depending on whether it's RAIDZ1, RAIDZ2, or RAIDZ3. This is *NOT* the same as RAID5, and is a completely different technology. You cannot transform between RAIDZ levels or convert it to a mirror.

You can enlarge a vdev by replacing the component drives, one at a time, with larger drives and allow the system to resilver them.

You can also enlarge your pool by adding another vdev. However, once added, a vdev may not be removed.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I can "Break" my mirror between A and B.
Conceivably, yes.
Make a vdev as a RAIDZ1 using Drives B and C
You could, but you'd have an ultra-useless 2-wide RAIDZ1 vdev which will stay that way forever (or until someone does the RAIDZ expansion feature).

So, your overall plan is not feasible.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So let me understand what you are telling me:

Let's say Drives A + B are mirrored; C is my new yet to be used drive.

I can "Break" my mirror between A and B.
I go ahead and install C
Make a vdev as a RAIDZ1 using Drives B and C
Copy everything from drive A to Drives B and C
Remove Drive A logically
Add Drive A back into the RAIDZ1 pool

Correct?
You can do that using a dangerous process... see here:

In essence you create your 3 disk RAIDZ1 pool but with only 2 real disks, then copy the data and replace the missing disk with the real one.

In general, it will work, but the risks are yours to understand and take if you choose that.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Running without redundancy during the copy, and then adding redundancy back in. Doable, scary.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
However, once added, a vdev may not be removed from a pool that contains one or more raidz vdevs.

Bold portion added. Mirror vdevs and single drive vdevs in a pool that has only mirror or single drive vdevs can be removed, at the cost of (potentially a lot of) RAM. Definitely suboptimal, but has helped people get back from mistakes such as adding another single drive vdev when they meant to mirror the existing single drive vdev.
 

twoblink

Cadet
Joined
Oct 3, 2020
Messages
5
I haven't put it "into production" so to say; which means I can still nuke it all and start over.. My home backup (5 drive raid5) had 4 drives die within 7 days of each other.. Been lucky that the next one died AFTER rebuild (even though the rebuild was what caused it to die I'm sure) but at least the RAID survived intact..

So while I agree that no redundancy while copying is scary; I actually do have redundancy; just all of it at my house; why I wanted a NAS at the office as a remote backup.

Thanks; guess Nuke and reload wins!
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Bold portion added. Mirror vdevs and single drive vdevs in a pool that has only mirror or single drive vdevs can be removed, at the cost of (potentially a lot of) RAM. Definitely suboptimal, but has helped people get back from mistakes such as adding another single drive vdev when they meant to mirror the existing single drive vdev.

How is this relevant to the poster, who isn't going to have a use for such an arcane feature?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
How is this relevant to the poster, who isn't going to have a use for such an arcane feature?
It isn't. But it could well be useful to someone else who finds the thread in the future.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
One comment about creating a degraded RAID-Z1. It's MUCH safer with ZFS because of the checksums. After you are done, a zpool status, (or scrub), WILL tell you if anything failed on the destination. Unlike a normal degraded software RAID-5 with non-checksuming file system... So if you have backups, (or the source disk un-touched), you can fix the failed files.

That said, creating a degraded RAID-Z1 is still something to be avoided.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I love the word moist. So sensual.
 

twoblink

Cadet
Joined
Oct 3, 2020
Messages
5
Nuked and rebuilt (rebuilding) on a 3 disk RAID-Z. Thanks for all your comments everybody. I hope this thread helps someone later on.
 
Top