5

Can more physical drives be added to mirror vdevs after a zpool has been created?

For example, if a zpool is created using:

zpool create test_pool mirror /dev/sd0 /dev/sd1 mirror /dev/sd2 /dev/sd3

Can more drives be added to the vdevs to increase their redundancy? That is, can the number of mirrored drives be increased from 1 to 2?

Greg
  • 1,557
  • 5
  • 24
  • 35

1 Answers1

10

Yes. Yes they can.

Something like the following would add to an existing mirror and yield a triple-mirror, given the example above:

zpool attach test_pool /dev/sd0 /dev/sd4
zpool attach test_pool /dev/sd2 /dev/sd5
ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • 2
    To clarify, I meant to add drives to increase redundancy so that the zpool created by `zpool create test_pool mirror /dev/sd0 /dev/sd1 mirror /dev/sd2 /dev/sd3` would be equivalent to `zpool create test_pool mirror /dev/sd0 /dev/sd1 /dev/sd4 mirror /dev/sd2 /dev/sd3 /dev/sd5` after the drives are added, would those commands do that? – Greg Apr 13 '17 at 15:38
  • 2
    Yes, that's what I posted. – ewwhite Apr 13 '17 at 15:44
  • 2
    @Dave This also works if you have basic vdevs (single disks), they can be converted to mirrors (`attach`) and the mirrors can be degraded back to basic vdevs (`detach`). See http://docs.oracle.com/cd/E19253-01/819-5461/6n7ht6qvl/index.html for more examples. – user121391 Apr 18 '17 at 12:32