* Properly tab ccd section (it is now two levels deeper)

* Let emacs wrap lines to appropriate width

Whitespace only change.
This commit is contained in:
Chern Lee 2001-09-13 19:25:38 +00:00
parent 5886c4fe84
commit f93099595b
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10690

View file

@ -1,7 +1,7 @@
<!--
The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml,v 1.60 2001/09/09 14:34:18 dd Exp $
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/disks/chapter.sgml,v 1.61 2001/09/12 23:44:49 chern Exp $
-->
<chapter id="disks">
@ -849,139 +849,143 @@ scsibus1:
<sect3 id="ccd">
<sect3info>
<authorgroup>
<author>
<firstname>Christopher</firstname>
<surname>Shumway</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Valentino</firstname>
<surname>Vaschetto</surname>
<contrib>Marked up by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Christopher</firstname>
<surname>Shumway</surname>
<contrib>Written by </contrib>
</author>
</authorgroup>
<authorgroup>
<author>
<firstname>Valentino</firstname>
<surname>Vaschetto</surname>
<contrib>Marked up by </contrib>
</author>
</authorgroup>
</sect3info>
<title>ccd (Concatenated Disk Configuration)</title>
<title>ccd (Concatenated Disk Configuration)</title>
<para>It seems like today everyone has a collection of multimedia
files. Everything from mp3's to video clips. I've converted most
of my audio CDROM collection to mp3's so I can have all of my music
in one centralized location, and not have to hunt down the audio CD
with that one song I got stuck in my head. The problem I was faced
with is where to store all these files?</para>
<para>It seems like today everyone has a collection of
multimedia files. Everything from mp3's to video clips. I've
converted most of my audio CDROM collection to mp3's so I can
have all of my music in one centralized location, and not have
to hunt down the audio CD with that one song I got stuck in my
head. The problem I was faced with is where to store all
these files?</para>
<para>When choosing a mass storage solution, the most important
factors to consider are speed, reliability, and cost. It is very
rare to have all three in favor, normally a fast, reliable mass
storage device is expensive, and to cut back on cost either speed or
reliability must be sacrificed. In designing my system, I ranked
the requirements by most favorable to least favorable. In this
situation, cost was the biggest factor. I needed a lot of storage
for a reasonable price. The next factor, speed, is not quite as
important, since most of the usage would be over a one hundred
megabit switched Ethernet, and that would most likely be the
bottleneck. The ability to spread the file input/output operations
out over several disks would be more than enough speed for this
network. Finally, the consideration of reliability was an easy one
to answer. All of the data being put on this mass storage device
was already backed up on CD-R's. This drive was primarily here for
online live storage for easy access, so if a drive went bad, I could
just replace it, rebuild the filesystem, and copy back the data from
CD-R's.</para>
<para>When choosing a mass storage solution, the most important
factors to consider are speed, reliability, and cost. It is very
rare to have all three in favor, normally a fast, reliable mass
storage device is expensive, and to cut back on cost either speed
or reliability must be sacrificed. In designing my system, I
ranked the requirements by most favorable to least favorable. In
this situation, cost was the biggest factor. I needed a lot of
storage for a reasonable price. The next factor, speed, is not
quite as important, since most of the usage would be over a one
hundred megabit switched Ethernet, and that would most likely be
the bottleneck. The ability to spread the file input/output
operations out over several disks would be more than enough speed
for this network. Finally, the consideration of reliability was
an easy one to answer. All of the data being put on this mass
storage device was already backed up on CD-R's. This drive was
primarily here for online live storage for easy access, so if a
drive went bad, I could just replace it, rebuild the filesystem,
and copy back the data from CD-R's.</para>
<para>To sum it up, I need something that will give
me the most amount of storage space for my money. The cost of large
IDE disks are cheap these days. I found a place that was selling
Western Digital 30.7gb 5400 RPM IDE disks for about one-hundred and
thirty US dollars. I bought three of them, giving me approximately
ninety gigabytes of online storage.</para>
<para>To sum it up, I need something that will give me the most
amount of storage space for my money. The cost of large IDE disks
are cheap these days. I found a place that was selling Western
Digital 30.7gb 5400 RPM IDE disks for about one-hundred and thirty
US dollars. I bought three of them, giving me approximately
ninety gigabytes of online storage.</para>
<sect4 id="ccd-installhw">
<title>Installing the Hardware</title>
<title>Installing the Hardware</title>
<para>I installed the hard drives in a system that already had
one IDE disk in as the system disk. The ideal solution would be
for each IDE disk to have its own IDE controller and cable, but
without fronting more costs to acquire a dual IDE controller
this wouldn't be a possibility. So, I jumpered two disks as
slaves, and one as master. One went on the first IDE controller
as a slave to the system disk, and the other two where
slave/master on the secondary IDE controller.</para>
<para>I installed the hard drives in a system that already
had one IDE disk in as the system disk. The ideal solution
would be for each IDE disk to have its own IDE controller
and cable, but without fronting more costs to acquire a dual
IDE controller this wouldn't be a possibility. So, I
jumpered two disks as slaves, and one as master. One went
on the first IDE controller as a slave to the system disk,
and the other two where slave/master on the secondary IDE
controller.</para>
<para>Upon reboot, the system BIOS was configured to
automatically detect the disks attached. More importantly,
FreeBSD detected them on reboot:</para>
<para>Upon reboot, the system BIOS was configured to
automatically detect the disks attached. More importantly,
FreeBSD detected them on reboot:</para>
<programlisting>ad0: 19574MB &lt;WDC WD205BA&gt; [39770/16/63] at ata0-master UDMA33
<programlisting>ad0: 19574MB &lt;WDC WD205BA&gt; [39770/16/63] at ata0-master UDMA33
ad1: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata0-slave UDMA33
ad2: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata1-master UDMA33
ad3: 29333MB &lt;WDC WD307AA&gt; [59598/16/63] at ata1-slave UDMA33</programlisting>
<para>At this point, if FreeBSD doesn't detect the disks, be
sure that you have jumpered them correctly. I have heard
numerous reports with problems using cable select instead of
true slave/master configuration.</para>
<para>At this point, if FreeBSD doesn't detect the disks, be
sure that you have jumpered them correctly. I have heard
numerous reports with problems using cable select instead of
true slave/master configuration.</para>
<para>The next consideration was how to attach them as part of the
filesystem. I did a little research on
<ulink url="http://www.vinumvm.org">&man.vinum.8;</ulink> and FreeBSD's &man.ccd.4;.
In this particular configuration, &man.ccd.4; appeared to be a better
choice mainly because it has fewer parts. Less parts tends to
indicate less chance of breakage. Vinum appears to be a bit of an
overkill for my needs.</para>
<para>The next consideration was how to attach them as part of
the filesystem. I did a little research on <ulink
url="http://www.vinumvm.org">&man.vinum.8;</ulink> and FreeBSD's
&man.ccd.4;. In this particular configuration, &man.ccd.4;
appeared to be a better choice mainly because it has fewer
parts. Less parts tends to indicate less chance of breakage.
Vinum appears to be a bit of an overkill for my needs.</para>
</sect4>
<sect4 id="ccd-setup">
<title>Setting up the CCD</title>
<title>Setting up the CCD</title>
<para><application>CCD</application> allows me to take several
identical disks and
concatenate them into one logical filesystem. In order to use
<application>ccd</application>, I need a kernel with
<application>ccd</application> support built into it. I added
this line to my kernel configuration file and rebuilt the
kernel:</para>
<para><application>CCD</application> allows me to take
several identical disks and concatenate them into one
logical filesystem. In order to use
<application>ccd</application>, I need a kernel with
<application>ccd</application> support built into it. I
added this line to my kernel configuration file and rebuilt
the kernel:</para>
<programlisting>pseudo-device ccd 4</programlisting>
<programlisting>pseudo-device ccd 4</programlisting>
<para><application>ccd</application> support can also be loaded as a
kernel loadable module in FreeBSD 4.0 or later.</para>
<para><application>ccd</application> support can also be
loaded as a kernel loadable module in FreeBSD 4.0 or
later.</para>
<para>To set up <application>ccd</application>, first I need to
disklabel the disks. Here's how I disklabeled them:</para>
<para>To set up <application>ccd</application>, first I need
to disklabel the disks. Here's how I disklabeled
them:</para>
<programlisting>disklabel -r -w ad1 auto
<programlisting>disklabel -r -w ad1 auto
disklabel -r -w ad2 auto
disklabel -r -w ad3 auto</programlisting>
<para>This created a disklabel ad1c, ad2c and ad3c that spans
the entire disk.</para>
<para>This created a disklabel ad1c, ad2c and ad3c that
spans the entire disk.</para>
<para>The next step is to change the disklabel type. To do that
I had to edit the disklabel:</para>
<para>The next step is to change the disklabel type. To do
that I had to edit the disklabel:</para>
<programlisting>disklabel -e ad1
<programlisting>disklabel -e ad1
disklabel -e ad2
disklabel -e ad3</programlisting>
<para>This opened up the current disklabel on each disk
respectively in whatever editor the <envar>EDITOR</envar> environment variable
was set to, in my case, &man.vi.1;. Inside the editor I had a
section like this:</para>
<para>This opened up the current disklabel on each disk
respectively in whatever editor the <envar>EDITOR</envar>
environment variable was set to, in my case, &man.vi.1;.
Inside the editor I had a section like this:</para>
<programlisting>8 partitions:
<programlisting>8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 60074784 0 unused 0 0 0 # (Cyl. 0 - 59597)</programlisting>
<para>I need to add a new "e" partition for &man.ccd.4; to use. This
can be a copy of the "c" partition. Once I was done, my
disklabel should look like this:</para>
<para>I need to add a new "e" partition for &man.ccd.4; to
use. This can be a copy of the "c" partition. Once I was done,
my disklabel should look like this:</para>
<programlisting>8 partitions:
<programlisting>8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 60074784 0 unused 0 0 0 # (Cyl. 0 - 59597)
e: 60074784 0 unused 0 0 0 # (Cyl. 0 - 59597)</programlisting>
@ -989,71 +993,74 @@ disklabel -e ad3</programlisting>
</sect4>
<sect4 id="ccd-buildingfs">
<title>Building the Filesystem</title>
<title>Building the Filesystem</title>
<para>Now that I have all of the disks labeled, I needed to
build the <application>ccd</application>. To do that, I used a
utility called
&man.ccdconfig.8;. <command>ccdconfig</command> takes several arguments, the first
argument being the device to configure, in this case,
<devicename>/dev/ccd0c</devicename>. The device node for
<devicename>ccd0c</devicename> may not exist yet, so to create
it, perform the following commands:</para>
<para>Now that I have all of the disks labeled, I needed to
build the <application>ccd</application>. To do that, I
used a utility called &man.ccdconfig.8;.
<command>ccdconfig</command> takes several arguments, the
first argument being the device to configure, in this case,
<devicename>/dev/ccd0c</devicename>. The device node for
<devicename>ccd0c</devicename> may not exist yet, so to
create it, perform the following commands:</para>
<programlisting>cd /dev
<programlisting>cd /dev
sh MAKEDEV ccd0</programlisting>
<para>The next argument <command>ccdconfig</command> expects is the interleave
for the filesystem. The interleave defines the size of a
stripe in disk blocks, normally five hundred and twelve bytes.
So, an interleave of thirty-two would be sixteen thousand
three hundred and eighty-four bytes.</para>
<para>The next argument <command>ccdconfig</command> expects
is the interleave for the filesystem. The interleave
defines the size of a stripe in disk blocks, normally five
hundred and twelve bytes. So, an interleave of thirty-two
would be sixteen thousand three hundred and eighty-four
bytes.</para>
<para>After the interleave comes the flags for <command>ccdconfig</command>. If
you want to enable drive mirroring, you can specify a flag
here. In this configuration, I am not mirroring the
<application>ccd</application>, so I left it as zero.</para>
<para>After the interleave comes the flags for
<command>ccdconfig</command>. If you want to enable drive
mirroring, you can specify a flag here. In this
configuration, I am not mirroring the
<application>ccd</application>, so I left it as zero.</para>
<para>The final arguments to <command>ccdconfig</command> are the devices to place
into the array. Putting it all together I get this
command:</para>
<para>The final arguments to <command>ccdconfig</command>
are the devices to place into the array. Putting it all
together I get this command:</para>
<programlisting>ccdconfig ccd0 32 0 /dev/ad1e /dev/ad2e /dev/ad3e</programlisting>
<programlisting>ccdconfig ccd0 32 0 /dev/ad1e /dev/ad2e /dev/ad3e</programlisting>
<para>This configures the <application>ccd</application>.
I can now &man.newfs.8; the filesystem.</para>
<para>This configures the <application>ccd</application>.
I can now &man.newfs.8; the filesystem.</para>
<programlisting>newfs /dev/ccd0c</programlisting>
<programlisting>newfs /dev/ccd0c</programlisting>
</sect4>
<sect4 id="ccd-auto">
<title>Making It All Automagic</title>
<title>Making It All Automagic</title>
<para>Finally, if I want to be able to mount the
<application>ccd</application>, I need to
configure it first. I write out my current configuration to
<filename>/etc/ccd.conf</filename> using the following command:</para>
<para>Finally, if I want to be able to mount the
<application>ccd</application>, I need to
configure it first. I write out my current configuration to
<filename>/etc/ccd.conf</filename> using the following command:</para>
<programlisting>ccdconfig -g &gt; /etc/ccd.conf</programlisting>
<programlisting>ccdconfig -g &gt; /etc/ccd.conf</programlisting>
<para>When I reboot, the script <command>/etc/rc</command> runs
<command>ccdconfig -C</command> if /etc/ccd.conf exists. This
automatically configures the <application>ccd</application>
so it can be mounted.</para>
<para>When I reboot, the script <command>/etc/rc</command>
runs <command>ccdconfig -C</command> if /etc/ccd.conf
exists. This automatically configures the
<application>ccd</application> so it can be mounted.</para>
<para>If you are booting into single user mode, before you can
<command>mount</command> the <application>ccd</application>, you
need to issue the following command to configure the
array:</para>
<para>If you are booting into single user mode, before you can
<command>mount</command> the <application>ccd</application>, you
need to issue the following command to configure the
array:</para>
<programlisting>ccdconfig -C</programlisting>
<programlisting>ccdconfig -C</programlisting>
<para>Then, we need an entry for the <application>ccd</application>
in <filename>/etc/fstab</filename> so it
will be mounted at boot time.</para>
<para>Then, we need an entry for the
<application>ccd</application> in
<filename>/etc/fstab</filename> so it will be mounted at
boot time.</para>
<programlisting>/dev/ccd0c /media ufs rw 2 2</programlisting>
<programlisting>/dev/ccd0c /media ufs rw 2 2</programlisting>
</sect4>
</sect3>