How to move mirror to new pair?

Hi, I’ve having trouble finding the path forward and I’m hoping someone can help me out. I’ve found similar threads on creating a mirror, but nothing quite what I’m looking for and I remain confused.

I’ve got a TrueNAS Core machine that’s been running for 7 or so years with a zfs mirror of 8TB drives. Well, the drives are now old and full so I bought a pair of 14TB drives and have installed them and checked them out with badblocks. I think what I now want to do is:

  1. Add the new disks one by one to the mirror
  2. Detach the old disks from the mirror?
  3. Uninstall the old disks?

What are the steps to do this? I figured I would just attach them to the zdev, but it looks like I need a gptid to do that the TrueNAS way. I started looking at partitioning and I noticed that TrueNAS seems to add a swap volume to each disk? I can’t imagine why I would want this, but perhaps there’s something I’m missing? Can I just format the disk with gpart and add 1 giant zfs partition? Is there a preferred GUI way to do this that I can’t find?

I think my zvol should autoexpand when the old disks are gone, right?

```
fn01% zpool get autoexpand vol1
NAME PROPERTY VALUE SOURCE
vol1 autoexpand on local
```

Anything I’m not thinking about? Thanks!

“Replace” one disk in the pool with a new disk and wait. When the resilver is complete do the same for the second disk.

This way you don’t lose parity

Alternative add a new vdev of a mirror with the new disks then remove the old vdev.

1 Like

The disks are somewhat old so I thought that adding before removing any would be safer.

I tried to use the webui to add a vdev with both new hard drives but it looks like it wants to extend rather than mirroring. It says Mirror: Estimated raw capacity: 12.73 TiB / Estimated data capacity available after extension.: 13.08 TiB

Yes, that’s what would happen if you add a new vdev. Nugent’s already given you the answer here.

So replacing the disks one at a time is the best option? It’s not possible to add the disks before removing any?

It’s possible to add them to your existing vdev, but why? What do you hope to accomplish by doing this? You do not need to remove a disk in order to replace it; you can keep it online while the replacement is running, and the system will automatically offline the disk when the replacement finishes. Replacing the disks one by one (or both at the same time, if preferred) is the simplest solution, and it’s no less safe than adding the two (making a four-way mirror) and then removing the first two.

Ouch …

Attach new disks to build 4-way mirror.
Detach old disks.

Removing a vdev while working reliably does introduce metadata overhead for indirection … something something … blocks.

That was the piece I was missing. Thanks