Change from Mirror to Raidz1 without pool rebuild

Hello guys,

im sorry to ask because this question was probably answered 100 times, but i read different answers online regarding the change from a mirror to a raidz1 vdev, especially after recent truenas updates.

I currently run 2x4tb drives in a mirror. Right now, i have the chance to get 4x8tb hard drives and i want to replace my old mirror with a Raidz1 of 3x8tb drives with one spare.

Can i add a new vdev to my pool and then remove the mirror?

If not, is there any other way to replace the mirror without rebuilding the whole pool structure?

Thanks a lot!

How many sata slots do you have access to in total? (please specify free/in-use)

1 Like

Post your full hardware specs. Possible options would be based off how many drives can be attached at one time.
Changes like you stated, usually need backup of data, destroy pool, create pool in new layout and then restore data from backup

2 Likes

No.

Also no, unfortunately. vdev removal is only available when all vdevs are either single disks or mirrors; if any vdev is RAIDZ, you can’t remove vdevs. If you have enough SATA ports, you can install the new disks, create a new pool on them, and replicate the data from the one to the other.

4 Likes

Only 4 and 1 is used for a cache ssd and 2 for the current hard drives. But i can add an HBA temporarily to increase it!

I should be able to connect all with an HBA. Is there a step by step guide on how to do this? I run a SMB share and a few apps (Nextcloud, Nginx, Tailscale, …) on the existing pool.

As far as i saw, i have to create a new Pool with all the new drives, then do a recursive Replication from the old to the new pool. After that, i have to transfer the data from the apps to the new pool and change the appdata paths to the new pool. Does that sound right?

1 Like

That is a textbook definition of a pool rebuild.

No. Any raidz member in a pool prevents ((meta)data) vdev removal.

Create your new pool, preferably in the same NAS, replicate your data from oldpool to newpool, and then rename newpool to oldpool.

You’d be better with a 4-wide raidz2: Better resiliency, and better starting point to consider raidz vdev expansion.

  1. Create a new pool
  2. Stop the apps and samba
  3. Snapshot the old pool recursively (zfs snapshot -r old-pool@ snapshot)
  4. zfs send -R old-pool@snapshot | zfs recv -F new pool
  5. Take a nap, wake up, make some coffee
  6. Export the old pool
  7. Rename the new pool to the old pool
  8. Start samba and your apps
  9. Profit

Please, do not forget to burn in your drives.

And please give some time so more knowledgeable people can point out if my approach or commands are incorrect.

4 Likes

thanks for the guide, really appreciate it!

1 Like

You can also do 3. and 4. from the GUI.
There is a resource for 7.

1 Like

http://forums.truenas.com/t/howto-rename-a-zfs-pool/

to save a step

1 Like