Manpage/btrfs-check

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(Update from git, v4.7+)
(remove content)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
=btrfs-check(8) manual page=
 
 
{{GeneratedManpage
 
{{GeneratedManpage
 
|name=btrfs-check}}
 
|name=btrfs-check}}
 
==NAME==
 
btrfs-check - check or repair an unmounted btrfs filesystem
 
 
==SYNOPSIS==
 
 
<p><b>btrfs check</b> [options] <em>&lt;device&gt;</em></p>
 
==DESCRIPTION==
 
 
<p>The filesystem checker is used to verify structural integrity of a filesystem
 
and attempt to repair it if requested. The filesystem must be unmounted.</p>
 
<p>By default, <b>btrfs check</b> will not modify the device but you can reaffirm that
 
by the option <em>--readonly</em>.</p>
 
<p><b>btrfsck</b> is an alias of <b>btrfs check</b> command and is now deprecated.</p>
 
<blockquote><b>Warning:</b>
 
Do not use <em>--repair</em> unless you are adviced to by a developer, an
 
experienced user or accept the fact that <em>fsck</em> cannot possibly fix all sorts
 
of damage that could happen to a filesystem because of software and hardware
 
bugs.</blockquote>
 
<p>The structural integrity check verifies if internal filesystem objects or
 
data structures satisfy the constraints, point to the right objects or are
 
correctly connected together.</p>
 
<p>There are several cross checks that can detect wrong reference counts of shared
 
extents, backrefrences, missing extents of inodes, directory and inode
 
connectivity etc.</p>
 
<p>The amount of memory required can be high, depending on the size of the
 
filesystem, smililarly the run time.</p>
 
==SAFE OR ADVISORY OPTIONS==
 
 
<dl>
 
<dt>
 
-b|--backup
 
<dd>
 
<p>
 
use the first valid set of backup roots stored in the superblock
 
</p>
 
<p>This can be combined with <em>--super</em> if some of the superblocks are damaged.</p>
 
 
<dt>
 
--check-data-csum
 
<dd>
 
<p>
 
verify checksums of data blocks
 
</p>
 
<p>This expects that the filesystem is otherwise
 
OK, so this is basically and offline <em>scrub</em> but does not repair data from
 
spare coipes.</p>
 
 
<dt>
 
--chunk-root <em>&lt;bytenr&gt;</em>
 
<dd>
 
<p>
 
use the given offset <em>bytenr</em> for the chunk tree root
 
</p>
 
 
<dt>
 
-E|--subvol-extents <em>&lt;subvolid&gt;</em>
 
<dd>
 
<p>
 
show extent state for the given subvolume
 
</p>
 
 
<dt>
 
-p|--progress
 
<dd>
 
<p>
 
indicate progress at various checking phases
 
</p>
 
 
<dt>
 
--qgroup-report
 
<dd>
 
<p>
 
verify qgroup accounting and compare against filesystem accounting
 
</p>
 
 
<dt>
 
-r|--tree-root <em>&lt;bytenr&gt;</em>
 
<dd>
 
<p>
 
use the given offset <em>bytenr</em> for the tree root
 
</p>
 
 
<dt>
 
--readonly
 
<dd>
 
<p>
 
(default)
 
run in read-only mode, this option exists to calm potential panic when users
 
are going to run the checker
 
</p>
 
 
<dt>
 
-s|--super <em>&lt;superblock&gt;</em>
 
<dd>
 
<p>
 
use 'superblock&#8217;th superblock copy, valid values are 0, 1 or 2 if the
 
respective superblock offset is within the device size
 
</p>
 
<p>This can be used to use a different starting point if some of the primary
 
superblock is damaged.</p>
 
 
</dl>
 
==DANGEROUS OPTIONS==
 
 
<dl>
 
<dt>
 
--repair
 
<dd>
 
<p>
 
enable the repair mode and attempt to fix problems where possible
 
</p>
 
 
<dt>
 
--init-csum-tree
 
<dd>
 
<p>
 
create a new checksum tree and recalculate checksums in all files
 
</p>
 
<blockquote><b>Note:</b>
 
Do not blindly use this option to fix checksum mismatch problems.</blockquote>
 
 
<dt>
 
--init-extent-tree
 
<dd>
 
<p>
 
build the extent tree from scratch
 
</p>
 
<blockquote><b>Note:</b>
 
Do not use unless you know what you&#8217;re doing.</blockquote>
 
 
<dt>
 
--mode=MODE
 
<dd>
 
<p>
 
select mode of operation regarding memory and IO
 
</p>
 
<p>The <em>MODE</em> can be one of <em>original</em> and <em>lowmem</em>. The original mode is mostly
 
unoptimized regarding memory consumpption and can lead to out-of-memory
 
conditions on large filesystems. The possible workaround is to export the block
 
device over network to a machine with enough memory. The low memory mode is
 
supposed to address the memory consumption, at the cost of increased IO when it
 
needs to re-read blocks when needed. This may increase run time.</p>
 
 
</dl>
 
<blockquote><b>Note:</b>
 
<em>lowmem</em> mode does not work with <em>--repair</em> yet, and is still considered
 
experimental.</blockquote>
 
==EXIT STATUS==
 
 
<p><b>btrfs check</b> returns a zero exit status if it succeeds. Non zero is
 
returned in case of failure.</p>
 
==AVAILABILITY==
 
 
<p><b>btrfs</b> is part of btrfs-progs.
 
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
 
further details.</p>
 
==SEE ALSO==
 
 
<p>[[Manpage/mkfs.btrfs|mkfs.btrfs(8)]],
 
[[Manpage/btrfs-scrub|btrfs-scrub(8)]],
 
[[Manpage/btrfs-rescue|btrfs-rescue(8)]]</p>
 
[[Category:Manpage]]
 

Latest revision as of 12:28, 12 January 2022

Note: manual pages are located at read-the-docs site, please update your links.


Personal tools