Adding gmirror to an existing installation

2009-05-13 15:32:14来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


This article describes how I created a RAID-1 cluster on my
[url=javascript:;]FreeBSD[/url]
7.0-STABLE box using
[url=javascript:;]gmirror[/url]
.
Back in March, I bought an AMD Phenom(tm) and starting putting it together. You can read more about the box and the dual monitor setup here:
Using two monitors with X.org
Building an AMD Phenom box
The goal for this box is two fold:
workstation
[url=javascript:;]jail[/url]
server
I will use the box as a workstation for developing FreshPorts, writing articles for FreeBSD Diary, and everyday use. The box has plenty of spare cycles and extra disk space. I will put that to good use by creating several jails on it. The various jails will perform these functions:
Regression testing for Bacula
Downloading database backups and test loading them (FreshPorts, BSDCan, etc)
That may not sound like much, but there will be at least 8 jails on this server. Bacula regression testing will be against both
[url=javascript:;]MySQL[/url]
and PostgreSQL and several versions of each of those databases.
Today I will be adding RAID-1 to this server. Software RAID. I will make use of the FreeBSD gmirror utility.


FreeBSD is already installed
On this system, FreeBSD is already installed. Usually, one sets up gmirror when installing the base system. In this case, I will boot from a FreeBSD 7.0-RELEASE LIVE CD and use that to setup the RAID-1 cluster.

Identify the HDD
When setting up gmirror, you will tell it to use one HDD as the master. The other will be a slave. These are not the correct technological terms, but they will do for my purposes. The critical part of this process is making sure that you select the correct HDD for the master. If not, you will lose your installed system.
My cunning plan to correctly identify the HDD was simple. Boot from the HDD and create a distinctly unique filename in the
[url=javascript:;]root[/url]
directory. Then boot from the live CD, mount the HDD, and find the file. Simple. What could go wrong?


Starting the live CD
The ISO image I downloaded was 7.0-RELEASE-amd64-livefs.iso. The livefs part is the key. You boot this like any other CD. From the main menu, select Fixit, then CDROM/DVD. You should then see a Fixit# prompt.


Find the right HDD
Using dmesg I found I had two HDD mounted, ad4 and ad6. Let's try mounting them and see what I can find:
Fixit# mount /dev/ad4s1 /mnt
Fixit# ls /mnt
.                               home
..                              lib

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:How To Add A Second Hard Disk

下一篇:gmirror - recovering from a failed HDD