aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/e2fsprogs.xml
blob: bccf332271b64b64b20cfd5b195db69ef71ec702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-e2fsprogs" role="wrap">
  <?dbhtml filename="e2fsprogs.html"?>

  <sect1info condition="script">
    <productname>e2fsprogs</productname>
    <productnumber>&e2fsprogs-version;</productnumber>
    <address>&e2fsprogs-url;</address>
  </sect1info>

  <title>E2fsprogs-&e2fsprogs-version;</title>

  <indexterm zone="ch-system-e2fsprogs">
    <primary sortas="a-E2fsprogs">E2fsprogs</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The E2fsprogs package contains the utilities for handling the
    <systemitem class="filesystem">ext2</systemitem> file system. It also
    supports the <systemitem class="filesystem">ext3</systemitem> and
    <systemitem class="filesystem">ext4</systemitem> journaling
    file systems.</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&e2fsprogs-fin-sbu;</seg>
        <seg>&e2fsprogs-fin-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>Installation of E2fsprogs</title>

    <para>The E2fsprogs documentation recommends that the package be built in
    a subdirectory of the source tree: </para>

<screen><userinput remap="pre">mkdir -v build
cd       build</userinput></screen>

    <para>Prepare E2fsprogs for compilation:</para>

<screen><userinput remap="configure">../configure --prefix=/usr           \
             --sysconfdir=/etc       \
             --enable-elf-shlibs     \
             --disable-libblkid      \
             --disable-libuuid       \
             --disable-uuidd         \
             --disable-fsck</userinput></screen>

    <variablelist>
      <title>The meaning of the configure options:</title>

      <varlistentry>
        <term><parameter>--enable-elf-shlibs</parameter></term>
        <listitem>
          <para>This creates the shared libraries which some programs
          in this package use.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><parameter>--disable-*</parameter></term>
        <listitem>
          <para>These prevent building and installing the
          <systemitem class="library">libuuid</systemitem> and
          <systemitem class="library">libblkid</systemitem> libraries, the
          <systemitem class="daemon">uuidd</systemitem> daemon, and the
          <command>fsck</command> wrapper; util-linux installs more
          recent versions.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para>Compile the package:</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>To run the tests, issue:</para>

<screen><userinput remap="test">make check</userinput></screen>

    <para>One test, u_direct_io, is known to fail on some systems.</para>

<!-- This is a ridiculous amount now! And is it still true?
     Does not appear to be true for version 1.46.3.  Time with tests
     26 seconds with tests (With lots of cores and ram and an ssd disk).

    <para>One of the e2fsprogs tests will attempt to allocate 256 MB of memory.
    If you do not have significantly more RAM than this, be sure to enable
    sufficient swap space for the test. See <xref
    linkend="ch-partitioning-creatingfilesystem"/> and <xref
    linkend="ch-partitioning-mounting"/>
    for details on creating and enabling swap space.</para>

    <para>On a spinning disk, the tests take a little more than 4 SBUs. They
    can be much shorter on an SSD (down to about 1.5 SBUs).</para>
-->
    <para>Install the package:</para>

<screen><userinput remap="install">make install</userinput></screen>

    <para>Remove useless static libraries:</para>

<screen><userinput remap="install">rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a</userinput></screen>

    <para>This package installs a gzipped
    <filename class="extension">.info</filename> file but doesn't update the
    system-wide <filename>dir</filename> file. Unzip this file and then update
    the system <filename>dir</filename> file using the following
    commands:</para>

<screen><userinput remap="install">gunzip -v /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info</userinput></screen>

    <para>If desired, create and install some additional documentation by
    issuing the following commands:</para>

