# How to create mirrored vdevs ?



## verb (Apr 13, 2018)

Hello everyone.
I have decided that it's time to try zfs that's why i installed FreeBSD 10.4 with zfs on 2mirrored 1TB sata disks. After playing with zfs i made the mistake of detaching one of the disks from the pool. Now i have two stripe vdevs :

```
# zpool status
  pool: zpool
 state: ONLINE
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    zpool       ONLINE       0     0     0
      ada0p3    ONLINE       0     0     0
      ada1p3    ONLINE       0     0     0

errors: No known data errors
```
  my question is How to  return to previous state of two mirrored vdevs ???


----------



## phoenix (Apr 16, 2018)

`# zpool attach zpool /dev/ada[B]X[/B]p[B]Y[/B] /dev/ada0p3`

`# zpool attach zpool /dev/ada[B]Q[/B]p[B]R[/B] /dev/ada1p3`

That will convert your two striped vdevs into two mirrored vdevs, consisting of 4 disks total.


----------



## verb (Apr 16, 2018)

Hello phoenix  here is the output:

```
# zpool attach zpool /dev/ada1p3 /dev/ada0p3
invalid vdev specification
use '-f' to override the following errors:
/dev/ada0p3 is part of active pool 'zpool'
```


```
# zpool attach -f zpool  /dev/ada1p3 /dev/ada0p3
invalid vdev specification
the following errors must be manually repaired:
/dev/ada0p3 is part of active pool 'zpool'
```


----------



## VladiBG (Apr 16, 2018)

Read here:
https://www.freebsd.org/doc/handbook/zfs-zpool.html


----------



## SirDice (Apr 16, 2018)

Do I understand correctly ada0p3 and ada1p3 used to be a mirror? You cannot remove any of the two, they're part of a striped set now. And the striped set cannot be broken up without destroying the whole pool.

Maybe a bit late, but don't "play" with important systems. As you now found out it's quite easy to make a mistake. If you want to test with ZFS create a simple VM, add a bunch of (small) virtual disks and play with that.


----------



## phoenix (Apr 17, 2018)

Do you have 4 disks in the system or only 2?

If you only have 2 disks (ada1 and ada3), then there's nothing you can do.  You will either have to add 2 new disks and attach them to the existing ones.  Or, you will need to destroy the pool and create a new pool with a single mirror vdev.

If you have 4 disks, then you need to attach the *new* disks to the existing disks, to convert them into mirror vdevs.


----------

