btrfs-check - check or repair an unmounted btrfs filesystem


   btrfs check [options] <device>


   The filesystem checker is used to verify structural integrity of a
   filesystem and attempt to repair it if requested. The filesystem must
   be unmounted.

   By default, btrfs check will not modify the device but you can reaffirm
   that by the option --readonly.

   btrfsck is an alias of btrfs check command and is now deprecated.

       Do not use --repair unless you are adviced to by a developer, an
       experienced user or accept the fact that fsck cannot possibly fix
       all sorts of damage that could happen to a filesystem because of
       software and hardware bugs.

   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.

   There are several cross checks that can detect wrong reference counts
   of shared extents, backrefrences, missing extents of inodes, directory
   and inode connectivity etc.

   The amount of memory required can be high, depending on the size of the
   filesystem, smililarly the run time.


       use the first valid set of backup roots stored in the superblock

       This can be combined with --super if some of the superblocks are

       verify checksums of data blocks

       This expects that the filesystem is otherwise OK, so this is
       basically and offline scrub but does not repair data from spare

   --chunk-root <bytenr>
       use the given offset bytenr for the chunk tree root

   -E|--subvol-extents <subvolid>
       show extent state for the given subvolume

       indicate progress at various checking phases

       verify qgroup accounting and compare against filesystem accounting

   -r|--tree-root <bytenr>
       use the given offset bytenr for the tree root

       (default) run in read-only mode, this option exists to calm
       potential panic when users are going to run the checker

   -s|--super <superblock>
       use 'superblock’th superblock copy, valid values are 0, 1 or 2 if
       the respective superblock offset is within the device size

       This can be used to use a different starting point if some of the
       primary superblock is damaged.


       enable the repair mode and attempt to fix problems where possible

       create a new checksum tree and recalculate checksums in all files

           Do not blindly use this option to fix checksum mismatch

       build the extent tree from scratch

           Do not use unless you know what you’re doing.

       select mode of operation regarding memory and IO

       The MODE can be one of original and lowmem. 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.

       lowmem mode does not work with --repair yet, and is still
       considered experimental.


   btrfs check returns a zero exit status if it succeeds. Non zero is
   returned in case of failure.


   btrfs is part of btrfs-progs. Please refer to the btrfs wiki for further details.


   mkfs.btrfs(8), btrfs-scrub(8), btrfs-rescue(8)

More Linux Commands

svndumpfilter(1) - Filter a subversion repository 'dumpfile'
svndumpfilter.1 - Subversion is a version control system, which allows you to keep old versions of files and directories (usually source code), keep a log of wh

sigrelse(3) - System V signal API - Linux manual page.......
These functions are provided in glibc as a compatibility interface for programs that make use of the historical System V signal API. This API is obsolete: new a

SDL_CondBroadcast(3) - Restart all threads waiting on a cond
Restarts all threads that are waiting on the condition variable, cond. Returns 0 on success, or -1 on an error. SEE ALSO SDL_CondSignal, SDL_CondWait SDL_CondBr

cacheflush(2) - flush contents of instruction and/or data ca
cacheflush() flushes the contents of the indicated cache(s) for the user addresses in the range addr to (addr+nbytes-1). cache may be one of: ICACHE Flush the i

_tracecchar_t(3ncurses) - curses debugging routines.........
The trace routines are used for debugging the ncurses libraries, as well as applications which use the ncurses libraries. These functions are normally available

glutSpaceballMotionFunc(3) - sets the Spaceball motion callb
glutSpaceballMotionFunc sets the Spaceball motion callback for the current window. The Spaceball motion callback for a window is called when the window has Spac

optionNextValue(3) get the next value from a hierarchical li
This routine will return the next entry after the entry passed in. At the end of the list, NULL will be returned. If the entry is not found on the list, NULL wi

perlhist(1) - the Perl history records - Linux manual page
This document aims to record the Perl source code releases. INTRODUCTION Perl history in brief, by Larry Wall: Perl 0 introduced Perl to my officemates. Perl 1

gnutls_x509_rdn_get(3) - API function - Linux manual page...
This function will return the name of the given RDN sequence. The name will be in the form C=xxxx,O=yyyy,CN=zzzz as described in RFC2253. RETURNS On success, GN

assume_default_colors(3ncurses) - use terminal's default col
assume_default_colors.3ncurses - The use_default_colors() and assume_default_colors() functions are extensions to the curses library. They are used with termina

endfsent(3) - handle fstab entries - Linux manual page......
endfsent.3 - These functions read from the file /etc/fstab. The struct fstab is defined by: struct fstab { char *fs_spec; /* block device name */ char *fs_file;

Xinerama(3) - API for Xinerama extension to X11 Protocol....
Xinerama is a simple library designed to interface the Xinerama Extension for retrieving information about physical output devices which may be combined into a

We can't live, work or learn in freedom unless the software we use is free.