Whitespace only: Fix several whitespace issues in Handbook's 'geom' chapter
This commit is contained in:
parent
237405f64b
commit
f195ab2200
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=33302
1 changed files with 99 additions and 98 deletions
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
<para>This chapter covers the use of disks under the GEOM
|
<para>This chapter covers the use of disks under the GEOM
|
||||||
framework in &os;. This includes the major <acronym
|
framework in &os;. This includes the major <acronym
|
||||||
role="Redundant Array of Inexpensive Disks">RAID</acronym>
|
role="Redundant Array of Inexpensive Disks">RAID</acronym>
|
||||||
control utilities which use the framework for configuration.
|
control utilities which use the framework for configuration.
|
||||||
This chapter will not go into in depth discussion on how GEOM
|
This chapter will not go into in depth discussion on how GEOM
|
||||||
handles or controls I/O, the underlying subsystem, or code.
|
handles or controls I/O, the underlying subsystem, or code.
|
||||||
|
@ -50,12 +50,11 @@
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>How to use the base utilities to configure, maintain,
|
<para>How to use the base utilities to configure, maintain,
|
||||||
and manipulate the various <acronym>RAID</acronym>
|
and manipulate the various <acronym>RAID</acronym> levels.</para>
|
||||||
levels.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>How to mirror, stripe, encrypt, and remotely connect disk
|
<para>How to mirror, stripe, encrypt, and remotely connect disk
|
||||||
devices through GEOM.</para>
|
devices through GEOM.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
@ -93,19 +92,19 @@
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="GEOM-striping">
|
<sect1 id="GEOM-striping">
|
||||||
<sect1info>
|
<sect1info>
|
||||||
<authorgroup>
|
<authorgroup>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Tom</firstname>
|
<firstname>Tom</firstname>
|
||||||
<surname>Rhodes</surname>
|
<surname>Rhodes</surname>
|
||||||
<contrib>Written by </contrib>
|
<contrib>Written by </contrib>
|
||||||
</author>
|
</author>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Murray</firstname>
|
<firstname>Murray</firstname>
|
||||||
<surname>Stokely</surname>
|
<surname>Stokely</surname>
|
||||||
</author>
|
</author>
|
||||||
</authorgroup>
|
</authorgroup>
|
||||||
</sect1info>
|
</sect1info>
|
||||||
|
|
||||||
<title>RAID0 - Striping</title>
|
<title>RAID0 - Striping</title>
|
||||||
|
|
||||||
|
@ -134,90 +133,92 @@
|
||||||
the same size, since I/O requests are interleaved to read or
|
the same size, since I/O requests are interleaved to read or
|
||||||
write to multiple disks in parallel.</para>
|
write to multiple disks in parallel.</para>
|
||||||
|
|
||||||
<mediaobject>
|
<mediaobject>
|
||||||
<imageobject>
|
<imageobject>
|
||||||
<imagedata fileref="geom/striping" align="center">
|
<imagedata fileref="geom/striping" align="center">
|
||||||
</imageobject>
|
</imageobject>
|
||||||
|
|
||||||
<textobject>
|
<textobject>
|
||||||
<phrase>Disk Striping Illustration</phrase>
|
<phrase>Disk Striping Illustration</phrase>
|
||||||
</textobject>
|
</textobject>
|
||||||
</mediaobject>
|
</mediaobject>
|
||||||
|
|
||||||
<procedure>
|
<procedure>
|
||||||
<title>Creating a stripe of unformatted ATA disks</title>
|
<title>Creating a stripe of unformatted ATA disks</title>
|
||||||
|
|
||||||
<step><para>Load the <filename>geom_stripe.ko</filename>
|
<step>
|
||||||
module:</para>
|
<para>Load the <filename>geom_stripe.ko</filename>
|
||||||
|
module:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>kldload geom_stripe</userinput></screen>
|
<screen>&prompt.root; <userinput>kldload geom_stripe</userinput></screen>
|
||||||
</step>
|
|
||||||
|
|
||||||
<step><para>Ensure that a suitable mount point exists. If this
|
|
||||||
volume will become a root partition, then temporarily use
|
|
||||||
another mount point such as <filename
|
|
||||||
class="directory">/mnt</filename>:</para>
|
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>mkdir /mnt</userinput></screen>
|
|
||||||
</step>
|
</step>
|
||||||
|
|
||||||
<step><para>Determine the device names for the disks which will
|
<step>
|
||||||
be striped, and create the new stripe device. For example,
|
<para>Ensure that a suitable mount point exists. If this
|
||||||
to stripe two unused and unpartitioned <acronym>ATA</acronym> disks,
|
volume will become a root partition, then temporarily use
|
||||||
for example <filename>/dev/ad2</filename> and
|
another mount point such as <filename
|
||||||
<filename>/dev/ad3</filename>:</para>
|
class="directory">/mnt</filename>:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>gstripe label -v st0 /dev/ad2 /dev/ad3</userinput>
|
<screen>&prompt.root; <userinput>mkdir /mnt</userinput></screen>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step>
|
||||||
|
<para>Determine the device names for the disks which will
|
||||||
|
be striped, and create the new stripe device. For example,
|
||||||
|
to stripe two unused and unpartitioned <acronym>ATA</acronym> disks,
|
||||||
|
for example <filename>/dev/ad2</filename> and
|
||||||
|
<filename>/dev/ad3</filename>:</para>
|
||||||
|
|
||||||
|
<screen>&prompt.root; <userinput>gstripe label -v st0 /dev/ad2 /dev/ad3</userinput>
|
||||||
Metadata value stored on /dev/ad2.
|
Metadata value stored on /dev/ad2.
|
||||||
Metadata value stored on /dev/ad3.
|
Metadata value stored on /dev/ad3.
|
||||||
Done.</screen>
|
Done.</screen>
|
||||||
|
|
||||||
</step>
|
</step>
|
||||||
|
|
||||||
<step><para>Write a standard label, also known as a partition
|
<step>
|
||||||
table, on the new volume and install the default
|
<para>Write a standard label, also known as a partition
|
||||||
bootstrap code:</para>
|
table, on the new volume and install the default
|
||||||
|
bootstrap code:</para>
|
||||||
<screen>&prompt.root; <userinput>bsdlabel -wB /dev/stripe/st0</userinput></screen>
|
|
||||||
|
|
||||||
|
<screen>&prompt.root; <userinput>bsdlabel -wB /dev/stripe/st0</userinput></screen>
|
||||||
</step>
|
</step>
|
||||||
|
|
||||||
<step><para>This process should have created two other devices
|
<step>
|
||||||
in the <filename class="directory">/dev/stripe</filename>
|
<para>This process should have created two other devices
|
||||||
directory in addition to the <devicename>st0</devicename> device.
|
in the <filename class="directory">/dev/stripe</filename>
|
||||||
Those include <devicename>st0a</devicename> and
|
directory in addition to the <devicename>st0</devicename> device.
|
||||||
<devicename>st0c</devicename>. At this point a file system may be created
|
Those include <devicename>st0a</devicename> and
|
||||||
on the <devicename>st0a</devicename> device with the
|
<devicename>st0c</devicename>. At this point a file system may be
|
||||||
<command>newfs</command> utility:</para>
|
created on the <devicename>st0a</devicename> device with the
|
||||||
|
<command>newfs</command> utility:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>newfs -U /dev/stripe/st0a</userinput></screen>
|
<screen>&prompt.root; <userinput>newfs -U /dev/stripe/st0a</userinput></screen>
|
||||||
|
|
||||||
<para>Many numbers will glide across the screen, and after a few
|
<para>Many numbers will glide across the screen, and after a few
|
||||||
seconds, the process will be complete. The volume has been
|
seconds, the process will be complete. The volume has been
|
||||||
created and is ready to be mounted.</para>
|
created and is ready to be mounted.</para>
|
||||||
</step>
|
</step>
|
||||||
</procedure>
|
</procedure>
|
||||||
|
|
||||||
<para>To manually mount the created disk stripe:</para>
|
<para>To manually mount the created disk stripe:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>mount /dev/stripe/st0a /mnt</userinput></screen>
|
<screen>&prompt.root; <userinput>mount /dev/stripe/st0a /mnt</userinput></screen>
|
||||||
|
|
||||||
<para>To mount this striped file system automatically during the boot
|
<para>To mount this striped file system automatically during the boot
|
||||||
process, place the volume information in
|
process, place the volume information in
|
||||||
<filename>/etc/fstab</filename> file. For this purpose, a permanent mount
|
<filename>/etc/fstab</filename> file. For this purpose, a permanent
|
||||||
point, named <filename class="directory">stripe</filename>, is
|
mount point, named <filename class="directory">stripe</filename>, is
|
||||||
created:</para>
|
created:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>mkdir /stripe</userinput>
|
<screen>&prompt.root; <userinput>mkdir /stripe</userinput>
|
||||||
&prompt.root; <userinput>echo "/dev/stripe/st0a /stripe ufs rw 2 2" \</userinput>
|
&prompt.root; <userinput>echo "/dev/stripe/st0a /stripe ufs rw 2 2" \</userinput>
|
||||||
<userinput>>> /etc/fstab</userinput></screen>
|
<userinput>>> /etc/fstab</userinput></screen>
|
||||||
|
|
||||||
<para>The <filename>geom_stripe.ko</filename> module must also be automatically loaded during
|
<para>The <filename>geom_stripe.ko</filename> module must also be
|
||||||
system initialization, by adding a line to
|
automatically loaded during system initialization, by adding a line to
|
||||||
<filename>/boot/loader.conf</filename>:</para>
|
<filename>/boot/loader.conf</filename>:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>echo 'geom_stripe_load="YES"' >> /boot/loader.conf</userinput></screen>
|
|
||||||
|
|
||||||
|
<screen>&prompt.root; <userinput>echo 'geom_stripe_load="YES"' >> /boot/loader.conf</userinput></screen>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="GEOM-mirror">
|
<sect1 id="GEOM-mirror">
|
||||||
|
@ -237,8 +238,7 @@ Done.</screen>
|
||||||
important aspect is that information on one disk or partition is
|
important aspect is that information on one disk or partition is
|
||||||
being replicated. Later, that information could be more easily
|
being replicated. Later, that information could be more easily
|
||||||
restored, backed up without causing service or access
|
restored, backed up without causing service or access
|
||||||
interruption, and even be physically stored in a data
|
interruption, and even be physically stored in a data safe.</para>
|
||||||
safe.</para>
|
|
||||||
|
|
||||||
<para>To begin, ensure the system has two disk drives of equal size,
|
<para>To begin, ensure the system has two disk drives of equal size,
|
||||||
these exercises assume they are direct access (&man.da.4;)
|
these exercises assume they are direct access (&man.da.4;)
|
||||||
|
@ -291,20 +291,21 @@ Done.</screen>
|
||||||
|
|
||||||
<para>Edit the <filename>/etc/fstab</filename> file, replacing
|
<para>Edit the <filename>/etc/fstab</filename> file, replacing
|
||||||
references to the old <devicename>da0</devicename> with the
|
references to the old <devicename>da0</devicename> with the
|
||||||
new device nodes of the <devicename>gm0</devicename> mirror device.</para>
|
new device nodes of the <devicename>gm0</devicename> mirror
|
||||||
|
device.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>If &man.vi.1; is your preferred editor, the following is
|
<para>If &man.vi.1; is your preferred editor, the following is
|
||||||
an easy way to accomplish this task:</para>
|
an easy way to accomplish this task:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>vi /etc/fstab</userinput></screen>
|
<screen>&prompt.root; <userinput>vi /etc/fstab</userinput></screen>
|
||||||
|
|
||||||
<para>In &man.vi.1; back up the current contents of
|
<para>In &man.vi.1; back up the current contents of
|
||||||
<filename>fstab</filename> by typing
|
<filename>fstab</filename> by typing
|
||||||
<userinput>:w /etc/fstab.bak</userinput>. Then
|
<userinput>:w /etc/fstab.bak</userinput>. Then
|
||||||
replace all old <devicename>da0</devicename> references
|
replace all old <devicename>da0</devicename> references
|
||||||
with <devicename>gm0</devicename> by typing
|
with <devicename>gm0</devicename> by typing
|
||||||
<userinput>:%s/da/mirror\/gm/g</userinput>.<para>
|
<userinput>:%s/da/mirror\/gm/g</userinput>.<para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>The resulting <filename>fstab</filename> file should look
|
<para>The resulting <filename>fstab</filename> file should look
|
||||||
|
@ -368,6 +369,7 @@ mirror/gm0 COMPLETE da0
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Troubleshooting</title>
|
<title>Troubleshooting</title>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
<title>System refuses to boot</title>
|
<title>System refuses to boot</title>
|
||||||
|
|
||||||
|
@ -539,7 +541,7 @@ ggate0
|
||||||
specific, and will be created in the <filename
|
specific, and will be created in the <filename
|
||||||
class="directory">/dev/label</filename> directory.</para>
|
class="directory">/dev/label</filename> directory.</para>
|
||||||
|
|
||||||
<para>A temporary label will go away with the next reboot. These
|
<para>A temporary label will go away with the next reboot. These
|
||||||
labels will be created in the
|
labels will be created in the
|
||||||
<filename class="directory">/dev/label</filename> directory and
|
<filename class="directory">/dev/label</filename> directory and
|
||||||
are perfect for experimentation. A temporary label can be
|
are perfect for experimentation. A temporary label can be
|
||||||
|
@ -657,7 +659,7 @@ devfs on /dev (devfs, local)
|
||||||
|
|
||||||
<sect1 id="geom-gjournal">
|
<sect1 id="geom-gjournal">
|
||||||
<title>UFS Journaling Through GEOM</title>
|
<title>UFS Journaling Through GEOM</title>
|
||||||
|
|
||||||
<indexterm>
|
<indexterm>
|
||||||
<primary>GEOM</primary>
|
<primary>GEOM</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
@ -674,7 +676,7 @@ devfs on /dev (devfs, local)
|
||||||
<para>What is journaling? Journaling capability stores a log of
|
<para>What is journaling? Journaling capability stores a log of
|
||||||
file system transactions, i.e.: changes that make up a complete
|
file system transactions, i.e.: changes that make up a complete
|
||||||
disk write operation, before meta-data and file writes are
|
disk write operation, before meta-data and file writes are
|
||||||
committed to the disk proper. This transaction log can later
|
committed to the disk proper. This transaction log can later
|
||||||
be replayed to redo file system transactions, preventing file
|
be replayed to redo file system transactions, preventing file
|
||||||
system inconsistencies.</para>
|
system inconsistencies.</para>
|
||||||
|
|
||||||
|
@ -682,9 +684,8 @@ devfs on /dev (devfs, local)
|
||||||
loss and inconsistencies of the file system. Unlike Soft Updates
|
loss and inconsistencies of the file system. Unlike Soft Updates
|
||||||
which tracks and enforces meta-data updates and Snapshots which
|
which tracks and enforces meta-data updates and Snapshots which
|
||||||
is an image of the file system, an actual log is stored in disk
|
is an image of the file system, an actual log is stored in disk
|
||||||
space specifically reserved for this task,
|
space specifically reserved for this task, and in some cases may be
|
||||||
and in some cases may be stored on another disk
|
stored on another disk entirely.</para>
|
||||||
entirely.</para>
|
|
||||||
|
|
||||||
<para>Unlike other file system journaling implementations, the
|
<para>Unlike other file system journaling implementations, the
|
||||||
<command>gjournal</command> method is block based and not
|
<command>gjournal</command> method is block based and not
|
||||||
|
@ -720,8 +721,8 @@ devfs on /dev (devfs, local)
|
||||||
|
|
||||||
<para>At this point, there should be a
|
<para>At this point, there should be a
|
||||||
<devicename>/dev/da4</devicename> device node and a
|
<devicename>/dev/da4</devicename> device node and a
|
||||||
<devicename>/dev/da4.journal</devicename> device node. A
|
<devicename>/dev/da4.journal</devicename> device node.
|
||||||
file system may now be created on this device:</para>
|
A file system may now be created on this device:</para>
|
||||||
|
|
||||||
<screen>&prompt.root; <userinput>newfs -O 2 -J /dev/da4.journal</userinput></screen>
|
<screen>&prompt.root; <userinput>newfs -O 2 -J /dev/da4.journal</userinput></screen>
|
||||||
|
|
||||||
|
@ -736,11 +737,12 @@ devfs on /dev (devfs, local)
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>In the case of several slices, a journal will be created
|
<para>In the case of several slices, a journal will be created
|
||||||
for each individual slice. For instance, if <devicename>ad4s1</devicename> and <devicename>ad4s2</devicename>
|
for each individual slice. For instance, if
|
||||||
|
<devicename>ad4s1</devicename> and <devicename>ad4s2</devicename>
|
||||||
are both slices, then <command>gjournal</command> will create
|
are both slices, then <command>gjournal</command> will create
|
||||||
<devicename>ad4s1.journal</devicename> and <devicename>ad4s2.journal</devicename>. In the case of the command
|
<devicename>ad4s1.journal</devicename> and
|
||||||
being run twice, the result will be
|
<devicename>ad4s2.journal</devicename>. In the case of the command
|
||||||
<quote>journals</quote>.</para>
|
being run twice, the result will be <quote>journals</quote>.</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>Under some circumstances, keeping the journal on another disk
|
<para>Under some circumstances, keeping the journal on another disk
|
||||||
|
@ -751,8 +753,7 @@ devfs on /dev (devfs, local)
|
||||||
before attempting to alter a file system. In most cases, the
|
before attempting to alter a file system. In most cases, the
|
||||||
<command>gjournal</command> will fail if it is unable to create
|
<command>gjournal</command> will fail if it is unable to create
|
||||||
the actual journal but this does not protect against data loss
|
the actual journal but this does not protect against data loss
|
||||||
incurred as a result of misusing
|
incurred as a result of misusing <command>tunefs</command>.</para>
|
||||||
<command>tunefs</command>.</para>
|
|
||||||
|
|
||||||
<para>It is also possible to journal the boot disk of a &os; system.
|
<para>It is also possible to journal the boot disk of a &os; system.
|
||||||
Please refer to the article <ulink
|
Please refer to the article <ulink
|
||||||
|
|
Loading…
Reference in a new issue