# RAID1 and RAID0 with 2 hdds



## gogu81 (Feb 14, 2011)

Hello. 

I'm new to the forum and I'm a future "ex-Linux" user. 

I really want to learn FreeBSD because of bad times I've had with Linux, and because my friends directed me to FreeBSD as being a much mature and stable OS. I'm trying to set RAID1-RAID0 on FreeBSD and I fail constantly. For easy understanding I will describe you the way I'm doing it on linux with two hdds. 

On hda being the first disk, I fdisk the following layout: 

hda1 500MB (type software RAID)
hda2 40GB (software RAID)
hda3 20G (software RAID)
hda4 1GB (SWAP)

I dump the layout on disk hdb as hdb1,hdb2,hdb3,hdb4. 

After that I create RAID devices: 
mirror md1 -from hda1/hdb1 mounted on /boot
mirror md2 -from hda2/hdb2 mounted on /
stripe md3 -from hda3/hdb3 mounted on /home

I mount the remaining hda4 and hdb4 as simple swap. On FreeBSD from what I understood so far *gmirror* will work only on entire disk so I cannot do *gmirror* and *gstripe* with just two disks. 

Is there a way to achieve such thing with two hard-disks on FreeBSD? Thank you in advance and I'm very sorry for my bad english.


----------



## SirDice (Feb 14, 2011)

Don't put /boot/ on a seperate partition, it's not going to work.

Why don't you just install FreeBSD the normal way? At least until you understand how and why things are different.


----------



## gogu81 (Feb 14, 2011)

Ok forget boot. The point was to have a mirror and a stripe with two hdds.


----------



## SirDice (Feb 14, 2011)

Why stripe at all? That's utterly useless and will only complicate things.


----------



## gogu81 (Feb 14, 2011)

Because I have two slow hdds and I want to gain speed with internal LAN. I know striping will complicate things because I cannot recover data in case of a failure, but it`s not important data just video and audio for internal streaming. For sensitive data I want to make a mirror. So I have 2 hard-drives and I want to be able to create a mirrored partition for sensitive data and a striped partition for less important data but gaining in speed. I could do that in linux with mdadm. Is there a way in FreeBSD with just two hdds? THX


----------



## dh (Feb 14, 2011)

You can gmirror separate slices/partitions too.


----------



## gogu81 (Feb 14, 2011)

Yes I imagine it's possible but I don't know how. Maybe I'm too stupid for BSD  When I'm trying on a separate partition I get the error: 
	
	



```
gmirror: Can't store metadata on /dev/da0s1f: Operation not permited
```


----------



## dh (Feb 14, 2011)

Make sure those partitions are not mounted!


----------



## gogu81 (Feb 14, 2011)

Thanks! That was the problem it was mounted. I partitioned with auto, forgot to edit fstab and rebooted right after. I told you I`m stupid  Thank you so much.


----------

