svn commit: r45036 - head/en_US.ISO8859-1/books/handbook/config
Warren Block
wblock at FreeBSD.org
Mon Jun 9 03:42:30 UTC 2014
Author: wblock
Date: Mon Jun 9 03:42:29 2014
New Revision: 45036
URL: http://svnweb.freebsd.org/changeset/doc/45036
Log:
Add an example for 10.x swap files, clarify the existing examples for 9.x, use
procedure instead of orderedlist, and factor out common parts.
PR: 190759
Submitted by: p5B2E9A8F at t-online.de
Modified:
head/en_US.ISO8859-1/books/handbook/config/chapter.xml
Modified: head/en_US.ISO8859-1/books/handbook/config/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/handbook/config/chapter.xml Mon Jun 9 00:30:05 2014 (r45035)
+++ head/en_US.ISO8859-1/books/handbook/config/chapter.xml Mon Jun 9 03:42:29 2014 (r45036)
@@ -1483,7 +1483,7 @@ cron.*
<para>For more information on all fields, valid flags, and how
to specify the rotation time, refer to &man.newsyslog.conf.5;.
Since <application>newsyslog</application> is run from
- &man.cron.8;, it can not rotate files more often than it is
+ &man.cron.8;, it cannot rotate files more often than it is
scheduled to run from &man.cron.8;.</para>
</sect2>
@@ -2757,55 +2757,85 @@ kern.maxvnodes: 100000</screen>
<sect2 xml:id="create-swapfile">
<title>Creating a Swap File</title>
- <para>To instead create a swap file, specify its size. The
- following example creates a 64MB file named
- <filename>/usr/swap0</filename>.</para>
+ <para>These examples create a 64M swap file
+ called <filename>/usr/swap0</filename> instead
+ of using a partition.</para>
+
+ <para>Using swap files requires that the module needed by
+ &man.md.4; has either been built into the kernel or has been
+ loaded before swap is enabled. See
+ <xref linkend="kernelconfig"/> for information about building
+ a custom kernel.</para>
+
+ <example xml:id="swapfile-10-and-later">
+ <title>Creating a Swap File on &os; 10.<replaceable>X</replaceable> and Later</title>
+
+ <procedure>
+ <step>
+ <para>Create the swap file:</para>
- <example>
- <title>Creating a Swap File on &os;</title>
+ <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/usr/swap0</replaceable> bs=1m count=<replaceable>64</replaceable></userinput></screen>
+ </step>
- <orderedlist>
- <listitem>
- <para>The <filename>GENERIC</filename> kernel already
- includes the required memory disk driver. When building
- a custom kernel, make sure to include the following line
- in the custom configuration file:</para>
+ <step>
+ <para>Set the proper permissions on the new file:</para>
- <programlisting>device md</programlisting>
+ <screen>&prompt.root; <userinput>chmod 0600 <replaceable>/usr/swap0</replaceable></userinput></screen>
+ </step>
- <para>For information on building a custom kernel, refer
- to <xref linkend="kernelconfig"/>.</para>
- </listitem>
+ <step>
+ <para>Inform the system about the swap file by adding a
+ line to <filename>/etc/fstab</filename>:</para>
+
+ <programlisting>md99 none swap sw,file=/usr/swap0 0 0</programlisting>
+
+ <para>The &man.md.4; device <filename>md99</filename> is
+ used, leaving lower device numbers available for
+ interactive use.</para>
+ </step>
+
+ <step>
+ <para>Swap space will be added on system startup. To add
+ swap space immediately, use &man.swapon.8;:</para>
+
+ <screen>&prompt.root; <userinput>swapon -aq</userinput></screen>
+ </step>
+ </procedure>
+ </example>
- <listitem>
+ <example xml:id="swapfile-9-and-earlier">
+ <title>Creating a Swap File on &os; 9.<replaceable>X</replaceable> and Earlier</title>
+
+ <procedure>
+ <step>
<para>Create the swap file,
<filename>/usr/swap0</filename>:</para>
- <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/usr/swap0</replaceable> bs=1024k count=<replaceable>64</replaceable></userinput></screen>
- </listitem>
+ <screen>&prompt.root; <userinput>dd if=/dev/zero of=<replaceable>/usr/swap0</replaceable> bs=1m count=<replaceable>64</replaceable></userinput></screen>
+ </step>
- <listitem>
- <para>Then, set proper permissions on
+ <step>
+ <para>Set the proper permissions on
<filename>/usr/swap0</filename>:</para>
<screen>&prompt.root; <userinput>chmod 0600 <replaceable>/usr/swap0</replaceable></userinput></screen>
- </listitem>
+ </step>
- <listitem>
+ <step>
<para>Enable the swap file in
<filename>/etc/rc.conf</filename>:</para>
<programlisting>swapfile="<replaceable>/usr/swap0</replaceable>" # Set to name of swap file</programlisting>
- </listitem>
+ </step>
- <listitem>
- <para>To enable the swap file immediately, specify a free
+ <step>
+ <para>Swap space will be added on system startup. To enable the swap file immediately, specify a free
memory device. Refer to <xref linkend="disks-virtual"/>
for more information about memory devices.</para>
<screen>&prompt.root; <userinput>mdconfig -a -t vnode -f <replaceable>/usr/swap0</replaceable> -u <replaceable>0</replaceable> && swapon /dev/md<replaceable>0</replaceable></userinput></screen>
- </listitem>
- </orderedlist>
+ </step>
+ </procedure>
</example>
</sect2>
</sect1>
@@ -2911,7 +2941,7 @@ kern.maxvnodes: 100000</screen>
<para>In &os; the &man.acpi.4; driver is loaded by default at
system boot and should <emphasis>not</emphasis> be compiled
- into the kernel. This driver can not be unloaded after boot
+ into the kernel. This driver cannot be unloaded after boot
because the system bus uses it for various hardware
interactions. However, if the system is experiencing
problems, <acronym>ACPI</acronym> can be disabled altogether
More information about the svn-doc-all
mailing list