#### Beyond Linux® From Scratch (systemd Edition) - Version 10.1

### Chapter 5. File Systems and Disk Management

- Prev

  About initramfs

- Next

  dosfstools-4.2

- Up
- Home

# btrfs-progs-5.10.1

## Introduction to btrfs-progs

The btrfs-progs package contains administration and debugging tools for the B-tree file system (btrfs).

This package is known to build and work properly using an LFS-10.1 platform.

### Package Information

- Download (HTTP): https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v5.10.1.tar.xz

- Download MD5 sum: 0ec41da8462196c17ac08f351db86912

- Download size: 2.1 MB

- Estimated disk space required: 92 MB (add 2.7 GB for tests)

- Estimated build time: 0.3 SBU (add 45 SBU for tests)

### Btrfs-progs Dependencies

#### Required

LZO-2.10

#### Recommended

asciidoc-9.1.0 and xmlto-0.0.28 (both required to generate man pages)

#### Optional

LVM2-2.03.11 (dmsetup is used in tests), Python-2.7.18 (python bindings), and reiserfsprogs-3.6.27 (for tests)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/btrfs-progs

## Kernel Configuration

Enable the following option in the kernel configuration and recompile the kernel:

    File systems --->
      <*/M> Btrfs filesystem support [CONFIG_BTRFS_FS]

### Note

CONFIG_BTRFS_FS_POSIX_ACL and CONFIG_REISERFS_FS_XATTR are required for some tests. Other Btrfs options in the kernel are optional.

## Installation of btrfs-progs

Install btrfs-progs by running the following commands:

    ./configure --prefix=/usr \
                --bindir=/bin \
                --libdir=/lib \
                --with-pkgconfigdir=/usr/lib/pkgconfig &&
    make

### Note

Some tests require grep built with perl regular expressions. To obtain this, rebuild grep with the LFS Chapter 8 instructions after installing PCRE-8.44.

Before running tests, build a support program:

    make fssum &&

    sed -i '/found/s/^/: #/' tests/convert-tests.sh &&

To test the results, issue (as the `root` user):

    pushd tests
       ./fsck-tests.sh
       ./mkfs-tests.sh
       ./cli-tests.sh
       ./convert-tests.sh
       ./misc-tests.sh
       ./fuzz-tests.sh
    popd

Install the package as the `root` user:

    make install &&

    ln -sfv ../../lib/$(readlink /lib/libbtrfs.so) /usr/lib/libbtrfs.so &&
    ln -sfv ../../lib/$(readlink /lib/libbtrfsutil.so) /usr/lib/libbtrfsutil.so &&
    rm -fv /lib/libbtrfs.{a,so} /lib/libbtrfsutil.{a,so} &&
    mv -v /bin/{mkfs,fsck}.btrfs /sbin

## Command Explanations

`--disable-documentation`: This option is needed if the recommended dependencies are not installed.

mv tests/{cli,convert,misc,fuzz}-tests/ ...: Disables tests that fail and prevent tests from completing.

ln -s ... /usr/lib/libbtrfs.so: Creates a symbolic link in the directory where it is expected.

rm /lib/libbtrfs.{a,so}: Removes unneeded library entries.

## Contents

Installed Programs: btrfs, btrfs-convert, btrfs-find-root, btrfs-image, btrfs-map-logical, btrfs-select-super, btrfsck (link to btrfs), btrfstune, fsck.btrfs, and mkfs.btrfs
Installed Libraries: libbtrfs.so and libbtrfsutil.so
Installed Directories: /usr/include/btrfs

### Short Descriptions

btrfs | is the main interface into btrfs filesystem operations
btrfs-convert | converts from an ext2/3/4 filesystem to btrfs
btrfs-find-root | is a filter to find btrfs root
btrfs-map-logical | maps btrfs logical extent to physical extent
btrfs-select-super | overwrites the primary superblock with a backup copy
btrfstune | tunes various filesystem parameters
fsck.btrfs | does nothing, but is present for consistency with fstab
mkfs.btrfs | creates a btrfs file system

Last updated on 2021-02-21 17:43:43 -0800

- Prev

  About initramfs

- Next

  dosfstools-4.2

- Up
- Home