Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Repair mode basics

Darren Ldl edited this page Apr 5, 2019 · 2 revisions

Repair

Typical command invocation

blkar repair CONTAINER

The command will display a warning message about risk of repair mode, as the mode modifies the container in-place. This may damage the container further and prohibit further analysis and repairs. It is best to make a backup copy of the container before trying to repair.

If you only want to see if repairs would be successful, you can supply the --dry-run flag, then all repairs will only be done in memory, and the container is not modified

You may find the verbose flag especially useful in this mode, as it will display all the repairs, and whether the repairs were successful or not

Sample run

$ blkar repair test.sbx -v
Warning :

    Repair mode modifies the SBX container in-place

    This may cause further damage to the container and prohibit further
    data recovery if incorrect automatic repairs are made

    It is advisable to make a copy of the container and work on the copy
    rather than repairing the original container directly

Do you wish to continue? [y/N] y
Press Ctrl-C to interrupt
Reference block scanning progress
Time elapsed : 00:00:00  Average rate :      2K bytes/s

Using metadata block as reference block, SBX version 17, located at byte 0 (0x0)

Using burst error resistance level 0 for the container

SBX block repairing progress
Replaced invalid metadata block at 512 (0x200) with reference block

Repair failed     for block set [1..=12], failed   block no. : 1 at byte 1536 (0x600)
2 at byte 2048 (0x800)
3 at byte 2560 (0xA00)
Repair successful for block set [421..=432], repaired block no. : 428 at byte 220160 (0x35C00)
Repair successful for block set [985..=996], repaired block no. : 990 at byte 507904 (0x7C000)
Repair successful for block set [1213..=1224], repaired block no. : 1220 at byte 625664 (0x98C00)
Repair successful for block set [1861..=1872], repaired block no. : 1864 at byte 955392 (0xE9400)

Time elapsed : 00:00:00  Average rate :     25K blocks/s
SBX version                              : 17
Block size used in checking              : 512
Number of blocks processed               : 2547
Number of blocks passed check (metadata) : 2
Number of blocks passed check (data)     : 2537
Number of blocks failed check            : 8
Number of blocks repaired (metadata)     : 1
Number of blocks repaired (data)         : 4
Number of blocks failed to repair (data) : 3
Time elapsed                             : 00:00:00
Some repairs failed

..= denotes inclusive range, it is borrowed from Rust's syntax