Fix my typo fix - I cannot believe I did this.
[linux_from_scratch.git] / BOOK / chapter06 / e2fsprogs.xml
blob6b935a2653b7d7516cabf92ff94bdd500e49031e
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4   <!ENTITY % general-entities SYSTEM "../general.ent">
5   %general-entities;
6 ]>
8 <sect1 id="ch-system-e2fsprogs" role="wrap">
9   <?dbhtml filename="e2fsprogs.html"?>
11   <sect1info condition="script">
12     <productname>e2fsprogs</productname>
13     <productnumber>&e2fsprogs-version;</productnumber>
14     <address>&e2fsprogs-url;</address>
15   </sect1info>
17   <title>E2fsprogs-&e2fsprogs-version;</title>
19   <indexterm zone="ch-system-e2fsprogs">
20     <primary sortas="a-E2fsprogs">E2fsprogs</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The E2fsprogs package contains the utilities for handling the
27     <systemitem class="filesystem">ext2</systemitem> file system. It also
28     supports the <systemitem class="filesystem">ext3</systemitem> and
29     <systemitem class="filesystem">ext4</systemitem> journaling
30     file systems.</para>
32     <segmentedlist>
33       <segtitle>&buildtime;</segtitle>
34       <segtitle>&diskspace;</segtitle>
36       <seglistitem>
37         <seg>&e2fsprogs-ch6-sbu;</seg>
38         <seg>&e2fsprogs-ch6-du;</seg>
39       </seglistitem>
40     </segmentedlist>
42   </sect2>
44   <sect2 role="installation">
45     <title>Installation of E2fsprogs</title>
47     <para>The E2fsprogs documentation recommends that the package be built in
48     a subdirectory of the source tree: </para>
50 <screen><userinput remap="pre">mkdir -v build
51 cd build</userinput></screen>
53     <para>Prepare E2fsprogs for compilation:</para>
55 <!--<screen><userinput remap="configure">LIBS=-L/tools/lib                    \
56 CFLAGS=-I/tools/include              \
57 CFLAGS=-I/tools/include              \
58 PKG_CONFIG_PATH=/tools/lib/pkgconfig \
59 ../configure - -prefix=/usr           \-->
60 <screen><userinput remap="configure">../configure --prefix=/usr           \
61              --bindir=/bin           \
62              --with-root-prefix=""   \
63              --enable-elf-shlibs     \
64              --disable-libblkid      \
65              --disable-libuuid       \
66              --disable-uuidd         \
67              --disable-fsck</userinput></screen>
69     <variablelist>
70       <title>The meaning of the environment variable and configure options:</title>
71 <!--
72       <varlistentry>
73         <term><parameter>PKG_CONFIG_PATH, LIBS, CFLAGS</parameter></term>
74         <listitem>
75           <para>These variables enable e2fsprogs to be built using the 
76           <xref linkend="ch-tools-util-linux"/> package built earlier.</para>
77         </listitem>
78       </varlistentry>
79 -->
80       <varlistentry>
81         <term><parameter>--with-root-prefix=""</parameter> and
82               <parameter>--bindir=/bin</parameter></term>
83         <listitem>
84           <para>Certain programs (such as the <command>e2fsck</command>
85           program) are considered essential programs.  When, for example,
86           <filename class="directory">/usr</filename> is not mounted, these
87           programs still need to be available. They belong in directories
88           like <filename class="directory">/lib</filename> and <filename
89           class="directory">/sbin</filename>. If this option is not passed
90           to E2fsprogs' configure, the programs are installed into the
91           <filename class="directory">/usr</filename> directory.</para>
92         </listitem>
93       </varlistentry>
95       <varlistentry>
96         <term><parameter>--enable-elf-shlibs</parameter></term>
97         <listitem>
98           <para>This creates the shared libraries which some programs
99           in this package use.</para>
100         </listitem>
101       </varlistentry>
103       <varlistentry>
104         <term><parameter>--disable-*</parameter></term>
105         <listitem>
106           <para>This prevents E2fsprogs from building and installing the
107           <systemitem class="library">libuuid</systemitem> and
108           <systemitem class="library">libblkid</systemitem> libraries, the
109           <systemitem class="daemon">uuidd</systemitem> daemon, and the
110           <command>fsck</command> wrapper, as Util-Linux installs more
111           recent versions.</para>
112         </listitem>
113       </varlistentry>
115     </variablelist>
117     <para>Compile the package:</para>
119 <screen><userinput remap="make">make</userinput></screen>
121     <para>To set up and run the test suite we need to first link some 
122     libraries from /tools/lib to a location where the test programs look.
123     To run the tests, issue:</para>
125 <screen><userinput remap="test">ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib
126 make LD_LIBRARY_PATH=/tools/lib check</userinput></screen>
128     <para>One of the E2fsprogs tests will attempt to allocate 256 MB of memory.
129     If you do not have significantly more RAM than this, be sure to enable
130     sufficient swap space for the test. See <xref
131     linkend="space-creatingfilesystem"/> and <xref linkend="space-mounting"/>
132     for details on creating and enabling swap space.</para>
134     <para>Install the binaries, documentation, and shared libraries:</para>
136 <screen><userinput remap="install">make install</userinput></screen>
138     <para>Install the static libraries and headers:</para>
140 <screen><userinput remap="install">make install-libs</userinput></screen>
142     <para>Make the installed static libraries writable so debugging symbols can
143     be removed later:</para>
145 <screen><userinput remap="install">chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a</userinput></screen>
147     <para>This package installs a gzipped
148     <filename class="extension">.info</filename> file but doesn't update the
149     system-wide <filename>dir</filename> file. Unzip this file and then update
150     the system <filename>dir</filename> file using the following
151     commands:</para>
153 <screen><userinput remap="install">gunzip -v /usr/share/info/libext2fs.info.gz
154 install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info</userinput></screen>
156     <para>If desired, create and install some additional documentation by
157     issuing the following commands:</para>
159 <screen><userinput remap="install">makeinfo -o      doc/com_err.info ../lib/et/com_err.texinfo
160 install -v -m644 doc/com_err.info /usr/share/info
161 install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info</userinput></screen>
162   </sect2>
164   <sect2 id="contents-e2fsprogs" role="content">
165     <title>Contents of E2fsprogs</title>
167     <segmentedlist>
168       <segtitle>Installed programs</segtitle>
169       <segtitle>Installed libraries</segtitle>
170       <segtitle>Installed directories</segtitle>
172       <seglistitem>
173         <seg>badblocks, chattr, compile_et, debugfs, dumpe2fs,e2freefrag,
174         e2fsck, e2image, e2label, e2undo, e4defrag, filefrag, fsck.ext2,
175         fsck.ext3, fsck.ext4, fsck.ext4dev, logsave, lsattr, mk_cmds, mke2fs,
176         mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.ext4dev, mklost+found,
177         resize2fs, and tune2fs</seg>
178         <seg>libcom_err.so, libe2p.so, libext2fs.so, and libss.so</seg>
179         <seg>/usr/include/e2p, /usr/include/et, /usr/include/ext2fs,
180         /usr/include/ss, /usr/share/et, and /usr/share/ss</seg>
181       </seglistitem>
182     </segmentedlist>
184     <variablelist>
185       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
186       <?dbfo list-presentation="list"?>
187       <?dbhtml list-presentation="table"?>
189       <varlistentry id="badblocks">
190         <term><command>badblocks</command></term>
191         <listitem>
192           <para>Searches a device (usually a disk partition) for bad
193           blocks</para>
194           <indexterm zone="ch-system-e2fsprogs badblocks">
195             <primary sortas="b-badblocks">badblocks</primary>
196           </indexterm>
197         </listitem>
198       </varlistentry>
200       <varlistentry id="chattr">
201         <term><command>chattr</command></term>
202         <listitem>
203           <para>Changes the attributes of files on an <systemitem
204           class="filesystem">ext2</systemitem> file system; it also
205           changes <systemitem class="filesystem">ext3</systemitem>
206           file systems, the journaling version of <systemitem
207           class="filesystem">ext2</systemitem> file systems</para>
208           <indexterm zone="ch-system-e2fsprogs chattr">
209             <primary sortas="b-chattr">chattr</primary>
210           </indexterm>
211         </listitem>
212       </varlistentry>
214       <varlistentry id="compile_et">
215         <term><command>compile_et</command></term>
216         <listitem>
217           <para>An error table compiler; it converts a table of error-code
218           names and messages into a C source file suitable for use with the
219           <filename class="libraryfile">com_err</filename> library</para>
220           <indexterm zone="ch-system-e2fsprogs compile_et">
221             <primary sortas="b-compile_et">compile_et</primary>
222           </indexterm>
223         </listitem>
224       </varlistentry>
226       <varlistentry id="debugfs">
227         <term><command>debugfs</command></term>
228         <listitem>
229           <para>A file system debugger; it can be used to examine and change
230           the state of an <systemitem class="filesystem">ext2</systemitem>
231           file system</para>
232           <indexterm zone="ch-system-e2fsprogs debugfs">
233             <primary sortas="b-debugfs">debugfs</primary>
234           </indexterm>
235         </listitem>
236       </varlistentry>
238       <varlistentry id="dumpe2fs">
239         <term><command>dumpe2fs</command></term>
240         <listitem>
241           <para>Prints the super block and blocks group information for the
242           file system present on a given device</para>
243           <indexterm zone="ch-system-e2fsprogs dumpe2fs">
244             <primary sortas="b-dumpe2fs">dumpe2fs</primary>
245           </indexterm>
246         </listitem>
247       </varlistentry>
249       <varlistentry id="e2freefrag">
250         <term><command>e2freefrag</command></term>
251         <listitem>
252           <para>Reports free space fragmentation information</para>
253           <indexterm zone="ch-system-e2fsprogs e2freefrag">
254             <primary sortas="b-e2freefrag">e2freefrag</primary>
255           </indexterm>
256         </listitem>
257       </varlistentry>
259       <varlistentry id="e2fsck">
260         <term><command>e2fsck</command></term>
261         <listitem>
262           <para>Is used to check, and optionally repair <systemitem
263           class="filesystem">ext2</systemitem> file systems and <systemitem
264           class="filesystem">ext3</systemitem> file systems</para>
265           <indexterm zone="ch-system-e2fsprogs e2fsck">
266             <primary sortas="b-e2fsck">e2fsck</primary>
267           </indexterm>
268         </listitem>
269       </varlistentry>
271       <varlistentry id="e2image">
272         <term><command>e2image</command></term>
273         <listitem>
274           <para>Is used to save critical <systemitem
275           class="filesystem">ext2</systemitem> file system data to a file</para>
276           <indexterm zone="ch-system-e2fsprogs e2image">
277             <primary sortas="b-e2image">e2image</primary>
278           </indexterm>
279         </listitem>
280       </varlistentry>
282       <varlistentry id="e2label">
283         <term><command>e2label</command></term>
284         <listitem>
285           <para>Displays or changes the file system label on the <systemitem
286           class="filesystem">ext2</systemitem> file system present on a given
287           device</para>
288           <indexterm zone="ch-system-e2fsprogs e2label">
289             <primary sortas="b-e2label">e2label</primary>
290           </indexterm>
291         </listitem>
292       </varlistentry>
294       <varlistentry id="e2undo">
295         <term><command>e2undo</command></term>
296         <listitem>
297           <para>Replays the undo log undo_log for an ext2/ext3/ext4 filesystem
298           found on a device [This can be used to undo a failed operation by an
299           e2fsprogs program.]</para>
300           <indexterm zone="ch-system-e2fsprogs e2undo">
301             <primary sortas="b-e2undo">e2undo</primary>
302           </indexterm>
303         </listitem>
304       </varlistentry>
306       <varlistentry id="e4defrag">
307         <term><command>e4defrag</command></term>
308         <listitem>
309           <para>Online defragmenter for ext4 filesystems</para>
310           <indexterm zone="ch-system-e2fsprogs e4defrag">
311             <primary sortas="b-e4defrag">e4defrag</primary>
312           </indexterm>
313         </listitem>
314       </varlistentry>
316       <varlistentry id="filefrag">
317         <term><command>filefrag</command></term>
318         <listitem>
319           <para>Reports on how badly fragmented a particular file might be</para>
320           <indexterm zone="ch-system-e2fsprogs filefrag">
321             <primary sortas="b-filefrag">filefrag</primary>
322           </indexterm>
323         </listitem>
324       </varlistentry>
326       <varlistentry id="fsck.ext2">
327         <term><command>fsck.ext2</command></term>
328         <listitem>
329           <para>By default checks <systemitem class="filesystem">ext2</systemitem>
330           file systems and is a hard link to <command>e2fsck</command></para>
331           <indexterm zone="ch-system-e2fsprogs fsck.ext2">
332             <primary sortas="b-fsck.ext2">fsck.ext2</primary>
333           </indexterm>
334         </listitem>
335       </varlistentry>
337       <varlistentry id="fsck.ext3">
338         <term><command>fsck.ext3</command></term>
339         <listitem>
340           <para>By default checks <systemitem class="filesystem">ext3</systemitem>
341           file systems and is a hard link to <command>e2fsck</command></para>
342           <indexterm zone="ch-system-e2fsprogs fsck.ext3">
343             <primary sortas="b-fsck.ext3">fsck.ext3</primary>
344           </indexterm>
345         </listitem>
346       </varlistentry>
348       <varlistentry id="fsck.ext4">
349         <term><command>fsck.ext4</command></term>
350         <listitem>
351           <para>By default checks <systemitem class="filesystem">ext4</systemitem>
352           file systems and is a hard link to <command>e2fsck</command></para>
353           <indexterm zone="ch-system-e2fsprogs fsck.ext4">
354             <primary sortas="b-fsck.ext4">fsck.ext4</primary>
355           </indexterm>
356         </listitem>
357       </varlistentry>
359       <varlistentry id="fsck.ext4dev">
360         <term><command>fsck.ext4dev</command></term>
361         <listitem>
362           <para>By default checks <systemitem class="filesystem">ext4</systemitem>
363           development file systems and  is a hard link to
364           <command>e2fsck</command></para>
365           <indexterm zone="ch-system-e2fsprogs fsck.ext4dev">
366             <primary sortas="b-fsck.ext4dev">fsck.ext4dev</primary>
367           </indexterm>
368         </listitem>
369       </varlistentry>
371       <varlistentry id="logsave">
372         <term><command>logsave</command></term>
373         <listitem>
374           <para>Saves the output of a command in a log file</para>
375           <indexterm zone="ch-system-e2fsprogs logsave">
376             <primary sortas="b-logsave">logsave</primary>
377           </indexterm>
378         </listitem>
379       </varlistentry>
381       <varlistentry id="lsattr">
382         <term><command>lsattr</command></term>
383         <listitem>
384           <para>Lists the attributes of files on a second extended file
385           system</para>
386           <indexterm zone="ch-system-e2fsprogs lsattr">
387             <primary sortas="b-lsattr">lsattr</primary>
388           </indexterm>
389         </listitem>
390       </varlistentry>
392       <varlistentry id="mk_cmds">
393         <term><command>mk_cmds</command></term>
394         <listitem>
395           <para>Converts a table of command names and help messages into a C
396           source file suitable for use with the <filename
397           class="libraryfile">libss</filename> subsystem library</para>
398           <indexterm zone="ch-system-e2fsprogs mk_cmds">
399             <primary sortas="b-mk_cmds">mk_cmds</primary>
400           </indexterm>
401         </listitem>
402       </varlistentry>
404       <varlistentry id="mke2fs">
405         <term><command>mke2fs</command></term>
406         <listitem>
407           <para>Creates an <systemitem class="filesystem">ext2</systemitem>
408           or <systemitem class="filesystem">ext3</systemitem> file system on
409           the given device</para>
410           <indexterm zone="ch-system-e2fsprogs mke2fs">
411             <primary sortas="b-mke2fs">mke2fs</primary>
412           </indexterm>
413         </listitem>
414       </varlistentry>
416       <varlistentry id="mkfs.ext2">
417         <term><command>mkfs.ext2</command></term>
418         <listitem>
419           <para>By default creates <systemitem class="filesystem">ext2</systemitem>
420           file systems and is a hard link to <command>mke2fs</command></para>
421           <indexterm zone="ch-system-e2fsprogs mkfs.ext2">
422             <primary sortas="b-mkfs.ext2">mkfs.ext2</primary>
423           </indexterm>
424         </listitem>
425       </varlistentry>
427       <varlistentry id="mkfs.ext3">
428         <term><command>mkfs.ext3</command></term>
429         <listitem>
430           <para>By default creates <systemitem class="filesystem">ext3</systemitem>
431           file systems and is a hard link to <command>mke2fs</command></para>
432           <indexterm zone="ch-system-e2fsprogs mkfs.ext3">
433             <primary sortas="b-mkfs.ext3">mkfs.ext3</primary>
434           </indexterm>
435         </listitem>
436       </varlistentry>
438       <varlistentry id="mkfs.ext4">
439         <term><command>mkfs.ext4</command></term>
440         <listitem>
441           <para>By default creates <systemitem class="filesystem">ext4</systemitem>
442           file systems and is a hard link to <command>mke2fs</command></para>
443           <indexterm zone="ch-system-e2fsprogs mkfs.ext4">
444             <primary sortas="b-mkfs.ext4">mkfs.ext4</primary>
445           </indexterm>
446         </listitem>
447       </varlistentry>
449       <varlistentry id="mkfs.ext4dev">
450         <term><command>mkfs.ext4dev</command></term>
451         <listitem>
452           <para>By default creates <systemitem class="filesystem">ext4</systemitem>
453           development file systems and is a hard link to <command>mke2fs</command></para>
454           <indexterm zone="ch-system-e2fsprogs mkfs.ext4dev">
455             <primary sortas="b-mkfs.ext4dev">mkfs.ext4dev</primary>
456           </indexterm>
457         </listitem>
458       </varlistentry>
460       <varlistentry id="mklost-found">
461         <term><command>mklost+found</command></term>
462         <listitem>
463           <para>Used to create a <filename class="directory">lost+found</filename>
464           directory on an <systemitem class="filesystem">ext2</systemitem> file
465           system; it pre-allocates disk blocks to this directory to lighten the
466           task of <command>e2fsck</command></para>
467           <indexterm zone="ch-system-e2fsprogs mklost-found">
468             <primary sortas="b-mklost+found">mklost+found</primary>
469           </indexterm>
470         </listitem>
471       </varlistentry>
473       <varlistentry id="resize2fs">
474         <term><command>resize2fs</command></term>
475         <listitem>
476           <para>Can be used to enlarge or shrink an <systemitem
477           class="filesystem">ext2</systemitem> file system</para>
478           <indexterm zone="ch-system-e2fsprogs resize2fs">
479             <primary sortas="b-resize2fs">resize2fs</primary>
480           </indexterm>
481         </listitem>
482       </varlistentry>
484       <varlistentry id="tune2fs">
485         <term><command>tune2fs</command></term>
486         <listitem>
487           <para>Adjusts tunable file system parameters on an <systemitem
488           class="filesystem">ext2</systemitem> file system</para>
489           <indexterm zone="ch-system-e2fsprogs tune2fs">
490             <primary sortas="b-tune2fs">tune2fs</primary>
491           </indexterm>
492         </listitem>
493       </varlistentry>
495       <varlistentry id="libcom_err">
496         <term><filename class="libraryfile">libcom_err</filename></term>
497         <listitem>
498           <para>The common error display routine</para>
499           <indexterm zone="ch-system-e2fsprogs libcom_err">
500             <primary sortas="c-libcom_err">libcom_err</primary>
501           </indexterm>
502         </listitem>
503       </varlistentry>
505       <varlistentry id="libe2p">
506         <term><filename class="libraryfile">libe2p</filename></term>
507         <listitem>
508           <para>Used by <command>dumpe2fs</command>, <command>chattr</command>,
509           and <command>lsattr</command></para>
510           <indexterm zone="ch-system-e2fsprogs libe2p">
511             <primary sortas="c-libe2p">libe2p</primary>
512           </indexterm>
513         </listitem>
514       </varlistentry>
516       <varlistentry id="libext2fs">
517         <term><filename class="libraryfile">libext2fs</filename></term>
518         <listitem>
519           <para>Contains routines to enable user-level programs to manipulate an
520           <systemitem class="filesystem">ext2</systemitem> file system</para>
521           <indexterm zone="ch-system-e2fsprogs libext2fs">
522             <primary sortas="c-libext2fs">libext2fs</primary>
523           </indexterm>
524         </listitem>
525       </varlistentry>
527       <varlistentry id="libss">
528         <term><filename class="libraryfile">libss</filename></term>
529         <listitem>
530           <para>Used by <command>debugfs</command></para>
531           <indexterm zone="ch-system-e2fsprogs libss">
532             <primary sortas="c-libss">libss</primary>
533           </indexterm>
534         </listitem>
535       </varlistentry>
537     </variablelist>
539   </sect2>
541 </sect1>