[1f1a9e9] | 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 |
|
---|
[8dfc5c3] | 7 | <!ENTITY btrfs-progs-download-http "&kernel-dl;/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v&btrfs-progs-version;.tar.xz">
|
---|
[1f1a9e9] | 8 | <!ENTITY btrfs-progs-download-ftp " ">
|
---|
[cabcb6b9] | 9 | <!ENTITY btrfs-progs-md5sum "1b5705b3e9503f09a9598dad1e7bfbc8">
|
---|
[416be1c9] | 10 | <!ENTITY btrfs-progs-size "3.0 MB">
|
---|
[cabcb6b9] | 11 | <!ENTITY btrfs-progs-buildsize "62 MB (transient files created during tests need up to 10 GB)">
|
---|
| 12 | <!ENTITY btrfs-progs-time "0.2 SBU (add 3.8 SBU for tests, up to 80 SBU on slow disks if reiserfsprogs is installed)">
|
---|
[1f1a9e9] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="btrfs-progs" xreflabel="btrfs-progs-&btrfs-progs-version;">
|
---|
| 16 | <?dbhtml filename="btrfs-progs.html"?>
|
---|
| 17 |
|
---|
| 18 |
|
---|
| 19 | <title>btrfs-progs-&btrfs-progs-version;</title>
|
---|
| 20 |
|
---|
| 21 | <indexterm zone="btrfs-progs">
|
---|
| 22 | <primary sortas="a-btrfs-progs">btrfs-progs</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to btrfs-progs</title>
|
---|
| 27 |
|
---|
[29244b7] | 28 | <para>
|
---|
| 29 | The <application>btrfs-progs</application> package contains
|
---|
| 30 | administration and debugging tools for the B-tree file system (btrfs).
|
---|
| 31 | </para>
|
---|
[1f1a9e9] | 32 |
|
---|
[fbd04125] | 33 | &lfs120_checked;
|
---|
[1f1a9e9] | 34 |
|
---|
| 35 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 36 | <itemizedlist spacing="compact">
|
---|
| 37 | <listitem>
|
---|
[29244b7] | 38 | <para>
|
---|
| 39 | Download (HTTP): <ulink url="&btrfs-progs-download-http;"/>
|
---|
| 40 | </para>
|
---|
[1f1a9e9] | 41 | </listitem>
|
---|
| 42 | <listitem>
|
---|
[29244b7] | 43 | <para>
|
---|
| 44 | Download (FTP): <ulink url="&btrfs-progs-download-ftp;"/>
|
---|
| 45 | </para>
|
---|
[1f1a9e9] | 46 | </listitem>
|
---|
| 47 | <listitem>
|
---|
[29244b7] | 48 | <para>
|
---|
| 49 | Download MD5 sum: &btrfs-progs-md5sum;
|
---|
| 50 | </para>
|
---|
[1f1a9e9] | 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
[29244b7] | 53 | <para>
|
---|
| 54 | Download size: &btrfs-progs-size;
|
---|
| 55 | </para>
|
---|
[1f1a9e9] | 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
[29244b7] | 58 | <para>
|
---|
| 59 | Estimated disk space required: &btrfs-progs-buildsize;
|
---|
| 60 | </para>
|
---|
[1f1a9e9] | 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
[29244b7] | 63 | <para>
|
---|
| 64 | Estimated build time: &btrfs-progs-time;
|
---|
| 65 | </para>
|
---|
[1f1a9e9] | 66 | </listitem>
|
---|
| 67 | </itemizedlist>
|
---|
[5ff076a6] | 68 | <!--
|
---|
[ef94f43] | 69 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 70 | <itemizedlist spacing="compact">
|
---|
| 71 | <listitem>
|
---|
| 72 | <para>
|
---|
| 73 | Required patch if building with linux kernel headers version
|
---|
| 74 | before 5.12:
|
---|
| 75 | <ulink url="&patch-root;/btrfs-progs-&btrfs-progs-version;-headers_fix-1.patch"/>
|
---|
| 76 | </para>
|
---|
| 77 | </listitem>
|
---|
| 78 | </itemizedlist>
|
---|
[5ff076a6] | 79 | -->
|
---|
[1f1a9e9] | 80 | <bridgehead renderas="sect3">Btrfs-progs Dependencies</bridgehead>
|
---|
| 81 |
|
---|
[61439d5] | 82 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 83 | <para role="required">
|
---|
[8558044] | 84 | <xref linkend="lzo"/>
|
---|
[61439d5] | 85 | </para>
|
---|
[f7b3469] | 86 | <!-- In v6.2.1 (and maybe previous), sphinx is required for the doc
|
---|
[1f1a9e9] | 87 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 88 | <para role="recommended">
|
---|
[6f75ffc] | 89 | <xref linkend="asciidoc"/> (or <xref role="nodep" linkend="asciidoctor"/>)
|
---|
| 90 | and <xref linkend="xmlto"/> (both required to generate man pages)
|
---|
[1f1a9e9] | 91 | </para>
|
---|
[f7b3469] | 92 | -->
|
---|
[292a840] | 93 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 94 | <para role="optional">
|
---|
[27cee7a] | 95 | <xref linkend="lvm2"/> (<command>dmsetup</command> is used in tests),
|
---|
[1fe05eb] | 96 | <xref linkend="reiserfs"/> (for tests), and
|
---|
[3b32f8a4] | 97 | <xref linkend="sphinx"/> (required to build documentation)
|
---|
[27cee7a] | 98 |
|
---|
[292a840] | 99 | </para>
|
---|
| 100 |
|
---|
[1f1a9e9] | 101 |
|
---|
| 102 | </sect2>
|
---|
| 103 |
|
---|
| 104 | <sect2 role="kernel" id="btrfs-progs-kernel">
|
---|
| 105 | <title>Kernel Configuration</title>
|
---|
| 106 |
|
---|
[29244b7] | 107 | <para>
|
---|
| 108 | Enable the following option in the kernel configuration
|
---|
| 109 | and recompile the kernel:
|
---|
| 110 | </para>
|
---|
[1f1a9e9] | 111 |
|
---|
[d67d543] | 112 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 113 | href="btrfs-progs-kernel.xml"/>
|
---|
[1f1a9e9] | 114 |
|
---|
[8388aa7] | 115 | <para>
|
---|
| 116 | In addition to the above and to the options required for
|
---|
| 117 | <xref linkend="lvm2"/> and <xref linkend="reiserfs"/>, the following
|
---|
| 118 | options must be enabled for running tests:
|
---|
| 119 | </para>
|
---|
| 120 |
|
---|
[d67d543] | 121 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 122 | href="btrfs-progs-test-kernel.xml"/>
|
---|
[1f1a9e9] | 123 |
|
---|
| 124 | <indexterm zone="btrfs-progs btrfs-progs-kernel">
|
---|
[2630345] | 125 | <primary sortas="d-btrfs-progs">BTRFS Programs</primary>
|
---|
[1f1a9e9] | 126 | </indexterm>
|
---|
| 127 |
|
---|
| 128 | </sect2>
|
---|
| 129 |
|
---|
| 130 | <sect2 role="installation">
|
---|
| 131 | <title>Installation of btrfs-progs</title>
|
---|
[ef94f43] | 132 |
|
---|
[29244b7] | 133 | <para>
|
---|
| 134 | Install <application>btrfs-progs</application> by running the following
|
---|
| 135 | commands:
|
---|
| 136 | </para>
|
---|
[7b2b4b11] | 137 |
|
---|
[827154b] | 138 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 139 | --disable-static \
|
---|
| 140 | --disable-documentation &&
|
---|
[1f1a9e9] | 141 | make</userinput></screen>
|
---|
| 142 |
|
---|
[29244b7] | 143 | <note>
|
---|
| 144 | <para>
|
---|
| 145 | Some tests require grep built with perl regular expressions. To
|
---|
[170e308] | 146 | obtain this, rebuild grep with the LFS Chapter 8 instructions after
|
---|
[4bd4b77] | 147 | installing <xref linkend="pcre2"/>.
|
---|
[29244b7] | 148 | </para>
|
---|
| 149 | </note>
|
---|
[85ac148] | 150 | <!-- Keeping this for now, but it seems that calling "make test" is
|
---|
[16d563c] | 151 | simpler and does the same thing -->
|
---|
[29244b7] | 152 | <para>
|
---|
[16d563c] | 153 | Before running tests, build a support program:
|
---|
[29244b7] | 154 | </para>
|
---|
[1f1a9e9] | 155 |
|
---|
[85ac148] | 156 | <screen remap="test"><userinput>make fssum</userinput></screen>
|
---|
[32bc8e4c] | 157 |
|
---|
[29244b7] | 158 | <para>
|
---|
[b0d1dc0] | 159 | To test the results, issue (as the &root; user):
|
---|
[29244b7] | 160 | </para>
|
---|
[32bc8e4c] | 161 |
|
---|
[5af02b37] | 162 | <screen role="root" remap="test"><userinput>pushd tests
|
---|
[85ac148] | 163 | ./fsck-tests.sh
|
---|
| 164 | ./mkfs-tests.sh
|
---|
| 165 | ./cli-tests.sh
|
---|
[827154b] | 166 | sed 's/,orphan_file//' /etc/mke2fs.conf >./custom_mke2fs.conf &&
|
---|
| 167 | export MKE2FS_CONFIG=$PWD/custom_mke2fs.conf &&
|
---|
[85ac148] | 168 | ./convert-tests.sh
|
---|
[827154b] | 169 | unset MKE2FS_CONFIG && rm custom_mke2fs.conf
|
---|
[85ac148] | 170 | ./misc-tests.sh
|
---|
[27cee7a] | 171 | ./fuzz-tests.sh
|
---|
[32bc8e4c] | 172 | popd</userinput></screen>
|
---|
[b0d1dc0] | 173 |
|
---|
[16d563c] | 174 | <!-- Template for failed test removal:
|
---|
[8388aa7] | 175 | <para>
|
---|
[37ede2a] | 176 | To test the results, first disable one test that fails and prevents
|
---|
[8388aa7] | 177 | the other ones to run:
|
---|
| 178 | </para>
|
---|
| 179 |
|
---|
[37ede2a] | 180 | <screen remap="test"><userinput>mv tests/fsck-tests/012-leaf-corruption/test.sh{,.broken}</userinput></screen>
|
---|
[8558044] | 181 | Substitute your test failure with the one above.
|
---|
[85ac148] | 182 | <para>
|
---|
| 183 | To test the results, run (as the
|
---|
[949387d0] | 184 | <systemitem class="username">root</systemitem> user):
|
---|
[85ac148] | 185 | </para>
|
---|
| 186 |
|
---|
[8388aa7] | 187 | <screen role="root" remap="test"><userinput>make -j1 -k test</userinput></screen>
|
---|
[16d563c] | 188 | -->
|
---|
[85ac148] | 189 | <note>
|
---|
| 190 | <para>
|
---|
| 191 | If the above mentioned kernel options are not enabled, some tests
|
---|
[416be1c9] | 192 | fail, and prevent all the remaining tests from running because the test
|
---|
[85ac148] | 193 | disk image is not cleanly unmounted.
|
---|
| 194 | </para>
|
---|
| 195 | </note>
|
---|
[416be1c9] | 196 | <!-- Now passes in version 6.3.1.
|
---|
[85ac148] | 197 | <para>
|
---|
[b0d1dc0] | 198 | The mkfs test 025-zoned-parallel is known to fail.
|
---|
[85ac148] | 199 | </para>
|
---|
[416be1c9] | 200 | -->
|
---|
[29244b7] | 201 | <para>
|
---|
[b0d1dc0] | 202 | Install the package as the &root; user:
|
---|
[29244b7] | 203 | </para>
|
---|
[1f1a9e9] | 204 |
|
---|
[16d563c] | 205 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
[1f1a9e9] | 206 |
|
---|
[f7b3469] | 207 | <para>
|
---|
| 208 | If you have passed <parameter>--disable-documentation</parameter> to
|
---|
| 209 | <command>configure</command> and you need the manual pages, install them
|
---|
| 210 | by running, as the &root; user:
|
---|
| 211 | </para>
|
---|
| 212 |
|
---|
| 213 | <screen role="root"><userinput>for i in 5 8; do
|
---|
| 214 | install Documentation/*.$i /usr/share/man/man$i
|
---|
| 215 | done</userinput></screen>
|
---|
| 216 |
|
---|
[1f1a9e9] | 217 | </sect2>
|
---|
| 218 |
|
---|
| 219 | <sect2 role="commands">
|
---|
| 220 | <title>Command Explanations</title>
|
---|
| 221 |
|
---|
[827154b] | 222 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 223 | href="../../xincludes/static-libraries.xml"/>
|
---|
| 224 |
|
---|
[29244b7] | 225 | <para>
|
---|
[f7b3469] | 226 | <parameter>--disable-documentation</parameter>: This switch
|
---|
| 227 | disables rebuilding the manual pages, because it requires
|
---|
| 228 | <xref linkend="sphinx"/>.
|
---|
[29244b7] | 229 | </para>
|
---|
| 230 | <para>
|
---|
[827154b] | 231 | <command>sed 's/,orphan_file//" ...</command>: In this version of
|
---|
| 232 | <application>btrfs-progs</application>, the
|
---|
| 233 | <command>btrfs-convert</command> program produces a btrfs filesystem
|
---|
| 234 | containing errors if converting from an ext4 filesystem created
|
---|
| 235 | with the <quote>orphan_file</quote> feature. This command creates
|
---|
| 236 | a custom configuration file that prevents creating a filesystem
|
---|
| 237 | with this feature.
|
---|
[29244b7] | 238 | </para>
|
---|
[827154b] | 239 | <!--
|
---|
[29244b7] | 240 | <para>
|
---|
[8558044] | 241 | <command>ln -s ... /usr/lib/libbtrfs.so</command>: Creates a
|
---|
[29244b7] | 242 | symbolic link in the directory where it is expected.
|
---|
| 243 | </para>
|
---|
[1f1a9e9] | 244 |
|
---|
[29244b7] | 245 | <para>
|
---|
| 246 | <command>rm /lib/libbtrfs.{a,so}</command>: Removes unneeded
|
---|
| 247 | library entries.
|
---|
| 248 | </para>
|
---|
[16d563c] | 249 | -->
|
---|
[1f1a9e9] | 250 | </sect2>
|
---|
| 251 |
|
---|
[827154b] | 252 | <sect2 role="using" id="using-btrfs-convert">
|
---|
| 253 | <title>Using the btrfs-convert Program</title>
|
---|
| 254 |
|
---|
| 255 | <para>
|
---|
| 256 | This version of <application>btrfs-progs</application> does not convert
|
---|
| 257 | correctly ext4 filesystems to btrfs if the ext4
|
---|
| 258 | <option>orphan_file</option> feature is turned on. If you happen to
|
---|
| 259 | convert such a filesystem, you need to first run:
|
---|
| 260 | </para>
|
---|
| 261 |
|
---|
| 262 | <screen role="nodump"><userinput>tune2fs -O ^orphan_file <replaceable>/dev/sdxx</replaceable></userinput></screen>
|
---|
| 263 |
|
---|
| 264 | <para>
|
---|
| 265 | where <filename>/dev/sdxx</filename> is the partition of the filesystem
|
---|
| 266 | you want to convert.
|
---|
| 267 | </para>
|
---|
| 268 | </sect2>
|
---|
| 269 |
|
---|
[1f1a9e9] | 270 | <sect2 role="content">
|
---|
| 271 | <title>Contents</title>
|
---|
| 272 |
|
---|
| 273 | <segmentedlist>
|
---|
| 274 | <segtitle>Installed Programs</segtitle>
|
---|
| 275 | <segtitle>Installed Libraries</segtitle>
|
---|
| 276 | <segtitle>Installed Directories</segtitle>
|
---|
| 277 |
|
---|
| 278 | <seglistitem>
|
---|
| 279 | <seg>
|
---|
| 280 | btrfs,
|
---|
| 281 | btrfs-convert,
|
---|
| 282 | btrfs-find-root,
|
---|
| 283 | btrfs-image,
|
---|
| 284 | btrfs-map-logical,
|
---|
| 285 | btrfs-select-super,
|
---|
| 286 | btrfsck (link to btrfs),
|
---|
| 287 | btrfstune,
|
---|
| 288 | fsck.btrfs, and
|
---|
| 289 | mkfs.btrfs
|
---|
| 290 | </seg>
|
---|
| 291 |
|
---|
[5d01724] | 292 | <seg>
|
---|
| 293 | libbtrfs.so and
|
---|
| 294 | libbtrfsutil.so
|
---|
| 295 | </seg>
|
---|
[1f1a9e9] | 296 |
|
---|
| 297 | <seg>/usr/include/btrfs</seg>
|
---|
| 298 | </seglistitem>
|
---|
| 299 | </segmentedlist>
|
---|
| 300 |
|
---|
| 301 | <variablelist>
|
---|
| 302 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 303 | <?dbfo list-presentation="list"?>
|
---|
| 304 | <?dbhtml list-presentation="table"?>
|
---|
| 305 |
|
---|
| 306 | <varlistentry id="btrfs-prog">
|
---|
| 307 | <term><command>btrfs</command></term>
|
---|
| 308 | <listitem>
|
---|
| 309 | <para>
|
---|
[4c24eb0a] | 310 | is the main interface into btrfs filesystem operations
|
---|
[1f1a9e9] | 311 | </para>
|
---|
| 312 | <indexterm zone="btrfs-progs btrfs-prog">
|
---|
| 313 | <primary sortas="b-btrfs">btrfs</primary>
|
---|
| 314 | </indexterm>
|
---|
| 315 | </listitem>
|
---|
| 316 | </varlistentry>
|
---|
| 317 |
|
---|
[292a840] | 318 | <varlistentry id="btrfs-convert">
|
---|
| 319 | <term><command>btrfs-convert</command></term>
|
---|
| 320 | <listitem>
|
---|
| 321 | <para>
|
---|
[827154b] | 322 | converts from an ext2/3/4 or reiserfs filesystem to btrfs (see
|
---|
| 323 | <xref linkend="using-btrfs-convert"/> above)
|
---|
[292a840] | 324 | </para>
|
---|
| 325 | <indexterm zone="btrfs-progs btrfs-convert">
|
---|
| 326 | <primary sortas="b-btrfs-convert">btrfs-convert</primary>
|
---|
| 327 | </indexterm>
|
---|
| 328 | </listitem>
|
---|
| 329 | </varlistentry>
|
---|
| 330 |
|
---|
| 331 | <varlistentry id="btrfs-find-root">
|
---|
| 332 | <term><command>btrfs-find-root</command></term>
|
---|
| 333 | <listitem>
|
---|
| 334 | <para>
|
---|
[4c24eb0a] | 335 | is a filter to find btrfs root
|
---|
[292a840] | 336 | </para>
|
---|
| 337 | <indexterm zone="btrfs-progs btrfs-find-root">
|
---|
| 338 | <primary sortas="b-btrfs-find-root">btrfs-find-root</primary>
|
---|
| 339 | </indexterm>
|
---|
| 340 | </listitem>
|
---|
| 341 | </varlistentry>
|
---|
| 342 |
|
---|
| 343 | <varlistentry id="btrfs-map-logical">
|
---|
| 344 | <term><command>btrfs-map-logical</command></term>
|
---|
| 345 | <listitem>
|
---|
| 346 | <para>
|
---|
[4c24eb0a] | 347 | maps btrfs logical extent to physical extent
|
---|
[292a840] | 348 | </para>
|
---|
| 349 | <indexterm zone="btrfs-progs btrfs-map-logical">
|
---|
| 350 | <primary sortas="b-btrfs-map-logical">btrfs-map-logical</primary>
|
---|
| 351 | </indexterm>
|
---|
| 352 | </listitem>
|
---|
| 353 | </varlistentry>
|
---|
| 354 |
|
---|
| 355 | <varlistentry id="btrfs-select-super">
|
---|
| 356 | <term><command>btrfs-select-super</command></term>
|
---|
| 357 | <listitem>
|
---|
| 358 | <para>
|
---|
[4c24eb0a] | 359 | overwrites the primary superblock with a backup copy
|
---|
[292a840] | 360 | </para>
|
---|
| 361 | <indexterm zone="btrfs-progs btrfs-select-super">
|
---|
| 362 | <primary sortas="b-btrfs-select-super">btrfs-select-super</primary>
|
---|
| 363 | </indexterm>
|
---|
| 364 | </listitem>
|
---|
| 365 | </varlistentry>
|
---|
| 366 |
|
---|
| 367 | <varlistentry id="btrfstune">
|
---|
| 368 | <term><command>btrfstune</command></term>
|
---|
| 369 | <listitem>
|
---|
| 370 | <para>
|
---|
[4c24eb0a] | 371 | tunes various filesystem parameters
|
---|
[292a840] | 372 | </para>
|
---|
| 373 | <indexterm zone="btrfs-progs btrfstune">
|
---|
| 374 | <primary sortas="b-btrfstune">btrfstune</primary>
|
---|
| 375 | </indexterm>
|
---|
| 376 | </listitem>
|
---|
| 377 | </varlistentry>
|
---|
| 378 |
|
---|
[1f1a9e9] | 379 | <varlistentry id="fsck.btrfs">
|
---|
| 380 | <term><command>fsck.btrfs</command></term>
|
---|
| 381 | <listitem>
|
---|
| 382 | <para>
|
---|
[4c24eb0a] | 383 | does nothing, but is present for consistency with fstab
|
---|
[1f1a9e9] | 384 | </para>
|
---|
| 385 | <indexterm zone="btrfs-progs fsck.btrfs">
|
---|
| 386 | <primary sortas="b-fsck.btrfs">fsck.btrfs</primary>
|
---|
| 387 | </indexterm>
|
---|
| 388 | </listitem>
|
---|
| 389 | </varlistentry>
|
---|
| 390 |
|
---|
| 391 | <varlistentry id="mkfs.btrfs">
|
---|
| 392 | <term><command>mkfs.btrfs</command></term>
|
---|
| 393 | <listitem>
|
---|
[29244b7] | 394 | <para>
|
---|
[4c24eb0a] | 395 | creates a btrfs file system
|
---|
[29244b7] | 396 | </para>
|
---|
[1f1a9e9] | 397 | <indexterm zone="btrfs-progs mkfs.btrfs">
|
---|
| 398 | <primary sortas="b-mkfs.btrfs">mkfs.btrfs</primary>
|
---|
| 399 | </indexterm>
|
---|
| 400 | </listitem>
|
---|
| 401 | </varlistentry>
|
---|
| 402 |
|
---|
| 403 | </variablelist>
|
---|
| 404 |
|
---|
| 405 | </sect2>
|
---|
| 406 |
|
---|
| 407 | </sect1>
|
---|