Editorial review of gjournal section.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-04-29 17:45:17 +00:00
parent 61dafd977c
commit f7a7cade7e
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44699

View file

@ -1618,10 +1618,14 @@ ufsid/486b6fc16926168e N/A ad4s1f</screen>
<primary>Journaling</primary>
</indexterm>
<para>Beginning with &os;&nbsp;7.0, support for UFS journals is
<para>Beginning with &os;&nbsp;7.0, support for journals on
<acronym>UFS</acronym> file systems is
available. The implementation is provided through the
<acronym>GEOM</acronym> subsystem and is configured using
&man.gjournal.8;.</para>
<command>gjournal</command>. Unlike other file system journaling implementations, the
<command>gjournal</command> method is block based and not
implemented as part of the file system. It is a
<acronym>GEOM</acronym> extension.</para>
<para>Journaling stores a log of file system transactions, such as
changes that make up a complete disk write operation, before
@ -1633,55 +1637,44 @@ ufsid/486b6fc16926168e N/A ad4s1f</screen>
data loss and inconsistencies of the file system. Unlike Soft
Updates, which tracks and enforces meta-data updates, and
snapshots, which create an image of the file system, a log is
stored in disk space specifically for this task, and in
some cases, may be stored on another disk entirely.</para>
stored in disk space specifically for this task. For better
performance, the journal may be stored on another
disk. In this configuration, the journal provider or storage
device should be listed after the device to enable journaling
on.</para>
<para>Unlike other file system journaling implementations, the
<command>gjournal</command> method is block based and not
implemented as part of the file system. It is a
<acronym>GEOM</acronym> extension.</para>
<para>To enable support for <command>gjournal</command>, the
&os; kernel must have the following option which is the
default on &os;&nbsp;7.0 and later:</para>
<programlisting>options UFS_GJOURNAL</programlisting>
<para>If journaled volumes need to be mounted during startup, the
<filename>geom_journal.ko</filename> kernel module needs to be
loaded, by adding the following line to
<para>The <filename>GENERIC</filename> kernel provides support
for <command>gjournal</command>. To automatically load the
<filename>geom_journal.ko</filename> kernel module at boot time,
add the following line to
<filename>/boot/loader.conf</filename>:</para>
<programlisting>geom_journal_load="YES"</programlisting>
<para>Alternatively, this function can be built into a custom
kernel, by adding the following line in the kernel configuration
<para>If a custom
kernel is used, ensure the following line is in the kernel configuration
file:</para>
<programlisting>options GEOM_JOURNAL</programlisting>
<para>Creating a journal on a free file system may now be done
<para>Once the module is loaded, a journal can be created on a new
file system
using the following steps. In this example,
<filename>da4</filename> is a new <acronym>SCSI</acronym>
disk:</para>
<screen>&prompt.root; <userinput>gjournal load</userinput>
&prompt.root; <userinput>gjournal label /dev/da4</userinput></screen>
&prompt.root; <userinput>gjournal label /dev/<replaceable>da4</replaceable></userinput></screen>
<para>At this point, there should be a
<filename>/dev/da4</filename> device node and a
<filename>/dev/da4.journal</filename> device node.
A file system may now be created on this device:</para>
<para>This will load the module and create a <filename>/dev/da4.journal</filename>
device node on
<filename>/dev/da4</filename>.</para>
<screen>&prompt.root; <userinput>newfs -O 2 -J /dev/da4.journal</userinput></screen>
<para>A <acronym>UFS</acronym> file system may now be created on the
journaled device, then mounted on an existing mount point:</para>
<para>This command will create a <acronym>UFS</acronym>2 file
system on the journaled device.</para>
<para><command>mount</command> the device at the desired point
with:</para>
<screen>&prompt.root; <userinput>mount /dev/da4.journal <replaceable>/mnt</replaceable></userinput></screen>
<screen>&prompt.root; <userinput>newfs -O 2 -J /dev/<replaceable>da4</replaceable>.journal</userinput>
&prompt.root; <userinput>mount /dev/<replaceable>da4</replaceable>.journal <replaceable>/mnt</replaceable></userinput></screen>
<note>
<para>In the case of several slices, a journal will be created
@ -1693,18 +1686,17 @@ ufsid/486b6fc16926168e N/A ad4s1f</screen>
<filename>ad4s2.journal</filename>.</para>
</note>
<para>For better performance, the journal may be kept on another
disk. In this configuration, the journal provider or storage
device should be listed after the device to enable journaling
on. Journaling may also be enabled on current file systems by
<para>Journaling may also be enabled on current file systems by
using <command>tunefs</command>. However,
<emphasis>always</emphasis> make a backup before attempting to
alter a file system. In most cases, <command>gjournal</command>
alter an existing file system. In most cases, <command>gjournal</command>
will fail if it is unable to create the journal, but this does
not protect against data loss incurred as a result of misusing
<command>tunefs</command>.</para>
<command>tunefs</command>. Refer to &man.gjournal.8; and
&man.tunefs.8; for more information about these
commands.</para>
<para>It is also possible to journal the boot disk of a &os;
<para>It is possible to journal the boot disk of a &os;
system. Refer to the article <link
xlink:href="&url.articles.gjournal-desktop;">Implementing UFS
Journaling on a Desktop PC</link> for detailed