How to run Btrfs check on mounted filesystem?

How to run Btrfs check on mounted filesystem?

It is recommended to unmount the filesystem prior to running the check, but it is possible to start checking a mounted filesystem (see –force ). 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.

What to do if you get a Btrfs error?

Only if everything else fails, run ‘btrfs check’ and research if repair could possibly fix this issue. WARNING: If in doubt, open a case with Support. ‘btrfs check –repair’ run with a version which can’t fix the particular issue might make things worse.

When to use the–repair flag in Btrfs?

It is extremely important that you ensure a backup has been created before invoking ‘–repair’. If any doubt open a support request first, before attempting a repair. Use this flag at your own risk. If you do not perform a backup and use an old kernel and old btrfs tool to attempt your repair, you may cause your data to be lost permanently.

Can a fsck repair a Btrfs filesystem?

Do not use –repair unless you are advised to do so by a developer or an experienced user, and then only after having accepted that no fsck successfully repair all types of filesystem corruption. Eg. some other software or hardware bugs can fatally damage a volume.

Which is the checksum algorithm used in Btrfs?

The currently used and the only one checksum algorithm that’s implemented in btrfs is crc32c, with 32bit digest. It has served well for the years but has some weaknesses so we’re looking for a replacements and also for enhancing the use cases based on possibly better hash algorithms.

What to do if superblocks are damaged in Btrfs?

This can be combined with –super if some of the superblocks are damaged. This expects that the filesystem is otherwise OK, and is basically and offline scrub but does not repair data from spare copies. (default) run in read-only mode, this option exists to calm potential panic when users are going to run the checker