Removing Additional Mirror Disks Added to Existing Mirror Vdev

Hello All,

I have a mirror zpool tank to which I added an additional pair of mirrored disks to an existing vdev instead of adding an additional mirror vdev to the pool.

Is there a way to remove the two disks incorrectly added or will this require a rebuild of the pool?


       NAME             STATE       READ WRITE CKSUM
        tank             ONLINE       0     0     0
          mirror-0       ONLINE       0     0     0
            Drive1       ONLINE       0     0     0
            Drive2       ONLINE       0     0     0
          mirror-1       ONLINE       0     0     0
            Drive1       ONLINE       0     0     0
            Drive2       ONLINE       0     0     0
            Drive3       ONLINE       0     0     0  
            Drive4       ONLINE       0     0     0

In this case, I would like to remove Drive3 and Drive4

Thanks!

1 Like

Take a look at man 8 zpool-detach.

2 Likes

Ok thanks, I’ll try it on a VM

Luckily with mirrors, this is simple.
As pointed out:
zpool detach tank drive5
zpool detach tank drive6

pro tip: when you are trying to add the new disks, first run the command with the -n flag (noop), and it will show you what the config will look like, but not actually change anything. This helps confirm it does what you want before you run it:

zpool add -n tank mirror drive5 drive6

        tank
          mirror-0
            Drive1
            Drive2
          mirror-1
            Drive3
            Drive4
          mirror-2
            Drive5
            Drive6

If you are happy, then remove the -n and it will do it for real.

5 Likes

Thanks for all of the tips everyone. I really appreciate it.

I was able to resolve the issue with the help of the following document.

https://docs.oracle.com/cd/E19253-01/819-5461/gcfhe/index.html

Thanks again for all of the help!!