[deployment-guide/comm-rel: 552/727] KernelModules: add embellishments
Jaromir Hradilek
jhradile at fedoraproject.org
Tue Oct 19 13:11:21 UTC 2010
commit 8f7250c1fe2ba219d2077da0136661e786b4e515
Author: Douglas Silas <dhensley at redhat.com>
Date: Wed Sep 1 21:47:04 2010 +0200
KernelModules: add embellishments
en-US/Working_with_Kernel_Modules.xml | 369 +++++++++++++++++++--------------
1 files changed, 217 insertions(+), 152 deletions(-)
---
diff --git a/en-US/Working_with_Kernel_Modules.xml b/en-US/Working_with_Kernel_Modules.xml
index 7b09205..3c79d06 100644
--- a/en-US/Working_with_Kernel_Modules.xml
+++ b/en-US/Working_with_Kernel_Modules.xml
@@ -24,6 +24,7 @@
<primary>kernel module</primary>
<secondary>types of</secondary>
</indexterm>
+ <para>Linux <firstterm>loadable kernel modules</firstterm> are so-called because they are able to be dynamically loaded into a running kernel to extend its capabilities, and dynamically also removed from it, using user-space commands. Device drivers are one type of kernel module, but not the only type. Like the kernel itself, kernel modules can take custom parameters to define their behavior. Kernel modules have default parameters which work in most, but not all cases.</para>
<para>This chapter is provided to illustrate <emphasis>some</emphasis> of the possible parameters available for common hardware device <firstterm>drivers</firstterm>
<footnote>
<para>A <firstterm>driver</firstterm> is software that enables Linux to use a particular hardware device. Without a driver, the kernel cannot communicate with attached devices.</para>
@@ -48,14 +49,16 @@
</indexterm>
<para>To determine if a module has been loaded successfully, or when trying different modules for a piece of new hardware, you can use the following utilities.</para>
<note>
- <title>Note: Make Sure You Have <package>module-init-tools</package> Installed</title>
- <para>
- To use utilities described in this section, you must have the <package>module-init-tools</package> package installed. Refer to <xref linkend="sec-Installing" /> for more information on how to install new packages in &MAJOROS;.
- </para>
+ <title>Note: Installing the module-init-tools package</title>
+ <para>In order to use the kernel module utilities, first ensure the <package>module-init-tools</package> package is installed on your system by running, as root:</para>
+ <screen>~]# <command>yum install module-init-tools</command>
+ </screen>
+ <para>For more information on installing packages with <application>Yum</application>, refer to <xref
+ linkend="sec-Installing"/>.</para>
</note>
<section
- id="s2-kernel-module-utils-lsmod">
- <title>Listing Currently Loaded Modules</title>
+ id="sec-Listing_Currently-Loaded_Modules">
+ <title>Listing Currently-Loaded Modules</title>
<indexterm
significance="normal">
<primary>
@@ -67,52 +70,108 @@
<primary>kernel module</primary>
<secondary>listing</secondary>
</indexterm>
- <para>To display a list of currently loaded modules, use the <command>lsmod</command> command. For example:</para>
- <screen>
+ <para>To display the list of currently loaded modules, use the <command>lsmod</command> command:</para>
+ <example
+ id="ex-Using_lsmod_to_display_the_list_of_currently-loaded_kernel_modules">
+ <title>Using lsmod to display the list of currently-loaded kernel modules</title>
+ <screen>
~]$ <command>lsmod</command>
Module Size Used by
-autofs4 25618 3
-sunrpc 231823 1
-bonding 115826 0
-ip6t_REJECT 4641 2
-nf_conntrack_ipv6 19623 2
-ip6table_filter 2895 1
-ip6_tables 19232 1 ip6table_filter
-ipv6 322766 61 bonding,ip6t_REJECT,nf_conntrack_ipv6
-dm_mirror 13723 0
-dm_region_hash 11920 1 dm_mirror
-dm_log 9944 2 dm_mirror,dm_region_hash
-uinput 8126 0
-sg 30478 0
-sr_mod 16066 0
-snd_ens1370 23085 4
-gameport 10783 1 snd_ens1370
-snd_rawmidi 22955 1 snd_ens1370
-cdrom 39833 1 sr_mod
-snd_seq 56461 0
-snd_seq_device 6634 2 snd_rawmidi,snd_seq
-snd_pcm 83399 1 snd_ens1370
-snd_timer 22304 4 snd_seq,snd_pcm
-snd 70077 12 snd_ens1370,snd_rawmidi,snd_seq,snd_seq_device,snd_pcm,snd_timer
-virtio_net 15937 0
-i2c_piix4 12707 0
-soundcore 7892 1 snd
-joydev 10514 0
-snd_page_alloc 8604 2 snd_ens1370,snd_pcm
-i2c_core 31338 1 i2c_piix4
-virtio_balloon 3599 0
-ext4 362885 2
-mbcache 7510 1 ext4
-jbd2 98427 1 ext4
-virtio_blk 5159 3
-ata_generic 3619 0
-pata_acpi 3675 0
-virtio_pci 6741 0
-virtio_ring 6026 1 virtio_pci
-virtio 4864 4 virtio_net,virtio_balloon,virtio_blk,virtio_pci
-ata_piix 22532 0
-dm_mod 73839 8 dm_mirror,dm_log</screen>
- <para>The command output is divided into three columns: the module name, the amount of memory it uses, and its use count followed by a list of referring modules. Note that the output is less verbose and easier to read than the content of the <filename>/proc/modules</filename> file.</para>
+xfs 803635 1
+exportfs 3424 1 xfs
+vfat 8216 1
+fat 43410 1 vfat
+tun 13014 2
+fuse 54749 2
+ip6table_filter 2743 0
+ip6_tables 16558 1 ip6table_filter
+ebtable_nat 1895 0
+ebtables 15186 1 ebtable_nat
+ipt_MASQUERADE 2208 6
+iptable_nat 5420 1
+nf_nat 19059 2 ipt_MASQUERADE,iptable_nat
+rfcomm 65122 4
+ipv6 267017 33
+sco 16204 2
+bridge 45753 0
+stp 1887 1 bridge
+llc 4557 2 bridge,stp
+bnep 15121 2
+l2cap 45185 16 rfcomm,bnep
+cpufreq_ondemand 8420 2
+acpi_cpufreq 7493 1
+freq_table 3851 2 cpufreq_ondemand,acpi_cpufreq
+usb_storage 44536 1
+sha256_generic 10023 2
+aes_x86_64 7654 5
+aes_generic 27012 1 aes_x86_64
+cbc 2793 1
+dm_crypt 10930 1
+kvm_intel 40311 0
+kvm 253162 1 kvm_intel
+<lineannotation>[output truncated]</lineannotation>
+ </screen>
+ </example>
+ <para>Each row of <command>lsmod</command> output specifies the name of a kernel module loaded in memory, the amount of memory it uses, the number of other modules which depend on it (its <firstterm>use count</firstterm>), and finally a list of those modules which depend on it.<footnote
+ id="footnote-Dependency_List_Length"><para>If a module has a large number of dependencies, then <command>modprobe</command> may truncate or even omit the names of those modules in the <computeroutput>Used by</computeroutput> column of its output. This is the case in <xref
+ linkend="ex-Using_lsmod_to_display_the_list_of_currently-loaded_kernel_modules"/>, where the <systemitem
+ class="resource">ipv6</systemitem> module has 33 dependencies.</para>
+ </footnote>
+ <command>lsmod</command> output is less verbose and considerably easier to read than the content of the <filename>/proc/modules</filename> pseudo-file.</para>
+ </section>
+ <section
+ id="sec-Displaying_Information_About_a_Module">
+ <title>Displaying Information About a Module</title>
+ <indexterm
+ significance="normal">
+ <primary>
+ <command>modinfo</command>
+ </primary>
+ </indexterm>
+ <indexterm
+ significance="normal">
+ <primary>kernel module</primary>
+ <secondary>examining</secondary>
+ </indexterm>
+ <para>To display detailed information about a kernel module, run the <command>modinfo <replaceable><module_name></replaceable>
+ </command> command.</para>
+ <note
+ id="note-Module_names_do_not_end_in_.ko">
+ <title>Module names do not end in .ko</title>
+ <para>When entering the name of a kernel module as an argument to one of the <package>module-init-tools</package> utilities, do not append a <filename>.ko</filename> extension to the end of the name.</para>
+ </note>
+ <para>For example, to display information about the <systemitem
+ class="resource">e100</systemitem> module, enter:</para>
+ <screen>~]# <command>modinfo e100</command>
+filename: /lib/modules/2.6.32-54.&PKGOS;.i686/kernel/drivers/net/e100.ko
+firmware: e100/d102e_ucode.bin
+firmware: e100/d101s_ucode.bin
+firmware: e100/d101m_ucode.bin
+version: 3.5.24-k2-NAPI
+license: GPL
+author: Copyright(c) 1999-2006 Intel Corporation
+description: Intel(R) PRO/100 Network Driver
+srcversion: B3A9FA10F08AF446AA1CC6B
+alias: pci:v00008086d000027DCsv*sd*bc02sc00i*
+alias: pci:v00008086d0000245Dsv*sd*bc02sc00i*
+alias: pci:v00008086d00002459sv*sd*bc02sc00i*
+<lineannotation>[some output ommitted]</lineannotation>
+depends: mii
+vermagic: 2.6.32-54.&PKGOS;.i686 SMP mod_unload modversions 686
+parm: debug:Debug level (0=none,...,16=all) (int)
+parm: eeprom_bad_csum_allow:Allow bad eeprom checksums (int)
+parm: use_io:Force use of i/o access mode (int)</screen>
+ <para>To display only a brief description of the module, use the <option>-d</option> option. For example:</para>
+ <screen>~]# <command>modinfo -d e100</command>
+Intel(R) PRO/100 Network Driver</screen>
+ <para>To list all parameters the module supports, use the <option>-p</option> option:</para>
+ <screen>~]# <command>modinfo -p e100</command>
+use_io:Force use of i/o access mode
+eeprom_bad_csum_allow:Allow bad eeprom checksums
+debug:Debug level (0=none,...,16=all)</screen>
+ <para>Finally, to display the absolute path to the module file, use the <option>-n</option> option:</para>
+ <screen>~]# <command>modinfo -n e100</command>
+/lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko</screen>
</section>
<section
id="s2-kernel-module-utils-modprobe">
@@ -128,25 +187,33 @@ dm_mod 73839 8 dm_mirror,dm_log</screen>
<primary>kernel module</primary>
<secondary>loading</secondary>
</indexterm>
- <para>To load a kernel module, use the <command>modprobe</command> command in the following form:</para>
- <screen><command>modprobe <replaceable><module></replaceable></command></screen>
- <para>For example, to load the <systemitem class="resource">wacom</systemitem> module, type:</para>
- <screen>~]# <command>modprobe wacom</command></screen>
- <para>By default, <command>modprobe</command> attempts to load the module from <filename class="directory">/lib/modules/<replaceable><kernel-version></replaceable>/kernel/drivers/</filename>. In this directory, each type of module has its own subdirectory, such as <filename class="directory">net/</filename> for network interface drivers.</para>
- <para>Some kernel modules have module dependencies, which means that other modules must be loaded first for them to load successfully. The <command>modprobe</command> command checks for these dependencies, and loads the required modules automatically so that you do not have to resolve the dependencies manually. This way, typing the <command>modprobe e100</command> command first loads all dependencies of <systemitem class="resource">e100</systemitem>, and then the module itself.</para>
- <para>To display all commands as <command>modprobe</command> executes them, use the <option>-v</option> option. For example:</para>
+ <para>To load a kernel module, run <command>modprobe <replaceable><module_name></replaceable>
+ </command> as root. For example, to load the <systemitem
+ class="resource">wacom</systemitem> module, run:</para>
+ <screen>~]# <command>modprobe wacom</command>
+ </screen>
+ <para>By default, <command>modprobe</command> attempts to load the module from <filename
+ class="directory">/lib/modules/<replaceable><kernel_version></replaceable>/kernel/drivers/</filename>. In this directory, each type of module has its own subdirectory, such as <filename
+ class="directory">net/</filename> for network interface drivers, and <filename
+ class="directory">scsi/</filename> for SCSI interface drivers.</para>
+ <para>Some kernel modules have dependencies, which are other modules they depend on, and which must be loaded first. Before <command>modprobe</command> loads any kernel module, it first examines the dependencies of that module (if there are any) and ensures they are loaded, or loads them if not. Like the <application>Yum</application> package manager, <command>modprobe</command> resolves dependencies recursively, which means that all dependencies are always met. Because of this, there is no need to determine and resolve module dependencies manually.</para>
+ <para>You can use the <option>-v</option> option to cause <command>modprobe</command> to display detailed information about what it is doing, which may include loading module dependencies:</para>
<screen>~]# <command>modprobe -v e100</command>
insmod /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/mii.ko
insmod /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko</screen>
+ <para>This output indicates that <command>modprobe</command> loaded the <systemitem
+ class="resource">mii</systemitem> module (using the <command>insmod</command> command) as a dependency before loading <systemitem
+ class="resource">e100</systemitem>.</para>
<indexterm
significance="normal">
<primary>
<command>insmod</command>
</primary>
</indexterm>
- <important>
- <title>Important: Do Not Use <command>insmod</command> Directly</title>
- <para>Although the <command>insmod</command> command can also be used to load kernel modules, it does not resolve dependencies. Because of this, you should always use <command>modprobe</command> instead.</para>
+ <important
+ id="important-Do_not_use_insmod_directly">
+ <title>Do not use insmod directly!</title>
+ <para>Although the <command>insmod</command> command can also be used to load kernel modules, it does not resolve dependencies. Because of this, you should <emphasis>always</emphasis> load modules using <command>modprobe</command> instead.</para>
</important>
<indexterm>
<primary>kernel module</primary>
@@ -162,11 +229,18 @@ insmod /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko</screen>
<secondary>module parameters</secondary>
<tertiary>supplying</tertiary>
</indexterm>
- <para>In some situations, it may be desirable to customize the module behavior by supplying additional parameters to it. To do so, use the <command>modprobe</command> command in the following form:</para>
- <screen><command>modprobe <replaceable><module></replaceable> <replaceable><parameter></replaceable>...</command></screen>
- <para>For example, to allow bad eeprom checksums and set the debug level to maximum for an Intel Ether Express/100 driver, type:</para>
- <screen>~]# <command>modprobe e100 eeprom_bad_csum_allow=1 debug=16</command></screen>
- <para>Note that when a module parameter expects comma-separated values, you should <emphasis>not</emphasis> use speces after the commas. Refer to <xref linkend="s1-modules-parameters" /> for a list of common module parameters.</para>
+ <para>You may want to customize the behavior of a certain module, which you can do by supplying it with additional parameters. The format for doing so is:</para>
+ <example
+ id="ex-Supplying_optional_parameters_when_loading_a_kernel_module">
+ <title>Supplying optional parameters when loading a kernel module</title>
+ <screen>~]# <command>modprobe <replaceable><module_name></replaceable> <optional><replaceable>parameter</replaceable>=<replaceable>value</replaceable></optional>
+ </command>
+ </screen>
+ </example>
+ <para>For example, to allow bad eeprom checksums, and to set the debug level to maximum for an Intel Ether Express/100 driver, enter:</para>
+ <screen>~]# <command>modprobe e100 eeprom_bad_csum_allow=1 debug=16</command>
+ </screen>
+ <para>Some module parameters expect a list of comma-separated values as their argument. When entering the values, do <emphasis>not</emphasis> insert a space after each comma, or <command>modprobe</command> will incorrectly interpret the values following spaces as additional parameters.</para>
</section>
<section
id="s2-kernel-module-utils-rmmod">
@@ -182,10 +256,11 @@ insmod /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko</screen>
<primary>kernel module</primary>
<secondary>unloading</secondary>
</indexterm>
- <para>To unload a kernel module, use the <command>modprobe</command> command in the following form:</para>
- <screen><command>modprobe -r <replaceable><module></replaceable></command></screen>
- <para>For example, to unload the <systemitem class="resource">wacom</systemitem> module, type:</para>
- <screen>~]# <command>modprobe -r wacom</command></screen>
+ <para>To unload a kernel module, run <command>modprobe -r <replaceable><module_name></replaceable>
+ </command> as root. For example, to unload the <systemitem
+ class="resource">wacom</systemitem> module, run:</para>
+ <screen>~]# <command>modprobe -r wacom</command>
+ </screen>
<para>The <command>modprobe -r</command> command only unloads modules that are not in use and that are not a dependency of other modules in use. On the other hand, it checks for dependencies and unloads all modules that were previously required, but that are no longer necessary.</para>
<para>To display all commands as <command>modprobe</command> executes them, use the <option>-v</option> option. For example:</para>
<screen>~]# <command>modprobe -v -r e100</command>
@@ -197,60 +272,13 @@ rmmod /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/mii.ko</screen>
<command>rmmod</command>
</primary>
</indexterm>
- <important>
- <title>Important: Do Not Use <command>rmmod</command> Directly</title>
- <para>Although the <command>rmmod</command> command can also be used to unload kernel modules, it is recommended that you use <command>modprobe</command> instead.</para>
+ <important
+ id="important-Do_not_use_rmmod_directly">
+ <title>Do not use rmmod directly!</title>
+ <para>Although the <command>rmmod</command> command can be used to unload kernel modules, it is recommended to use <command>modprobe -r</command> instead.</para>
</important>
</section>
<section
- id="s2-kernel-module-utils-modinfo">
- <title>Displaying Module Information</title>
- <indexterm
- significance="normal">
- <primary>
- <command>modinfo</command>
- </primary>
- </indexterm>
- <indexterm
- significance="normal">
- <primary>kernel module</primary>
- <secondary>examining</secondary>
- </indexterm>
- <para>To display detailed information about a kernel module, use the <command>modinfo</command> in the following form:</para>
- <screen><command>modinfo <replaceable><module></replaceable></command></screen>
- <para>For example, to display information about the <systemitem class="resource">e100</systemitem> module, type:</para>
- <screen>~]# <command>modinfo e100</command>
-filename: /lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko
-firmware: e100/d102e_ucode.bin
-firmware: e100/d101s_ucode.bin
-firmware: e100/d101m_ucode.bin
-version: 3.5.24-k2-NAPI
-license: GPL
-author: Copyright(c) 1999-2006 Intel Corporation
-description: Intel(R) PRO/100 Network Driver
-srcversion: B3A9FA10F08AF446AA1CC6B
-alias: pci:v00008086d000027DCsv*sd*bc02sc00i*
-alias: pci:v00008086d0000245Dsv*sd*bc02sc00i*
-alias: pci:v00008086d00002459sv*sd*bc02sc00i*
-<emphasis>... several lines omitted ...</emphasis>
-depends: mii
-vermagic: 2.6.32-54.el6.i686 SMP mod_unload modversions 686
-parm: debug:Debug level (0=none,...,16=all) (int)
-parm: eeprom_bad_csum_allow:Allow bad eeprom checksums (int)
-parm: use_io:Force use of i/o access mode (int)</screen>
- <para>To display only a brief description of the module, use the <option>-d</option> option. For example:</para>
- <screen>~]# <command>modinfo -d e100</command>
-Intel(R) PRO/100 Network Driver</screen>
- <para>To list the supported parameters, use the <option>-p</option> option:</para>
- <screen>~]# <command>modinfo -p e100</command>
-use_io:Force use of i/o access mode
-eeprom_bad_csum_allow:Allow bad eeprom checksums
-debug:Debug level (0=none,...,16=all)</screen>
- <para>Finally, to display the corresponding module filename, use the <option>-n</option> option like this:</para>
- <screen>~]# <command>modinfo -n e100</command>
-/lib/modules/2.6.32-54.el6.i686/kernel/drivers/net/e100.ko</screen>
- </section>
- <section
id="s2-kernel-modules-persistent">
<title>Persistent Module Loading</title>
<indexterm>
@@ -261,23 +289,28 @@ debug:Debug level (0=none,...,16=all)</screen>
<primary>kernel module</primary>
<secondary>/etc/sysconfig/modules/</secondary>
</indexterm>
- <para>As shown in the example in <xref linkend="s2-kernel-module-utils-lsmod" />, many kernel modules are loaded automatically at boot time. To specify additional modules to be loaded, you can create a <filename><replaceable><filename></replaceable>.modules</filename> file in the <filename class="directory">/etc/sysconfig/modules/</filename> directory. Note that as a shell script, it has to contain the interpreter directive such as <literal>#!/bin/sh</literal> on the first line, and it has to be executable.</para>
- <note>
- <title>Note</title>
- <para>To make the script executable, type the following at a shell prompt:</para>
- <screen>~]# <command>chmod 755 <replaceable><filename></replaceable>.modules</command></screen>
- </note>
- <para>For example, the following script loads the <systemitem class="resource">uinput</systemitem> module:</para>
+ <para>As shown in <xref
+ linkend="ex-Using_lsmod_to_display_the_list_of_currently-loaded_kernel_modules"/>, many kernel modules are loaded automatically at boot time. You can specify additional modules to be loaded by creating a new <filename><replaceable><file_name></replaceable>.modules</filename> file in the <filename
+ class="directory">/etc/sysconfig/modules/</filename> directory. Note that you can use any descriptive name that you like in place of <filename><replaceable><file_name></replaceable></filename>. Your <filename>file_name.modules</filename> files are treated by the system startup scripts as shell scripts, and as such should begin with an <firstterm>interpreter directive</firstterm> (also called a <quote>bang line</quote>) as their first line:</para>
+ <example
+ id="ex-First_line_of_a_file_name.modules_file">
+ <title>First line of a <replaceable>file_name</replaceable>.modules file</title>
+ <screen>#!/bin/sh</screen>
+ </example>
+ <para>Additionally, the <filename><replaceable><file_name></replaceable>.modules</filename> file should be executable. You can make it executable by running:</para>
+ <screen>modules]# <command>chmod +x <replaceable><file_name></replaceable>.modules</command>
+ </screen>
+ <para>For example, the following <filename>bluez-uinput.modules</filename> script loads the <systemitem
+ class="resource">uinput</systemitem> module:</para>
<example
id="ex-bluez-uinput.modules">
<title>/etc/sysconfig/modules/bluez-uinput.modules</title>
- <programlisting>#!/bin/sh
-
+ <programlisting>#!/bin/sh
if [ ! -c /dev/input/uinput ] ; then
exec /sbin/modprobe uinput >/dev/null 2>&1
fi</programlisting>
</example>
- <para>The <literal>if</literal> conditional statement on the third line ensures that the <filename>/dev/input/uinput</filename> file does <emphasis>not</emphasis> exist (the <literal>!</literal> symbol negates the condition), and, if that is the case, then executes <command>modprobe</command> with the name of the kernel module to load—<systemitem class="resource">uinput</systemitem> in this example. The remainder of the line redirects any output to <filename>/dev/null</filename> so that the <command>modprobe</command> command remains quiet.</para>
+ <para>The <literal>if</literal>-conditional statement on the third line ensures that the <filename>/dev/input/uinput</filename> file does <emphasis>not</emphasis> already exist (the <literal>!</literal> symbol negates the condition), and, if that is the case, loads the <systemitem class="resource">uinput</systemitem> module by calling <command>exec /sbin/modprobe uinput</command>. The following <command>>/dev/null 2>&1</command> clause at the end of that line simply redirects any output to <filename>/dev/null</filename> so that the <command>modprobe</command> command remains quiet.</para>
<note
id="note-No_Need_to_Load_Network_and_SCSI_Modules">
<title>Note: Do Not Load Network and SCSI Modules</title>
@@ -288,7 +321,10 @@ fi</programlisting>
<section
id="s1-modules-parameters">
<title>Kernel Module Parameters</title>
- <para>This section lists modules used for a common hardware, and their respective parameters. Refer to <xref linkend="s2-kernel-module-utils-modprobe" /> for information on how to load them to the running kernel, and <xref linkend="s2-kernel-modules-persistent" /> for instructions on how to load them automatically at boot time. Note that to view parameters for a certain module, you can use the <command>modinfo</command> command as described in <xref linkend="s2-kernel-module-utils-modinfo" />.</para>
+ <para>This section lists modules used for a common hardware, and their respective parameters. Refer to <xref
+ linkend="s2-kernel-module-utils-modprobe" /> for information on how to load them to the running kernel, and <xref
+ linkend="s2-kernel-modules-persistent" /> for instructions on how to load them automatically at boot time. Note that to view parameters for a certain module, you can use the <command>modinfo</command> command as described in <xref
+ linkend="sec-Displaying_Information_About_a_Module" />.</para>
<section
id="s2-modules-scsi">
<title>Storage Parameters</title>
@@ -560,8 +596,10 @@ fi</programlisting>
</tgroup>
</table>
<important>
- <title>Important: The <systemitem class="resource">sym53c8xx</systemitem> Module Is Deprecated</title>
- <para>Although the <systemitem class="resource">sym53c8xx</systemitem> module is still available in &MAJOROSVER;, it is now deprecated, and will be removed in a future version of &MAJOROS;.</para>
+ <title>Important: The <systemitem
+ class="resource">sym53c8xx</systemitem> Module Is Deprecated</title>
+ <para>Although the <systemitem
+ class="resource">sym53c8xx</systemitem> module is still available in &MAJOROSVER;, it is now deprecated, and will be removed in a future version of &MAJOROS;.</para>
</important>
</section>
<section
@@ -1082,7 +1120,8 @@ fi</programlisting>
<para>First, bring up the bond you created by running <command>ifconfig <option>bond<replaceable><N></replaceable>
</option> <option>up</option>
</command> as root:</para>
- <screen>~]# <command>ifconfig bond0 up</command></screen>
+ <screen>~]# <command>ifconfig bond0 up</command>
+ </screen>
<para>If you have correctly created the <filename>ifcfg-bond0</filename> bonding interface file, you will be able to see <computeroutput>bond0</computeroutput> listed in the output of running <command>ifconfig</command> (without any options):</para>
<screen>~]# <command>ifconfig</command>
bond0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
@@ -1105,14 +1144,18 @@ eth0 Link encap:Ethernet HWaddr 52:54:00:26:9E:F1
<screen>~]# <command>cat /sys/class/net/bonding_masters</command>
bond0</screen>
<para>You can configure each bond individually by manipulating the files located in the <filename>/sys/class/net/bond<replaceable><N></replaceable>/bonding/</filename> directory. First, the bond you are configuring must be taken down:</para>
- <screen>~]# <command>ifconfig bond0 down</command></screen>
+ <screen>~]# <command>ifconfig bond0 down</command>
+ </screen>
<para>As an example, to enable MII monitoring on bond0 with a 1 second interval, you could run (as root):</para>
- <screen>~]# <command>echo 1000 > /sys/class/net/bond0/bonding/miimon</command></screen>
+ <screen>~]# <command>echo 1000 > /sys/class/net/bond0/bonding/miimon</command>
+ </screen>
<para>To configure bond0 for <parameter
class="option">balance-alb</parameter> mode, you could run either:</para>
- <screen>~]# <command>echo 6 > /sys/class/net/bond0/bonding/mode</command></screen>
+ <screen>~]# <command>echo 6 > /sys/class/net/bond0/bonding/mode</command>
+ </screen>
<para>...or, using the name of the mode:</para>
- <screen>~]# <command>echo balance-alb > /sys/class/net/bond0/bonding/mode</command></screen>
+ <screen>~]# <command>echo balance-alb > /sys/class/net/bond0/bonding/mode</command>
+ </screen>
<para>After configuring some options for the bond in question, you can bring it up and test it by running <command>ifconfig bond<replaceable><N></replaceable> <option>up</option>
</command>. If you decide to change the options, take the interface down, modify its parameters using <systemitem
class="filesystem">sysfs</systemitem>, bring it back up, and re-test.</para>
@@ -1126,7 +1169,8 @@ bond0</screen>
<para>The following is a list of available channel bonding module parameters for the <filename>bonding</filename> module. For more in-depth information on configuring channel bonding and the exhaustive list of bonding module parameters, install the <package>kernel-doc</package> package (refer to <xref
linkend="s1-kernel-modules-additional-resources"/>) and then locate and reference the <filename>bonding.txt</filename> file:</para>
<screen>~]# <command>yum -y install kernel-doc</command>
-~]# <command>less $(rpm -ql kernel-doc | grep -i bonding.txt)</command></screen>
+~]# <command>less $(rpm -ql kernel-doc | grep -i bonding.txt)</command>
+ </screen>
<variablelist
spacing="compact">
<title>Bonding Interface Parameters</title>
@@ -1148,9 +1192,7 @@ bond0</screen>
</varlistentry>
<varlistentry>
<term>
- <literal>arp_ip_target=<replaceable><ip_address></replaceable>
- <optional>,<replaceable><ip_address_2></replaceable>,...<replaceable><ip_address_16></replaceable>
- </optional>
+ <literal>arp_ip_target=<replaceable><ip_address></replaceable><optional>,<replaceable><ip_address_2></replaceable>,…<replaceable><ip_address_16></replaceable></optional>
</literal>
</term>
<listitem>
@@ -1218,7 +1260,8 @@ bond0</screen>
</term>
<listitem>
<para>Specifies (in milliseconds) how often MII link monitoring occurs. This is useful if high availability is required because MII is used to verify that the NIC is active. To verify that the driver for a particular NIC supports the MII tool, type the following command as root:</para>
- <screen>~]# <command>ethtool <replaceable><interface_name></replaceable> | grep "Link detected:"</command></screen>
+ <screen>~]# <command>ethtool <replaceable><interface_name></replaceable> | grep "Link detected:"</command>
+ </screen>
<para>In this command, replace <replaceable><interface_name</replaceable>> with the name of the device interface, such as <userinput>eth0</userinput>, not the bond interface. If MII is supported, the command returns:</para>
<screen>Link detected: yes</screen>
<para>If using a bonded interface for high availability, the module for each NIC must support MII. Setting the value to <userinput>0</userinput> (the default), turns this feature off. When configuring this setting, a good starting point for this parameter is <userinput>100</userinput>.</para>
@@ -1415,48 +1458,64 @@ bond0</screen>
<title>Installed Documentation</title>
<variablelist>
<varlistentry>
- <term><command>man lsmod</command></term>
+ <term>
+ <command>man lsmod</command>
+ </term>
<listitem>
<para>The manual page for <command>lsmod</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>man modinfo</command></term>
+ <term>
+ <command>man modinfo</command>
+ </term>
<listitem>
<para>The manual page for <command>modinfo</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>man modprobe</command></term>
+ <term>
+ <command>man modprobe</command>
+ </term>
<listitem>
<para>The manual page for <command>modprobe</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>man rmmod</command></term>
+ <term>
+ <command>man rmmod</command>
+ </term>
<listitem>
<para>The manual page for <command>rmmod</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>man ethtool</command></term>
+ <term>
+ <command>man ethtool</command>
+ </term>
<listitem>
<para>The manual page for <command>ethtool</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>man mii-tool</command></term>
+ <term>
+ <command>man mii-tool</command>
+ </term>
<listitem>
<para>The manual page for <command>mii-tool</command> containing the full documentation on its usage.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><filename class="directory">/usr/share/doc/kernel-doc-<replaceable><kernel_version></replaceable>/Documentation/</filename></term>
+ <term>
+ <filename
+ class="directory">/usr/share/doc/kernel-doc-<replaceable><kernel_version></replaceable>/Documentation/</filename>
+ </term>
<listitem>
<para>A directory with in-depth documentation on the &MAJOROS; kernel, kernel modules, and their respective parameters.</para>
<note>
<title>Note: Make Sure You Have <package>kernel-doc</package> Installed</title>
- <para>Refer to <xref linkend="sec-Installing" /> for more information on how to install new packages in &MAJOROS;.</para>
+ <para>Refer to <xref
+ linkend="sec-Installing" /> for more information on how to install new packages in &MAJOROS;.</para>
</note>
</listitem>
</varlistentry>
@@ -1467,7 +1526,13 @@ bond0</screen>
<title>Useful Websites</title>
<variablelist>
<varlistentry>
- <term><ulink url="http://tldp.org/HOWTO/Module-HOWTO/"><citetitle pubwork="webpage">Linux Loadable Kernel Module HOWTO</citetitle></ulink></term>
+ <term>
+ <ulink
+ url="http://tldp.org/HOWTO/Module-HOWTO/">
+ <citetitle
+ pubwork="webpage">Linux Loadable Kernel Module HOWTO</citetitle>
+ </ulink>
+ </term>
<listitem>
<para>The <citetitle>Linux Loadable Kernel Module HOWTO</citetitle> from the Linux Documentation Project.</para>
</listitem>
More information about the docs-commits
mailing list