btrfs-select-super — overwrite primary superblock with a backup copy

Synopsis

btrfs-select-super -s number <device>

Description

Destructively overwrite all copies of the superblock with a specified copy. This helps in certain cases, for example when write barriers were disabled during a power failure and not all superblocks were written, or if the primary superblock is damaged, eg. accidentally overwritten.

The filesystem specified by device must not be mounted.

Note

Prior to overwriting the primary superblock, please make sure that the backup copies are valid!

To dump a superblock use the btrfs inspect-internal dump-super command.

Then run the check (in the non-repair mode) using the command btrfs check -s where -s specifies the superblock copy to use.

Superblock copies exist in the following offsets on the device:

A superblock size is 4KiB (4096).

Options

-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

See Also

btrfs-inspect-internal(8), btrfsck check(8)

Info

07/26/2019 Btrfs v5.2.1 Btrfs Manual