⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 raid.html

📁 FreeBSD安装说明概述 FreeBSD 提供了一个以文字为主
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>RAID</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手册" href="index.html" /><link rel="UP" title="Storage" href="disks.html" /><link rel="PREVIOUS" title="Adding Disks" href="disks-adding.html" /><link rel="NEXT" title="Creating and Using Optical Media (CDs & DVDs)"href="creating-cds.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD 使用手册</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="disks-adding.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 12. Storage</td><td width="10%" align="right" valign="bottom"><a href="creating-cds.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="RAID" name="RAID">12.4. RAID</a></h1><div class="SECT2"><h2 class="SECT2"><a id="RAID-SOFT" name="RAID-SOFT">12.4.1. Software RAID</a></h2><div class="SECT3"><h3 class="SECT3"><a id="CCD" name="CCD">12.4.1.1. Concatenated Disk Driver (CCD)Configuration</a></h3><i class="AUTHORGROUP"><span class="CONTRIB">Original work by</span> ChristopherShumway.</i> <i class="AUTHORGROUP"><span class="CONTRIB">Revised by</span> JimBrown.</i> <p>When choosing a mass storage solution the most important factors to consider arespeed, reliability, and cost. It is rare to have all three in balance; normally a fast,reliable mass storage device is expensive, and to cut back on cost either speed orreliability must be sacrificed.</p><p>In designing the system described below, cost was chosen as the most important factor,followed by speed, then reliability. Data transfer speed for this system is ultimatelyconstrained by the network. And while reliability is very important, the CCD drivedescribed below serves online data that is already fully backed up on CD-R's and caneasily be replaced.</p><p>Defining your own requirements is the first step in choosing a mass storage solution.If your requirements prefer speed or reliability over cost, your solution will differfrom the system described in this section.</p><div class="SECT4"><h4 class="SECT4"><a id="CCD-INSTALLHW" name="CCD-INSTALLHW">12.4.1.1.1. Installing theHardware</a></h4><p>In addition to the IDE system disk, three Western Digital 30GB, 5400 RPM IDE disksform the core of the CCD disk described below providing approximately 90GB of onlinestorage. Ideally, each IDE disk would have its own IDE controller and cable, but tominimize cost, additional IDE controllers were not used. Instead the disks wereconfigured with jumpers so that each IDE controller has one master, and one slave.</p><p>Upon reboot, the system BIOS was configured to automatically detect the disksattached. More importantly, FreeBSD detected them on reboot:</p><pre class="PROGRAMLISTING">ad0: 19574MB &lt;WDC WD205BA&gt; [39770/16/63] at ata0-master UDMA33ad1: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata0-slave UDMA33ad2: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata1-master UDMA33ad3: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata1-slave UDMA33</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> If FreeBSD does not detect all the disks, ensure that you have jumperedthem correctly. Most IDE drives also have a ``Cable Select'' jumper. This is <spanclass="emphasis"><i class="EMPHASIS">not</i></span> the jumper for the master/slaverelationship. Consult the drive documentation for help in identifying the correctjumper.</p></blockquote></div><p>Next, consider how to attach them as part of the file system. You should research both<span class="CITEREFENTRY"><span class="REFENTRYTITLE">vinum</span>(8)</span> (<ahref="vinum-vinum.html">Chapter 13</a>) and <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">ccd</span>(4)</span>. In this particular configuration, <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span> was chosen.</p></div><div class="SECT4"><h4 class="SECT4"><a id="CCD-SETUP" name="CCD-SETUP">12.4.1.1.2. Setting Up theCCD</a></h4><p>The driver <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span>allows you to take several identical disks and concatenate them into one logical filesystem. In order to use <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">ccd</span>(4)</span>, you need a kernel with <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span> support built in.Add this line to your kernel configuration file, rebuild, and reinstall the kernel:</p><pre class="PROGRAMLISTING">pseudo-device   ccd     4</pre><p>On 5.X systems, you have to use instead the following line:</p><pre class="PROGRAMLISTING">device   ccd</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> In FreeBSD&nbsp;5.X, it is not necessary to specify a number of <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span> devices, as the<span class="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span> device driveris now self-cloning -- new device instances will automatically be created on demand.</p></blockquote></div><p>The <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span>support can also be loaded as a kernel loadable module in FreeBSD 3.0 or later.</p><p>To set up <span class="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span>,you must first use <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">disklabel</span>(8)</span> to label the disks:</p><pre class="PROGRAMLISTING">disklabel -r -w ad1 autodisklabel -r -w ad2 autodisklabel -r -w ad3 auto</pre><p>This creates a disklabel for <tt class="DEVICENAME">ad1c</tt>, <ttclass="DEVICENAME">ad2c</tt> and <tt class="DEVICENAME">ad3c</tt> that spans the entiredisk.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Since FreeBSD&nbsp;5.1-RELEASE, the <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">bsdlabel</span>(8)</span> utility replaces the old <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">disklabel</span>(8)</span> program. With<span class="CITEREFENTRY"><span class="REFENTRYTITLE">bsdlabel</span>(8)</span> a numberof obsolete options and parameters have been retired; in the examples above the option<var class="OPTION">-r</var> should be removed. For more information, please refer to the<span class="CITEREFENTRY"><span class="REFENTRYTITLE">bsdlabel</span>(8)</span> manualpage.</p></blockquote></div><p>The next step is to change the disk label type. You can use <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">disklabel</span>(8)</span> to edit thedisks:</p><pre class="PROGRAMLISTING">disklabel -e ad1disklabel -e ad2disklabel -e ad3</pre><p>This opens up the current disk label on each disk with the editor specified by the <ttclass="ENVAR">EDITOR</tt> environment variable, typically <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">vi</span>(1)</span>.</p><p>An unmodified disk label will look something like this:</p><pre class="PROGRAMLISTING">8 partitions:#        size   offset    fstype   [fsize bsize bps/cpg]  c: 60074784        0    unused        0     0     0   # (Cyl.    0 - 59597)</pre><p>Add a new <var class="LITERAL">e</var> partition for <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">ccd</span>(4)</span> to use. This can usually be copied from the<var class="LITERAL">c</var> partition, but the <var class="OPTION">fstype</var> <spanclass="emphasis"><i class="EMPHASIS">must</i></span> be <kbdclass="USERINPUT">4.2BSD</kbd>. The disk label should now look something like this:</p><pre class="PROGRAMLISTING">8 partitions:#        size   offset    fstype   [fsize bsize bps/cpg]  c: 60074784        0    unused        0     0     0   # (Cyl.    0 - 59597)  e: 60074784        0    4.2BSD        0     0     0   # (Cyl.    0 - 59597)</pre></div><div class="SECT4"><h4 class="SECT4"><a id="CCD-BUILDINGFS" name="CCD-BUILDINGFS">12.4.1.1.3. Building theFile System</a></h4><p>The device node for <tt class="DEVICENAME">ccd0c</tt> may not exist yet, so to createit, perform the following commands:</p><pre class="PROGRAMLISTING">cd /devsh MAKEDEV ccd0</pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> In FreeBSD 5.0, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">devfs</span>(5)</span> will automatically manage device nodes in<tt class="FILENAME">/dev</tt>, so use of <tt class="COMMAND">MAKEDEV</tt> is notnecessary.</p></blockquote></div><p>Now that you have all of the disks labeled, you must build the <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span>. To do that, use<span class="CITEREFENTRY"><span class="REFENTRYTITLE">ccdconfig</span>(8)</span>, withoptions similar to the following:</p><pre class="PROGRAMLISTING">ccdconfig ccd0<a id="CO-CCD-DEV" name="CO-CCD-DEV"><img src="./imagelib/callouts/1.png"hspace="0" vspace="0" border="0" alt="(1)" /></a> 32<a id="CO-CCD-INTERLEAVE"name="CO-CCD-INTERLEAVE"><img src="./imagelib/callouts/2.png" hspace="0" vspace="0"border="0" alt="(2)" /></a> 0<a id="CO-CCD-FLAGS" name="CO-CCD-FLAGS"><imgsrc="./imagelib/callouts/3.png" hspace="0" vspace="0" border="0"alt="(3)" /></a> /dev/ad1e<a id="CO-CCD-DEVS" name="CO-CCD-DEVS"><imgsrc="./imagelib/callouts/4.png" hspace="0" vspace="0" border="0"alt="(4)" /></a> /dev/ad2e /dev/ad3e</pre><p>The use and meaning of each option is shown below:</p><div class="CALLOUTLIST"><dl compact="COMPACT"><dt><a href="raid.html#CO-CCD-DEV"><img src="./imagelib/callouts/1.png" hspace="0"vspace="0" border="0" alt="(1)" /></a></dt><dd>The first argument is the device to configure, in this case, <tt

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -