# RAID-1 GPT FreeBSD 10 Process doubt.



## klabacita (Feb 4, 2014)

I have been reading and testing how to make my FreeBSD 10 x64 running on RAID-1 during installation. Exist a lot of info, but most of them use the same layout:

```
/boot :q 
swap
/root
```

This works, I had try and is working, my way to set up partitions is using the old layout for me:


```
/boot
/root
/usr
/var
/tmp
/home if I need it.
```

I set up the RAID-1 during the installation following the manuals, like I say, the manuals just use root, my brain told to do this.  Once I set up the partitions, create my other partitions I mention:


```
gpart create -s gpt ada0
gpart create -s gpt ada1
gpart add -s 64k -t freebsd-boot -l boot0 ada0
gpart add -s 64k -t freebsd-boot -l boot1 ada1
gpart add -s 512M -t freebsd-swap -l swap0 ada0
gpart add -s 512M -t freebsd-swap -l swap1 ada1
gpart add -s 1G -t freebsd-ufs -l root0 ada0
gpart add -s 1G -t freebsd-ufs -l root1 ada1
gpart add -s 6G -t freebsd-ufs -l usr0 0ada0
gpart add -s 6G -t freebsd-ufs -l usr1 ada1
gpart add -s 6G -t freebsd-ufs -l var0 ada0
gpart add -s 6G -t freebsd-ufs -l var1 ada1
gpart add -s 512M -t freebsd-ufs -l tmp0 ada0
gpart add -s 512M -t freebsd-ufs -l tmp1 ada1
gpart add -s 512M -t freebsd-ufs -l home0 ada0
gpart add -s 512M -t freebsd-ufs -l home1 ada1
```
 
Latter, create the raid:


```
gmirror label boot /dev/gpt/boot0 /dev/gpt/boot1
gmirror label swap /dev/gpt/swap0 /dev/gpt/swap1
gmirror label root /dev/gpt/root0 /dev/gpt/root1
gmirror label root /dev/gpt/usr0 /dev/gpt/usr1
gmirror label root /dev/gpt/var0 /dev/gpt/var1
gmirror label root /dev/gpt/tmp0 /dev/gpt/tmp1
gmirror label root /dev/gpt/home0 /dev/gpt/home1
```

Some other commands, but exist one important that say that we need to create FS on our root partition and them mount them partition, them I say if we create this one, we need to create for each of our other partitions:


```
newfs -U -L root /dev/mirror/root
mount /dev/mirror/root /mnt
```

Here is my doubt, do I'm on the right track? What I did was:


```
newfs -U -L root /dev/mirror/root
mount /dev/mirror/root /mnt
newfs -U -L usr /dev/mirror/usr
newfs -U -L var /dev/mirror/var
newfs -U -L tmp /dev/mirror/tmp
newfs -U -L home /dev/mirror/home
```

If I'm right, where I mount my other partitions?

Later the manual say that we need to set up fstab for our disk layout, done, exit and let the installation continue, once finish, set up.

/boot/loader.conf

To load the GEOM_GMIRROR_LOAD module at boot, reboot and done.

Did I did this right or is wrong my steps :q 

Thanks.


----------



## wblock@ (Feb 4, 2014)

Which manual are you looking at?  Think about what will happen if one of those disks fails and is replaced.  Seven individual mirrors will all start to rebuild at the same time.  Head contention will tie up those disks for a long, long time.

How big are the disks?  If they are 2T or less, use one mirror for the whole drive.  The Handbook shows how: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html.


----------



## klabacita (Feb 4, 2014)

http://www.ateamsystems.com/blog/Installing-FreeBSD-9-gmirror-GPT-partitions-raid-1

This is for a spam filter, nothing extreme, 500GB but u can see I don't need big size partitions.


----------



## usdmatt (Feb 4, 2014)

Regarding the rebuild times, I came across the same problem a few years back. I got caught out by not being able to gmirror the entire disks with gpt, and ended up creating 3 partitions, mirrored separately.

I tested a rebuild and it was almost incapable of doing it. It probably would of finished but was taking 10-20x longer than it should and was probably killing the disks in the process. In the end I found the gmirror option to turn off automatic rebuild. Of course this means that if a disk ever fails in this system, I have to manually start the rebuild on partition 1, wait for it to finish, then start on 2, etc.

Part of the reason I just use ZFS for all my mirrors now. It's a bit of a heavyweight for some applications but it's so much easier to manage and if I decide I want a separate /home file system (or anything else), I can create it whenever I want.


----------