<screen><userinput remap="install">makeinfo -o      doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info</userinput></screen>
  </sect2>

  <sect2 id="contents-e2fsprogs" role="content">
    <title>Contents of E2fsprogs</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>
      <segtitle>Installed libraries</segtitle>
      <segtitle>Installed directories</segtitle>

      <seglistitem>
        <seg>badblocks, chattr, compile_et, debugfs, dumpe2fs, e2freefrag,
        e2fsck, e2image, e2label, e2mmpstatus, e2scrub, e2scrub_all, e2undo,
        e4crypt, e4defrag, filefrag, fsck.ext2,
        fsck.ext3, fsck.ext4, logsave, lsattr, mk_cmds, mke2fs,
        mkfs.ext2, mkfs.ext3, mkfs.ext4, mklost+found,
        resize2fs, and tune2fs</seg>
        <seg>libcom_err.so, libe2p.so, libext2fs.so, and libss.so</seg>
        <seg>/usr/include/e2p, /usr/include/et, /usr/include/ext2fs,
        /usr/include/ss, /usr/lib/e2fsprogs, /usr/share/et, and
        /usr/share/ss</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="badblocks">
        <term><command>badblocks</command></term>
        <listitem>
          <para>Searches a device (usually a disk partition) for bad
          blocks</para>
          <indexterm zone="ch-system-e2fsprogs badblocks">
            <primary sortas="b-badblocks">badblocks</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="chattr">
        <term><command>chattr</command></term>
        <listitem>
          <para>Changes the attributes of files on <systemitem
          class="filesystem">ext{234}</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs chattr">
            <primary sortas="b-chattr">chattr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="compile_et">
        <term><command>compile_et</command></term>
        <listitem>
          <para>An error table compiler; it converts a table of error-code
          names and messages into a C source file suitable for use with the
          <filename class="libraryfile">com_err</filename> library</para>
          <indexterm zone="ch-system-e2fsprogs compile_et">
            <primary sortas="b-compile_et">compile_et</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="debugfs">
        <term><command>debugfs</command></term>
        <listitem>
          <para>A file system debugger; it can be used to examine and change
          the state of <systemitem class="filesystem">ext{234}</systemitem>
          file systems</para>
          <indexterm zone="ch-system-e2fsprogs debugfs">
            <primary sortas="b-debugfs">debugfs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="dumpe2fs">
        <term><command>dumpe2fs</command></term>
        <listitem>
          <para>Prints the super block and blocks group information for the
          file system present on a given device</para>
          <indexterm zone="ch-system-e2fsprogs dumpe2fs">
            <primary sortas="b-dumpe2fs">dumpe2fs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2freefrag">
        <term><command>e2freefrag</command></term>
        <listitem>
          <para>Reports free space fragmentation information</para>
          <indexterm zone="ch-system-e2fsprogs e2freefrag">
            <primary sortas="b-e2freefrag">e2freefrag</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2fsck">
        <term><command>e2fsck</command></term>
        <listitem>
          <para>Is used to check and optionally repair <systemitem
          class="filesystem">ext{234}</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs e2fsck">
            <primary sortas="b-e2fsck">e2fsck</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2image">
        <term><command>e2image</command></term>
        <listitem>
          <para>Is used to save critical <systemitem
          class="filesystem">ext{234}</systemitem> file system data to a file</para>
          <indexterm zone="ch-system-e2fsprogs e2image">
            <primary sortas="b-e2image">e2image</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2label">
        <term><command>e2label</command></term>
        <listitem>
          <para>Displays or changes the file system label on the <systemitem
          class="filesystem">ext{234}</systemitem> file system on a given
          device</para>
          <indexterm zone="ch-system-e2fsprogs e2label">
            <primary sortas="b-e2label">e2label</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2mmpstatus">
        <term><command>e2mmpstatus</command></term>
        <listitem>
          <para>Checks MMP (Multiple Mount Protection) status of an <systemitem
          class="filesystem">ext4</systemitem> file system</para>
          <indexterm zone="ch-system-e2fsprogs e2mmpstatus">
            <primary sortas="b-e2mmpstatus">e2mmpstatus</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2scrub">
        <term><command>e2scrub</command></term>
        <listitem>
          <para>Checks the contents of a mounted <systemitem
              class="filesystem">ext{234}</systemitem> file system</para>
          <indexterm zone="ch-system-e2fsprogs e2scrub">
            <primary sortas="b-e2scrub">e2scrub</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2scrub_all">
        <term><command>e2scrub_all</command></term>
        <listitem>
          <para>Checks all mounted <systemitem class="filesystem">ext{234}</systemitem>
          file systems for errors</para>
          <indexterm zone="ch-system-e2fsprogs e2scrub_all">
            <primary sortas="b-e2scrub_all">e2scrub_all</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e2undo">
        <term><command>e2undo</command></term>
        <listitem>
          <para>Replays the undo log for an <systemitem
          class="filesystem">ext{234}</systemitem> file system
          found on a device. [This can be used to undo a failed operation by an
          E2fsprogs program.]</para>
          <indexterm zone="ch-system-e2fsprogs e2undo">
            <primary sortas="b-e2undo">e2undo</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e4crypt">
        <term><command>e4crypt</command></term>
        <listitem>
          <para><systemitem class="filesystem">Ext4</systemitem>
          file system encryption utility</para>
          <indexterm zone="ch-system-e2fsprogs e4crypt">
            <primary sortas="b-e4crypt">e4crypt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="e4defrag">
        <term><command>e4defrag</command></term>
        <listitem>
          <para>Online defragmenter for <systemitem
          class="filesystem">ext4</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs e4defrag">
            <primary sortas="b-e4defrag">e4defrag</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="filefrag">
        <term><command>filefrag</command></term>
        <listitem>
          <para>Reports on how badly fragmented a particular file might be</para>
          <indexterm zone="ch-system-e2fsprogs filefrag">
            <primary sortas="b-filefrag">filefrag</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fsck.ext2">
        <term><command>fsck.ext2</command></term>
        <listitem>
          <para>By default checks <systemitem class="filesystem">ext2</systemitem>
          file systems and is a hard link to <command>e2fsck</command></para>
          <indexterm zone="ch-system-e2fsprogs fsck.ext2">
            <primary sortas="b-fsck.ext2">fsck.ext2</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fsck.ext3">
        <term><command>fsck.ext3</command></term>
        <listitem>
          <para>By default checks <systemitem class="filesystem">ext3</systemitem>
          file systems and is a hard link to <command>e2fsck</command></para>
          <indexterm zone="ch-system-e2fsprogs fsck.ext3">
            <primary sortas="b-fsck.ext3">fsck.ext3</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="fsck.ext4">
        <term><command>fsck.ext4</command></term>
        <listitem>
          <para>By default checks <systemitem class="filesystem">ext4</systemitem>
          file systems and is a hard link to <command>e2fsck</command></para>
          <indexterm zone="ch-system-e2fsprogs fsck.ext4">
            <primary sortas="b-fsck.ext4">fsck.ext4</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="logsave">
        <term><command>logsave</command></term>
        <listitem>
          <para>Saves the output of a command in a log file</para>
          <indexterm zone="ch-system-e2fsprogs logsave">
            <primary sortas="b-logsave">logsave</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="lsattr">
        <term><command>lsattr</command></term>
        <listitem>
          <para>Lists the attributes of files on a second extended file
          system</para>
          <indexterm zone="ch-system-e2fsprogs lsattr">
            <primary sortas="b-lsattr">lsattr</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mk_cmds">
        <term><command>mk_cmds</command></term>
        <listitem>
          <para>Converts a table of command names and help messages into a C
          source file suitable for use with the <filename
          class="libraryfile">libss</filename> subsystem library</para>
          <indexterm zone="ch-system-e2fsprogs mk_cmds">
            <primary sortas="b-mk_cmds">mk_cmds</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mke2fs">
        <term><command>mke2fs</command></term>
        <listitem>
          <para>Creates an <systemitem class="filesystem">ext{234}</systemitem>
          file system on the given device</para>
          <indexterm zone="ch-system-e2fsprogs mke2fs">
            <primary sortas="b-mke2fs">mke2fs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mkfs.ext2">
        <term><command>mkfs.ext2</command></term>
        <listitem>
          <para>By default creates <systemitem class="filesystem">ext2</systemitem>
          file systems and is a hard link to <command>mke2fs</command></para>
          <indexterm zone="ch-system-e2fsprogs mkfs.ext2">
            <primary sortas="b-mkfs.ext2">mkfs.ext2</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mkfs.ext3">
        <term><command>mkfs.ext3</command></term>
        <listitem>
          <para>By default creates <systemitem class="filesystem">ext3</systemitem>
          file systems and is a hard link to <command>mke2fs</command></para>
          <indexterm zone="ch-system-e2fsprogs mkfs.ext3">
            <primary sortas="b-mkfs.ext3">mkfs.ext3</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mkfs.ext4">
        <term><command>mkfs.ext4</command></term>
        <listitem>
          <para>By default creates <systemitem class="filesystem">ext4</systemitem>
          file systems and is a hard link to <command>mke2fs</command></para>
          <indexterm zone="ch-system-e2fsprogs mkfs.ext4">
            <primary sortas="b-mkfs.ext4">mkfs.ext4</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="mklost-found">
        <term><command>mklost+found</command></term>
        <listitem>
          <para>Creates a <filename class="directory">lost+found</filename>
          directory on an <systemitem class="filesystem">ext{234}</systemitem> file
          system; it pre-allocates disk blocks to this directory to lighten the
          task of <command>e2fsck</command></para>
          <indexterm zone="ch-system-e2fsprogs mklost-found">
            <primary sortas="b-mklost+found">mklost+found</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="resize2fs">
        <term><command>resize2fs</command></term>
        <listitem>
          <para>Can be used to enlarge or shrink <systemitem
          class="filesystem">ext{234}</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs resize2fs">
            <primary sortas="b-resize2fs">resize2fs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tune2fs">
        <term><command>tune2fs</command></term>
        <listitem>
          <para>Adjusts tunable file system parameters on <systemitem
          class="filesystem">ext{234}</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs tune2fs">
            <primary sortas="b-tune2fs">tune2fs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libcom_err">
        <term><filename class="libraryfile">libcom_err</filename></term>
        <listitem>
          <para>The common error display routine</para>
          <indexterm zone="ch-system-e2fsprogs libcom_err">
            <primary sortas="c-libcom_err">libcom_err</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libe2p">
        <term><filename class="libraryfile">libe2p</filename></term>
        <listitem>
          <para>Used by <command>dumpe2fs</command>, <command>chattr</command>,
          and <command>lsattr</command></para>
          <indexterm zone="ch-system-e2fsprogs libe2p">
            <primary sortas="c-libe2p">libe2p</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libext2fs">
        <term><filename class="libraryfile">libext2fs</filename></term>
        <listitem>
          <para>Contains routines to enable user-level programs to manipulate
          <systemitem class="filesystem">ext{234}</systemitem> file systems</para>
          <indexterm zone="ch-system-e2fsprogs libext2fs">
            <primary sortas="c-libext2fs">libext2fs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libss">
        <term><filename class="libraryfile">libss</filename></term>
        <listitem>
          <para>Used by <command>debugfs</command></para>
          <indexterm zone="ch-system-e2fsprogs libss">
            <primary sortas="c-libss">libss</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>