ZFS metadata question

Question for the ZFS wizards as I couldnt find confirmation about the metadata vdev. I have a rather old raidz2 zpool with data on 12 x 4tb spinners. I want to add 3 x 2tb m.2 drives in mirror as the metadata vdev.

Will this cause any issues since the pool has existing data?

After I add the meta vdev, will ZFS fill it with pre-existing metadata? Or does it write it as it reads from the pool? How does this work with a pre-existing zpool with data?

My understanding is that there’ll be no issues with existing data, but adding the vdev won’t move over existing stuff - you’ll have to either move them into a folder and then use rsync/cp (my strategy for adding a metadata vdev to my pool was to make a folder in the dataset called tmp, mv the files into it, and then rsync from the tmp folder into the parent, with the --remove-source-files flag - that way, only a little extra space is used since it removes the tmp files as it goes), or use zfs send/recv to a new dataset.

Other than that, I can’t think of any issues I experienced, though I’ve only used special vdevs twice so far.

2 Likes

Ive used them a couple of times, but only with new pools. Didnt know if there would be an issue or not. Its gonna suck to send/recv 25TB of data, but its help a lot since a lot of it is small files that get "ls -lash"ed a lot. Thanks!

I thought this was the best, practicable way?

Its been years since I had to do a send/recv for something like this, so I didnt know if there was a better way yet other than “Hope you have free space” of years past.

1 Like