Migrating from mirrors to RAIDZ2

Hi everybody!

First post here, I know this type of subjects comes back frequently here, but I haven’t been able to find an answer to my problem.

Here is my current storage configuration:

pool data01
  - MIRROR
      - 8TB
      - 8TB
  - MIRROR
      - 8TB
      - 8TB

What I would like to get is:

pool data01
  - RAIDZ2
      - 8TB
      - 8TB
      - 8TB
      - 8TB

The pool is currently only containing 3TB of data. I have 2 available 4TB drives that I could use for the migration.

My idea would be to:

  1. add the 2x4TB drives to my current pool as a MIRROR
  2. remove all other MIRROR vdevs from the pool
  3. add a RAIDZ2 vdev to the pool
  4. remove the remaining MIRROR vdev

This would allow me not to have to create a new pool, and have a smoother migration.

Would this solution work? Is it a good idea?

Thank you in advance, and sorry if this is a stupid question…

No.

The issue is that ZFS vDev remove does not work if their is a RAID-Zx or dRAID vDev in the pool.

However, something like this can work:

  1. Add the 2x4TB drives to my current pool as a MIRROR
  2. Remove all other MIRROR vDevs from the pool
  3. Create a new pool with the 4 x 8TB as a RAIDZ2 vDev
  4. Migrate the data from old pool to new pool
  5. When satisfied, destroy the old pool and remove it’s disks. (Or use those 2 x 4TB disks as a backup…)

There are other choices. But if you have the disk slots to add 2 x 4TB disks and only have 3TB of data, then what I’ve outlined above is safest.

3 Likes

Thank you @Arwen for the answer, I didn’t know that removing the vdev would not be possible in my case :+1:

Just to confirm, if I create a new pool (eg. data02), and delete the old pool data01, I won’t be able to rename the new pool to the old name?

Actually yes, you would be able to rename the new pool to the old name.

It can be complicated at times, because the Shares use a specific path. Thus, renaming can be useful. However, it is not a common task so I don’t know if that is in the GUI.

1 Like

In this case however, you’d be replicating data01 to temporary data02, and then creating a new data01 pool and replicating from data02 “back” to data01 so renaming should not be necessary.

1 Like

Renaming is not in the GUI, but of course it’s straightforward enough from the shell: zpool import oldname newname. Then export it, then use the GUI to import it. A little tedious, but not particularly difficult.

3 Likes

Thank you all for the help! Now I just have to do it :sweat_smile:

In the end, I created a new pool with the 2 4TB drives as a mirror, replicated the old pool to the new pool, deleted the old pool, re-created it and replicated again the other way, and I think it worked (or I’ll have a very bad surprise at some point :fearful: ). Thanks again for the tips and help!

3 Likes