Extending vdev does not extend zpool space

Before building a production system, I built a test setup on VirtualBox with the following configuration

8GB RAM
2 vCPUs
16 GB Mirrored Boot Drives for TrueNAS Installation
2 Data Drives of 200 GB each
Truenas 13 Core

I went ahead created a zpool with a vdev of 2 data drives of 200 GB each which were mirrored.Everything worked perfectly so far. I went ahead and added 2 addditional drives of 200 GB each and extended the vdev.

But extending the vdev did not increase the total zpool space to 400GB as I though it should. Adding a new vdev with the 2 data drives of 200 GB each did extend the zpool space to 400 GB.

So I have 2 follow up questions I wanted to know

  1. If I have 2 drives in my vdev and they are mirrored and one of those drives go bad, do I lose the entire vdev effectively losing the entire zpool or can I replace the bad drive with a new hdd and get my vdev back to healthy status thus keeping my zpool and by extension all data intact.
  2. Am I supposed do something after extending the vdev to make sure that the zpool space gets recalculated or do I understand this completely incorrectly. I thought extending vdevs with siimilar hdd sizes of 200 GB would in my case give me a total of 400 GB usable space and the remainder of 400 GB would go to mirrors. But that did not happen, so I am completely confused on this.

Any pointers in the right direction would be very helpful.

Regards,
Sab.

If you actually extended the vdev with two drives you ended up with a 4-way mirror, with added resiliency but no extra space. You may check with zpool status

The good news is that you can remove drives to get back to a 2-way mirror and then add a new vdev.

2 Likes

Yes, this is the purpose behind mirrors (or RAIDZ) - as long as the vdev does not lose all redundancy (eg: more than one drive for RAIDZ1, two for RAIDZ2, etc) then you can replace the failed drives with new ones to restore the redundancy. Since you’re testing this out in a virtual machine, you can easily simulate this by deleting a disk from the VirtualBox configuration and observing how the UI shows this.

The latter.

Hi @HoneyBadger , I tried what you suggested and it works. For 2 mirrored drives with 200 GB data disk each, I made one disk offline and detached it. Then I checked via the SMB Share which I created against the zpool whether the data I copied to the disk was still there and it was all there. I then went back and added another data disk of 200GB to the vdev and extended it. As soon as I did it the resilvering process started and the pool status changed from degraded back to online.Thank you so much for your help.

1 Like

Thank you so much for your help @Stux, @etorix I now have the confidence to move forward and build a physical test system and see how things work. Hopefully things will turn out good. Fingers Crossed.

1 Like