If you want to make a low-cost server with a RAID capabilities and don’t want to invest in a hardware RAID solution, gmirror is a good choice. You can use it to add a disk and create a mirror even on your existing server running FreeBSD 6 or 7.
In my example I have at start an 8 GB hard disk where I installed FreeBSD 7 (/dev/ad0).
The first thing to do is to add another hard disk with the same size (or bigger than the existing one) and boot the OS.
Now you have to create the mirror. For this you can use:
gmirror label -v -b round-robin gm0 /dev/ad0
If /dev/ad0 is the disk where the OS is installed (like in our example) then you will get an error because you are not allowed to write the metadata on a disk mounted for write. To solve this you must use sysctl:
sysctl kern.geom.debugflags=16
Read the rest of this entry »