# Add more drives to ZFS



## atwinix (Dec 6, 2010)

Hello All,

I have set up FreeBSD (AMD64) on a ZFS partition and now I want to add more drives to ZFS.  I have formatted two new drives to have the same layout as the installation drive.

What I now want to do is set up raidz2 on all three drives, but for some reason I can't (given below).


```
FreeBSD_ZFS# zpool status
  pool: tank
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          ad4s1a    ONLINE       0     0     0

errors: No known data errors
```


```
FreeBSD_ZFS# gpart show
=>      63  12582801  ad4  MBR  (6.0G)
        63  12582801    1  freebsd  [active]  (6.0G)

=>       0  12582801  ad4s1  BSD  (6.0G)
         0  10485760      1  freebsd-zfs  (5.0G)
  10485760   2097041      2  freebsd-swap  (1.0G)

=>      63  12582801  ad6  MBR  (6.0G)
        63  12582801    1  freebsd  (6.0G)

=>       0  12582801  ad6s1  BSD  (6.0G)
         0  12582801      1  freebsd-zfs  (6.0G)

=>      63  12582801  ad8  MBR  (6.0G)
        63  12582801    1  freebsd  (6.0G)

=>       0  12582801  ad8s1  BSD  (6.0G)
         0  12582801      1  freebsd-zfs  (6.0G)
```


```
FreeBSD_ZFS# zpool add -f tank raidz2 ad4s1 ad6s1 ad8s1
invalid vdev specification
the following errors must be manually repaired:
/dev/ad4s1 is part of active pool 'tank'
```

Is it possible to do that?  Or should I have created the raidz2 before installing FreeBSD?

Thanks for your help,

atwinix


----------



## SirDice (Dec 6, 2010)

a) you can't use raidz2 on a 3 disk array. It needs at least 4.
b) you can't add drives to an existing vdev


----------



## rabfulton (Dec 6, 2010)

My post linked below has all the information linked on how to move from a single disk to raidz. I succesfully did this myself.

http://forums.freebsd.org/showthread.php?t=15481


----------



## phoenix (Dec 6, 2010)

SirDice said:
			
		

> b) you can't add drives to an existing vdev



You can't add drives to a raidz vdev, but you can add drives to a non-redundant vdev and to a mirror vdev.

`# zpool attach tank ad6s1a ad4s1a`
That will turn the non-redundant vdev "ad4s1a" into a mirror vdev using ad4s1a and ad6s1a.

You can attach drives to mirror vdevs to create 3-way mirrors, 4-way mirrors, etc.


----------



## SirDice (Dec 6, 2010)

phoenix said:
			
		

> You can't add drives to a raidz vdev, but you can add drives to a non-redundant vdev and to a mirror vdev.


Ah, right. I was only thinking of raidz/raidz2.


----------



## DutchDaemon (Dec 6, 2010)

atwinix, got your answer?


----------



## atwinix (Dec 8, 2010)

Yep, kind of. So what I really need to do is plan my File system layout well before I set up raidz2.

Is it possible to change the mountpoint of say /usr to another pool once set?  I can't move /usr/ports to a new pool with new drives?!

Any ideas?


----------



## Savagedlight (Dec 8, 2010)

check out zfs send & zfs receive, and zfs set mountpoint.


----------

