7

I have a storage pool aptly called storage with two disks in it. Originally, I wanted to add the second disk as a mirror but did the ZFS newbie mistake of using zpool add storage <device> instead of zpool attach storage <device>.

Every attempt to remove or detach the second device from the pool fails, because ZFS complains about not having redundant drives. After reading into it, I understand the issue and why this is. However, I wasn't able to find a solution how to either remove the drive to re-attach it or simply convert the whole pool to mirrored instead of striped. I'm also kind of puzzled by the fact there seems to be no straight-forward way to do it.

Is there a way to achieve this short of destroying and recreating the pool? I'd rather not need to buy another 4TB drive and copy all that data over.

3

Unfortunately, at this point you basically have two good options:

  • Destroy and recreate the pool with the intended configuration, then restore your data from a restoration copy
  • Get two more drives (minimum same size as each respective one you already have) and expand your pool to two mirrored pairs instead of two single disks

The latter can be performed in-place, and has the bonus of providing you with additional storage space, but requires you to purchase more hardware (which you said in the question that you don't want to do). The former cannot be done in-place, but provides you with a good opportunity to test your restoration strategy (you do have a restoration strategy, I presume?).

As you have found out, it's not possible to remove a JBOD component in a ZFS pool. By adding rather than attaching the new drive, you created a JBOD situation with multiple disks.

If you do go with expanding the pool, I suggest strongly considering expanding into raidz2 instead of two mirrored pairs. You get (essentially) the same usable storage capacity, but the ability to survive the failure of any two of the drives, as opposed to only one per pair. You can create a raidz2 vdev with two sparse files and then delete those files before replacing them with drives you are migrating data from, to migrate from your current situation of 2-disk JBOD to 4-disk RAIDZ2 only adding two more disks.

  • Regarding the raidz2 advice: It is true that you can live with the failure of any two disks, but your resilvering times will be slower (all disks have to be read completely instead of only the affected mirror) which also increases the chance of another disk dying in the resilver window, your performance will be worse (especially random reads, and this gets worse as you expand your pool), and finally, your pool expansion now needs four instead of two drives if you want symmetrical layout. You get all the downsides of parity raid with none of the space improvements - I would stick with mirrors. – user121391 Jul 19 '16 at 7:27
0

Unfortunately, destroying and recreating the pool would be your only option.

If you just want to extract this specific single drive (for other reasons, like if it has lower performance than all other drives), you can attach a mirror drive to the vdev and then detach the old drive from the vdev, thereby "extracting" the drive while leaving the pool intact (minus resilver time of course). But in your case this does not help much.

I would therefore suggest buying a larger drive that holds your complete pool data anyway, as otherwise you have no backup. ZFS may be the safest filesystem widely available, but it is not error-free. A dying controller, simultaneous death of both drives, malfunctioning power supply, administrator mistake, rogue attacker or simply a bug in ZFS or the host system can all lead to partial or complete data loss without a backup. RAID is not backup, and neither is ZFS.

Note that you can transmit all your data with ZFS send/recv, so apart from the money invested and the time for transmission it is quite straightforward.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.