openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.56k stars 1.74k forks source link

Expand parity #16677

Closed sgayda2 closed 2 hours ago

sgayda2 commented 2 hours ago

Describe the feature would like to see added to OpenZFS

Given a zfs system with 4 drives configured with raidz1 i would like to be able to add a drive and make this into raidz2 system with 5 drives.

How will this feature improve OpenZFS?

Allows for better data protections even in the event that you don't have all the drives when creating the initial vdev/pool

Additional context

Given the recent work with raidz expanding, this feels like a natural progression of that work.

amotin commented 2 hours ago

This operation is much more difficult than the RAIDZ expansion, may be even impossible. In case of RAIDZ expansion each existing block keeps it current block pointer, spacemap is just extended at the end without modifications, etc. Conversion from RAIDZ1 to RAIDZ2 though would changing vdev space occupied by each block, that would require changes in all the block pointers and respective rewrite of spacemap. On top of that, due to padding used as part of RAIDZ it may happen that data previously stored on RAIDZ1 is just impossible to store on RAIDZ2 of one more disk (block that previously occupied 4 sectors on RAIDZ1 would required 6 on RAIDZ2), and even if there is enough of rawspace, the process of data rewrite will be insane, since the space will never be where it is needed.