6.49. E2fsprogs-1.43.1

#### Linux From Scratch - Version 7.10-rc1

### Chapter 6. Installing Basic System Software

- Prev

  Procps-ng-3.3.12

- Next

  Coreutils-8.25

- Up
- Home

# 6.49. E2fsprogs-1.43.1

The E2fsprogs package contains the utilities for handling the `ext2` file system. It also supports the `ext3` and `ext4` journaling file systems.

Approximate build time: 2.7 SBU
Required disk space: 48 MB

## 6.49.1. Installation of E2fsprogs

First, fix a script that adjusts testing output:

    sed -i -e 's:\[\.-\]::' tests/filter.sed

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

    mkdir -v build
    cd build

Prepare E2fsprogs for compilation:

    LIBS=-L/tools/lib                    \
    CFLAGS=-I/tools/include              \
    PKG_CONFIG_PATH=/tools/lib/pkgconfig \
    ../configure --prefix=/usr           \
                 --bindir=/bin           \
                 --with-root-prefix=""   \
                 --enable-elf-shlibs     \
                 --disable-libblkid      \
                 --disable-libuuid       \
                 --disable-uuidd         \
                 --disable-fsck

The meaning of the environment variable and configure options:

`PKG_CONFIG_PATH, LIBS, CFLAGS`

  These variables enable e2fsprogs to be built using the Section 5.33, “Util-linux-2.28.1” package built earlier.

`--with-root-prefix=""` and `--bindir=/bin`

  Certain programs (such as the e2fsck program) are considered essential programs. When, for example, `/usr` is not mounted, these programs still need to be available. They belong in directories like `/lib` and `/sbin`. If this option is not passed to E2fsprogs' configure, the programs are installed into the `/usr` directory.

`--enable-elf-shlibs`

  This creates the shared libraries which some programs in this package use.

`--disable-*`

  This prevents E2fsprogs from building and installing the `libuuid` and `libblkid` libraries, the `uuidd` daemon, and the fsck wrapper, as Util-Linux installs more recent versions.

Compile the package:

    make

To set up and run the test suite we need to first link some libraries from /tools/lib to a location where the test programs look. To run the tests, issue:

    ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib
    make LD_LIBRARY_PATH=/tools/lib check

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 Section 2.5, “Creating a File System on the Partition” and Section 2.7, “Mounting the New Partition” for details on creating and enabling swap space.

Install the binaries, documentation, and shared libraries:

    make install

Install the static libraries and headers:

    make install-libs

Make the installed static libraries writable so debugging symbols can be removed later:

    chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a

This package installs a gzipped `.info` file but doesn't update the system-wide `dir` file. Unzip this file and then update the system `dir` file using the following commands.

    gunzip -v /usr/share/info/libext2fs.info.gz
    install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info

If desired, create and install some additional documentation by issuing the following commands:

    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

## 6.49.2. Contents of E2fsprogs

Installed programs: badblocks, chattr, compile_et, debugfs, dumpe2fs,e2freefrag, e2fsck, e2image, e2label, e2undo, e4defrag, filefrag, fsck.ext2, fsck.ext3, fsck.ext4, fsck.ext4dev, logsave, lsattr, mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.ext4dev, mklost+found, resize2fs, and tune2fs
Installed libraries: libcom_err.so, libe2p.so, libext2fs.so, and libss.so
Installed directories: /usr/include/e2p, /usr/include/et, /usr/include/ext2fs, /usr/include/ss, /usr/share/et, and /usr/share/ss

### Short Descriptions

badblocks | Searches a device (usually a disk partition) for bad blocks
chattr | Changes the attributes of files on an `ext2` file system; it also changes `ext3` file systems, the journaling version of `ext2` file systems
compile_et | An error table compiler; it converts a table of error-code names and messages into a C source file suitable for use with the `com_err` library
debugfs | A file system debugger; it can be used to examine and change the state of an `ext2` file system
dumpe2fs | Prints the super block and blocks group information for the file system present on a given device
e2freefrag | Reports free space fragmentation information
e2fsck | Is used to check, and optionally repair `ext2` file systems and `ext3` file systems
e2image | Is used to save critical `ext2` file system data to a file
e2label | Displays or changes the file system label on the `ext2` file system present on a given device
e2undo | Replays the undo log undo_log for an ext2/ext3/ext4 filesystem found on a device [This can be used to undo a failed operation by an e2fsprogs program.]
e4defrag | Online defragmenter for ext4 filesystems
filefrag | Reports on how badly fragmented a particular file might be
fsck.ext2 | By default checks `ext2` file systems and is a hard link to e2fsck
fsck.ext3 | By default checks `ext3` file systems and is a hard link to e2fsck
fsck.ext4 | By default checks `ext4` file systems and is a hard link to e2fsck
fsck.ext4dev | By default checks `ext4` development file systems and is a hard link to e2fsck
logsave | Saves the output of a command in a log file
lsattr | Lists the attributes of files on a second extended file system
mk_cmds | Converts a table of command names and help messages into a C source file suitable for use with the `libss` subsystem library
mke2fs | Creates an `ext2` or `ext3` file system on the given device
mkfs.ext2 | By default creates `ext2` file systems and is a hard link to mke2fs
mkfs.ext3 | By default creates `ext3` file systems and is a hard link to mke2fs
mkfs.ext4 | By default creates `ext4` file systems and is a hard link to mke2fs
mkfs.ext4dev | By default creates `ext4` development file systems and is a hard link to mke2fs
mklost+found | Used to create a `lost+found` directory on an `ext2` file system; it pre-allocates disk blocks to this directory to lighten the task of e2fsck
resize2fs | Can be used to enlarge or shrink an `ext2` file system
tune2fs | Adjusts tunable file system parameters on an `ext2` file system
`libcom_err` | The common error display routine
`libe2p` | Used by dumpe2fs, chattr, and lsattr
`libext2fs` | Contains routines to enable user-level programs to manipulate an `ext2` file system
`libss` | Used by debugfs

- Prev

  Procps-ng-3.3.12

- Next

  Coreutils-8.25

- Up
- Home