Change ZFS raid type: raid 5 to raid 10

chilly-choice

New Member
Dec 19, 2023
2
0
1
Hello everyone, is there an easy way to change zfs from the same pool from raid 5 to raid 10?
 
Last edited:
No, there is no way to change RAID level on ZFS. Only way is to destroy existing pool and create new one. Be aware that this remove all data on that pool, destroy is destroy, you cannot reverse it and you will not be ask before zfs destroy pool. When you hit enter it will do it without asking if you are sure. ZFS assumes that you know what you are doing.
 
Hello everyone, is there an easy way to change zfs from the same pool from raid 5 to raid 10?

I'm not a ZFS wizard, but ZFS and I have been through a bit together so I hope I can point you in the right direction. The short answer to your question is "no" but there are hard ways to do other things. :)

It sounds like you have a zpool with a single raidz1 vdev made up of maybe four drives? (ZFS raidz1 is closest to a traditional RAID5 with a single parity drive, but note that RAIDZ in ZFS works a bit differently than RAID5 so you might want to read up on that.)

It sounds like maybe you want to switch to a pool made up of mirrored pair vdevs which is a pretty good mix of performance, redundancy, and flexibility for the future.

Unfortunately, you can't just switch vdev types on the fly. You can add new vdevs (even different types) to the pool on the fly to grow the pool (but that won't redistribute existing data.) Adding another raidz1 vdev would give you a topology similar to RAID50 but without your pre-existing data being striped.

To switch entirely you'd have to migrate your data off and recreate the pool. If you are thinking about new drives, start your new pool with them, zfs send your data across, and then decide what to do with your old drives.

Note that I'm only talking ZFS generically here and I wouldn't do any of it without a lot of reading and testing thoroughly on virtual drives with no data you care about inside a VM first. Also, I imagine this gets way more complicated if you are thinking about your rpool with PVE installed on it and, personally, I'd be thinking about backing up and reinstalling if I had a really compelling reason to change how the rpool was put together.

Some reading for you:
https://openzfs.github.io/openzfs-docs/Basic Concepts/RAIDZ.html
https://openzfs.github.io/openzfs-docs/man/v2.2/8/zpool-add.8.html
https://openzfs.github.io/openzfs-docs/man/v2.2/index.html