Adding metadata vdev, keep snapshots

I’ve added a metadata vdev to my pool. New data will use it, but I’d like to migrate old data there as well. One way I’ve seen suggested is to just delete everything and copy it back from a backup.

However, I have periodic snapshots set up on the pool. If I delete and copy back everything, won’t that just duplicate everything? The old copies are kept in the snapshots, and I’m guessing will just coexist with the new copies. Is there a way to do this while keeping my snapshots?

Yes.

No.

Post must be at least 20 characters.

1 Like

FWIW, I simply made a backup, turned off auto-snapshots, deleted all extant snapshots, ran the rebalancing script (see sVDEV resource), then re-enabled auto-snapshots and ran a manual one for the pool.

So not even sending the snapshots to some other storage, and then send them back, will migrate the metadata onto the vdev? If sending a snapshot from a regular pool to one with a metadata vdev will not populate that vdev, what happens if I do the opposite? Will it fail if the recipient doesn’t have the same vdev structure?

I’m also using the snapshots as a kind of version control/time machine, keeping older versions of files and folders. Worst case I’ll just have to reset the time from which older versions are available, but I’d like to avoid that if possible.

That’s actually a good question.

It’s not really clear, and I would like to know, myself.


This you cannot avoid.

It’s either continue with where all blocks are currently residing, or discard your snapshots in order to gain a (hopeful) performance boost by leveraging and populating the special vdev. (I hope you have redundancy on that vdev!)

That, and deletng the snapshots in between, will definitively put the metadata where you want it.

1 Like

This is good to know.

I suppose it means that replicating to a pool without a special vdev will simply “work”, but keep the metadata on the spinner HDDs. Then if you go in the other direction to a pool that has a special vdev, the metadata will once again be saved on the special vdev.

Alright, so just to make it extremely clear:

  1. Send all snapshots from the old pool to some empty pool on another set of disks.
  2. Delete all snapshots from the old pool.
  3. Send all snapshots back to the old pool.

This will keep the blocks themselves intact (as in size of blocks etc, it won’t start breaking those apart or joining them), but it can and will redistribute them on the receiving end as it sees fit. So if the receiving end has a metadata vdev, it will put metadata (and small blocks) there. Correct?

1 Like