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