# Setting up a software RAID 5 in FreeBSD



## jigglywiggly (Dec 20, 2009)

Ok, so I have 300gig hd I just want for the OS. Then I have 3x1.5tb hds. I want them to be in RAID 5. (Every hd in the system is SATA)
How should I go about doing this? I wanted to use mdadm, except that's a Linux thing.

1. How would I go about setting it up with the different software RAID options?
2. How can I run smarttests? And if I install gnome on this FreeBSD box, is there any gui utility to use?
3. How will it alert me when a hard drive is failing?


----------



## SirDice (Dec 20, 2009)

1) http://www.schmut.com/howto/freebsd-software-raid-howto
2) RAID is irrelevant to SMART
3) keep an eye on /var/log/messages or configure smartmon to email you.


----------



## dennylin93 (Dec 22, 2009)

I'd recommend using ZFS with RAID-Z (the equivalent of RAID 5). It's easy to use and ZFS has a lot of powerful features, although some tuning may be required.

Label the disks with glabel():

```
# glabel label disk1 /dev/ad0
# glabel label disk2 /dev/ad1
# glabel label disk3 /dev/ad2
```

Then create a pool:

```
# zpool create tank raidz1 label/disk1 label/disk2 label/disk3
```


----------



## SirDice (Dec 22, 2009)

dennylin93 said:
			
		

> I'd recommend using ZFS with RAID-Z (the equivalent of RAID 5).


Only if you have a decent machine with plenty of memory (>2GB).


----------



## jigglywiggly (Dec 23, 2009)

I tried glabel label disk1 /dev/ad14 and it said : Operation not permitted.


----------



## vivek (Dec 23, 2009)

You must be root and must use /dev/XYZ according to your setup.


----------



## jigglywiggly (Dec 23, 2009)

Yes I am root, and ad14 is the hd I want to use.


----------



## jigglywiggly (Dec 23, 2009)

Ok I did, sysctl kern.geom.debugflags=16
I will continue to see what happens.

EDIT: I did that, then I did: zpool create tank raidz1 label/disk1 label/disk2 label/disk3
And it spits out: cannot open 'label/disk3' : no such GEOM provider
must be full path or shorthand device name.


I then did zpool create tank raidz ad8 ad10 ad14 and it accepted it. Though nothing happened, is something supposed to happen?


----------



## dennylin93 (Dec 25, 2009)

SirDice said:
			
		

> Only if you have a decent machine with plenty of memory (>2GB).



I forgot about the RAM limitations . ZFS performance is also better on amd64.

Try using the complete path, like /dev/label/disk1. It should work if the disks are labeled properly.

Nothing pops up by default when a pool is created. Try `# zpool status` to look at the pools.


----------

