[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[1f1a9e9] | 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 " ">
|
---|
[90696a3b] | 9 | <!ENTITY btrfs-progs-md5sum "e22810ab7d616b5628b7912923ff127b">
|
---|
[f484ed33] | 10 | <!ENTITY btrfs-progs-size "2.5 MB">
|
---|
[9f285828] | 11 | <!ENTITY btrfs-progs-buildsize "62 MB (transient files created during tests need up to 10 GB)">
|
---|
[f484ed33] | 12 | <!ENTITY btrfs-progs-time "0.3 SBU (with parallelism=4; add 2.5 SBU for tests, up to 14 SBU on slow disks)">
|
---|
[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 |
|
---|
[868811b] | 33 | &lfs121_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),
|
---|
[8674204] | 96 | <xref linkend="sphinx"/> and <xref linkend="sphinx_rtd_theme"/>
|
---|
| 97 | (required to build documentation), and
|
---|
[b643f16b] | 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
|
---|
[90696a3b] | 169 | ./convert-tests.sh
|
---|
[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 | the other ones to run:
|
---|
| 176 | </para>
|
---|
| 177 |
|
---|
[37ede2a] | 178 | <screen remap="test"><userinput>mv tests/fsck-tests/012-leaf-corruption/test.sh{,.broken}</userinput></screen>
|
---|
[8558044] | 179 | Substitute your test failure with the one above.
|
---|
[85ac148] | 180 | <para>
|
---|
| 181 | To test the results, run (as the
|
---|
[949387d0] | 182 | <systemitem class="username">root</systemitem> user):
|
---|
[85ac148] | 183 | </para>
|
---|
| 184 |
|
---|
[8388aa7] | 185 | <screen role="root" remap="test"><userinput>make -j1 -k test</userinput></screen>
|
---|
[16d563c] | 186 | -->
|
---|
[85ac148] | 187 | <note>
|
---|
| 188 | <para>
|
---|
| 189 | If the above mentioned kernel options are not enabled, some tests
|
---|
[416be1c9] | 190 | fail, and prevent all the remaining tests from running because the test
|
---|
[90696a3b] | 191 | disk image is not cleanly unmounted. Also make sure that the btrfs
|
---|
| 192 | kernel module is loaded.
|
---|
[85ac148] | 193 | </para>
|
---|
| 194 | </note>
|
---|
[f484ed33] | 195 |
|
---|
[90696a3b] | 196 | <!-- 6.8.1 - all tests went pretty fine, including the previously commented
|
---|
| 197 | convert-tests and the other two mentioned tests.
|
---|
[85ac148] | 198 | <para>
|
---|
[f484ed33] | 199 | The convert-tests scripts are known to fail.
|
---|
| 200 | Tests 004-shrink-fs and 062-fi-show-raw-dm-all-devices in the misc-tests
|
---|
| 201 | are known to fail.
|
---|
[85ac148] | 202 | </para>
|
---|
[90696a3b] | 203 | -->
|
---|
[29244b7] | 204 | <para>
|
---|
[b0d1dc0] | 205 | Install the package as the &root; user:
|
---|
[29244b7] | 206 | </para>
|
---|
[1f1a9e9] | 207 |
|
---|
[16d563c] | 208 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
[1f1a9e9] | 209 |
|
---|
[f7b3469] | 210 | <para>
|
---|
| 211 | If you have passed <parameter>--disable-documentation</parameter> to
|
---|
| 212 | <command>configure</command> and you need the manual pages, install them
|
---|
| 213 | by running, as the &root; user:
|
---|
| 214 | </para>
|
---|
| 215 |
|
---|
| 216 | <screen role="root"><userinput>for i in 5 8; do
|
---|
| 217 | install Documentation/*.$i /usr/share/man/man$i
|
---|
| 218 | done</userinput></screen>
|
---|
| 219 |
|
---|
[1f1a9e9] | 220 | </sect2>
|
---|
| 221 |
|
---|
| 222 | <sect2 role="commands">
|
---|
| 223 | <title>Command Explanations</title>
|
---|
| 224 |
|
---|
[827154b] | 225 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 226 | href="../../xincludes/static-libraries.xml"/>
|
---|
| 227 |
|
---|
[29244b7] | 228 | <para>
|
---|
[f7b3469] | 229 | <parameter>--disable-documentation</parameter>: This switch
|
---|
| 230 | disables rebuilding the manual pages, because it requires
|
---|
| 231 | <xref linkend="sphinx"/>.
|
---|
[29244b7] | 232 | </para>
|
---|
[9164647] | 233 | <!--
|
---|
[29244b7] | 234 | <para>
|
---|
[827154b] | 235 | <command>sed 's/,orphan_file//" ...</command>: In this version of
|
---|
| 236 | <application>btrfs-progs</application>, the
|
---|
| 237 | <command>btrfs-convert</command> program produces a btrfs filesystem
|
---|
| 238 | containing errors if converting from an ext4 filesystem created
|
---|
| 239 | with the <quote>orphan_file</quote> feature. This command creates
|
---|
| 240 | a custom configuration file that prevents creating a filesystem
|
---|
| 241 | with this feature.
|
---|
[29244b7] | 242 | </para>
|
---|
[9164647] | 243 | -->
|
---|
[827154b] | 244 | <!--
|
---|
[29244b7] | 245 | <para>
|
---|
[8558044] | 246 | <command>ln -s ... /usr/lib/libbtrfs.so</command>: Creates a
|
---|
[29244b7] | 247 | symbolic link in the directory where it is expected.
|
---|
| 248 | </para>
|
---|
[1f1a9e9] | 249 |
|
---|
[29244b7] | 250 | <para>
|
---|
| 251 | <command>rm /lib/libbtrfs.{a,so}</command>: Removes unneeded
|
---|
| 252 | library entries.
|
---|
| 253 | </para>
|
---|
[16d563c] | 254 | -->
|
---|
[1f1a9e9] | 255 | </sect2>
|
---|
[bef4385] | 256 | <!--
|
---|
[827154b] | 257 | <sect2 role="using" id="using-btrfs-convert">
|
---|
| 258 | <title>Using the btrfs-convert Program</title>
|
---|
[bef4385] | 259 |
|
---|
[827154b] | 260 | <para>
|
---|
| 261 | This version of <application>btrfs-progs</application> does not convert
|
---|
| 262 | correctly ext4 filesystems to btrfs if the ext4
|
---|
| 263 | <option>orphan_file</option> feature is turned on. If you happen to
|
---|
| 264 | convert such a filesystem, you need to first run:
|
---|
| 265 | </para>
|
---|
| 266 |
|
---|
| 267 | <screen role="nodump"><userinput>tune2fs -O ^orphan_file <replaceable>/dev/sdxx</replaceable></userinput></screen>
|
---|
| 268 |
|
---|
| 269 | <para>
|
---|
| 270 | where <filename>/dev/sdxx</filename> is the partition of the filesystem
|
---|
| 271 | you want to convert.
|
---|
| 272 | </para>
|
---|
| 273 | </sect2>
|
---|
[bef4385] | 274 | -->
|
---|
[827154b] | 275 |
|
---|
[1f1a9e9] | 276 | <sect2 role="content">
|
---|
| 277 | <title>Contents</title>
|
---|
| 278 |
|
---|
| 279 | <segmentedlist>
|
---|
| 280 | <segtitle>Installed Programs</segtitle>
|
---|
| 281 | <segtitle>Installed Libraries</segtitle>
|
---|
| 282 | <segtitle>Installed Directories</segtitle>
|
---|
| 283 |
|
---|
| 284 | <seglistitem>
|
---|
| 285 | <seg>
|
---|
| 286 | btrfs,
|
---|
| 287 | btrfs-convert,
|
---|
| 288 | btrfs-find-root,
|
---|
| 289 | btrfs-image,
|
---|
| 290 | btrfs-map-logical,
|
---|
| 291 | btrfs-select-super,
|
---|
| 292 | btrfsck (link to btrfs),
|
---|
| 293 | btrfstune,
|
---|
| 294 | fsck.btrfs, and
|
---|
| 295 | mkfs.btrfs
|
---|
| 296 | </seg>
|
---|
| 297 |
|
---|
[5d01724] | 298 | <seg>
|
---|
| 299 | libbtrfs.so and
|
---|
| 300 | libbtrfsutil.so
|
---|
| 301 | </seg>
|
---|
[1f1a9e9] | 302 |
|
---|
| 303 | <seg>/usr/include/btrfs</seg>
|
---|
| 304 | </seglistitem>
|
---|
| 305 | </segmentedlist>
|
---|
| 306 |
|
---|
| 307 | <variablelist>
|
---|
| 308 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 309 | <?dbfo list-presentation="list"?>
|
---|
| 310 | <?dbhtml list-presentation="table"?>
|
---|
| 311 |
|
---|
| 312 | <varlistentry id="btrfs-prog">
|
---|
| 313 | <term><command>btrfs</command></term>
|
---|
| 314 | <listitem>
|
---|
| 315 | <para>
|
---|
[4c24eb0a] | 316 | is the main interface into btrfs filesystem operations
|
---|
[1f1a9e9] | 317 | </para>
|
---|
| 318 | <indexterm zone="btrfs-progs btrfs-prog">
|
---|
| 319 | <primary sortas="b-btrfs">btrfs</primary>
|
---|
| 320 | </indexterm>
|
---|
| 321 | </listitem>
|
---|
| 322 | </varlistentry>
|
---|
| 323 |
|
---|
[292a840] | 324 | <varlistentry id="btrfs-convert">
|
---|
| 325 | <term><command>btrfs-convert</command></term>
|
---|
| 326 | <listitem>
|
---|
| 327 | <para>
|
---|
[bef4385] | 328 | converts from an ext2/3/4 or reiserfs filesystem to btrfs <!--(see
|
---|
| 329 | <xref linkend="using-btrfs-convert"/> above)-->
|
---|
[292a840] | 330 | </para>
|
---|
| 331 | <indexterm zone="btrfs-progs btrfs-convert">
|
---|
| 332 | <primary sortas="b-btrfs-convert">btrfs-convert</primary>
|
---|
| 333 | </indexterm>
|
---|
| 334 | </listitem>
|
---|
| 335 | </varlistentry>
|
---|
| 336 |
|
---|
| 337 | <varlistentry id="btrfs-find-root">
|
---|
| 338 | <term><command>btrfs-find-root</command></term>
|
---|
| 339 | <listitem>
|
---|
| 340 | <para>
|
---|
[4c24eb0a] | 341 | is a filter to find btrfs root
|
---|
[292a840] | 342 | </para>
|
---|
| 343 | <indexterm zone="btrfs-progs btrfs-find-root">
|
---|
| 344 | <primary sortas="b-btrfs-find-root">btrfs-find-root</primary>
|
---|
| 345 | </indexterm>
|
---|
| 346 | </listitem>
|
---|
| 347 | </varlistentry>
|
---|
| 348 |
|
---|
| 349 | <varlistentry id="btrfs-map-logical">
|
---|
| 350 | <term><command>btrfs-map-logical</command></term>
|
---|
| 351 | <listitem>
|
---|
| 352 | <para>
|
---|
[4c24eb0a] | 353 | maps btrfs logical extent to physical extent
|
---|
[292a840] | 354 | </para>
|
---|
| 355 | <indexterm zone="btrfs-progs btrfs-map-logical">
|
---|
| 356 | <primary sortas="b-btrfs-map-logical">btrfs-map-logical</primary>
|
---|
| 357 | </indexterm>
|
---|
| 358 | </listitem>
|
---|
| 359 | </varlistentry>
|
---|
| 360 |
|
---|
| 361 | <varlistentry id="btrfs-select-super">
|
---|
| 362 | <term><command>btrfs-select-super</command></term>
|
---|
| 363 | <listitem>
|
---|
| 364 | <para>
|
---|
[4c24eb0a] | 365 | overwrites the primary superblock with a backup copy
|
---|
[292a840] | 366 | </para>
|
---|
| 367 | <indexterm zone="btrfs-progs btrfs-select-super">
|
---|
| 368 | <primary sortas="b-btrfs-select-super">btrfs-select-super</primary>
|
---|
| 369 | </indexterm>
|
---|
| 370 | </listitem>
|
---|
| 371 | </varlistentry>
|
---|
| 372 |
|
---|
| 373 | <varlistentry id="btrfstune">
|
---|
| 374 | <term><command>btrfstune</command></term>
|
---|
| 375 | <listitem>
|
---|
| 376 | <para>
|
---|
[4c24eb0a] | 377 | tunes various filesystem parameters
|
---|
[292a840] | 378 | </para>
|
---|
| 379 | <indexterm zone="btrfs-progs btrfstune">
|
---|
| 380 | <primary sortas="b-btrfstune">btrfstune</primary>
|
---|
| 381 | </indexterm>
|
---|
| 382 | </listitem>
|
---|
| 383 | </varlistentry>
|
---|
| 384 |
|
---|
[1f1a9e9] | 385 | <varlistentry id="fsck.btrfs">
|
---|
| 386 | <term><command>fsck.btrfs</command></term>
|
---|
| 387 | <listitem>
|
---|
| 388 | <para>
|
---|
[4c24eb0a] | 389 | does nothing, but is present for consistency with fstab
|
---|
[1f1a9e9] | 390 | </para>
|
---|
| 391 | <indexterm zone="btrfs-progs fsck.btrfs">
|
---|
| 392 | <primary sortas="b-fsck.btrfs">fsck.btrfs</primary>
|
---|
| 393 | </indexterm>
|
---|
| 394 | </listitem>
|
---|
| 395 | </varlistentry>
|
---|
| 396 |
|
---|
| 397 | <varlistentry id="mkfs.btrfs">
|
---|
| 398 | <term><command>mkfs.btrfs</command></term>
|
---|
| 399 | <listitem>
|
---|
[29244b7] | 400 | <para>
|
---|
[4c24eb0a] | 401 | creates a btrfs file system
|
---|
[29244b7] | 402 | </para>
|
---|
[1f1a9e9] | 403 | <indexterm zone="btrfs-progs mkfs.btrfs">
|
---|
| 404 | <primary sortas="b-mkfs.btrfs">mkfs.btrfs</primary>
|
---|
| 405 | </indexterm>
|
---|
| 406 | </listitem>
|
---|
| 407 | </varlistentry>
|
---|
| 408 |
|
---|
| 409 | </variablelist>
|
---|
| 410 |
|
---|
| 411 | </sect2>
|
---|
| 412 |
|
---|
| 413 | </sect1>
|
---|