Repository navigation
Verification
verify checks readable disc contents without repairing or changing the
payload. It supports raw and DAR layouts, including packed and legacy discs.
# Disc in the auto-detected drive.
bd-archive verify
# A specific drive, mounted/prepared disc root, or optional ISO image.
bd-archive verify /dev/sr0
bd-archive verify /mnt/disc
bd-archive verify /data/photos-gen1/discs/disc_0001
bd-archive verify /data/photos-gen1/images/disc_0001.isoFor a copied disc, pass the copied disc root, including checksums and
recovery files. For an ISO, pass the image file; a create output directory is not
expanded into its disc folders or images by verify. That expansion belongs to extract -i.
Current raw discs are recognized by the .bd-archive/raw-v3 marker; their
checksums and recovery files are under .bd-archive/, and the root README.txt
is not payload. Older raw discs are recognized by recovery.par2 or
checksums.sha512 at the disc root, or under .bd-archive/ for the oldest
layout; no marker is required for them. Root verification files take precedence
over metadata-like names inside the payload folder.
PAR2 is preferred when present. It checks the data described by its index and the recovery packets, without a second full SHA-512 read. A PAR2 failure does not fall back to SHA-512 to hide damaged recovery information.
PAR2 verification hashes one file at a time (-T1) to avoid competing reads
and repeated seeks on optical drives. This also applies to post-burn checks
and verification of folders and ISO images. Files are processed individually;
this does not guarantee strictly increasing physical sector order.
During the PAR2 source-file scan, one live line shows the aggregate scan percentage, the estimated average throughput, the remaining scan time and the file currently being read, for example:
Scanning: 17.6% | 34.2 MiB/s | ETA 19m08s | disc_0001/channels/UC0s46sfQ…/tPbN5XSTOjs.mkv
Intact files produce no output of their own. Damaged, missing and unreadable files are each reported once on a permanent line above the live line, with the path relative to the disc root:
[WARN] photos/2024/IMG_0001.jpg - damaged (found 3 of 17 blocks)
[WARN] photos/2024/IMG_0002.jpg - missing
[WARN] photos/2024/IMG_0003.jpg - unreadable (Input/output error)
Scanning: 94.9% | 24.6 MiB/s | ETA 1m36s | photos/2024/IMG_0004.jpg
PAR2's own summary (Repair is required., block counts) and the final result
line still follow the scan. The file name is shortened in the middle to fit the
terminal width; PAR2 itself already shortens names longer than 56 characters.
These estimates use PAR2's reported data size, aggregate scan percentage and elapsed source-scan time; they require no additional payload reads. The ETA covers the source scan, not recovery-packet loading or the entire verification command. Damaged/missing files or changing drive speed can affect accuracy. Estimates appear after measurable progress; separate extra-file scans show the live line without estimates. This display also applies to post-burn PAR2 verification. Terminals update in place; redirected scan logs update at most every five seconds, plus completion, list problem files the same way and do not show the file being read. Repair output is unchanged.
Without PAR2:
- Raw discs use their SHA-512 manifest and require it to cover all payload files.
- DAR slices and unprotected catalogs use sibling
.sha512files. - Packed discs can mix PAR2-protected archives with checksum-only archives.
Missing, empty or malformed manifests, missing payload, hash mismatches and a
directory with nothing verifiable fail verification. Python performs SHA-512
checks; the external sha512sum program is not needed for bd-archive verify.
PAR2 verifies its recorded files, not every possible object on a disc. Raw PAR2 protects non-empty file contents, not empty files, directories or filesystem metadata. To additionally check all raw manifest entries, run from the disc root:
sha512sum -c .bd-archive/checksums.sha512For raw discs with root-level metadata, use sha512sum -c checksums.sha512.
In current DAR creation, PAR2 is generated for data slices, not the isolated
catalog. The verifier skips a separate catalog SHA-512 pass for a generation
that has PAR2 indices in the same folder. To explicitly check a catalog sidecar,
change into its archive folder and use sha512sum -c on that sidecar.
extract separately checks collected isolated catalogs before using them.
An OK result means the checks performed passed. It does not prove that you have
all discs or all generations of an archive, and it does not replace a trial
restore. extract -i checks staged slices but only fetches PAR2 when they fail;
use verify as well to inspect recovery data before burning.
| Code | Meaning after an integrity check |
|---|---|
0 |
OK: checked data is intact |
1 |
REPAIRABLE: PAR2 reports damage that can be repaired |
2 |
BROKEN: damage cannot be repaired with available recovery, or verification is missing/invalid |
Operational failures such as a nonexistent path, missing dependency or mount failure also exit with 1. Read the diagnostic output before treating code 1 as proof that repair is possible. Ctrl+C/EOF cancellation through the top-level handler exits with 130; invalid CLI syntax uses argparse's exit code 2.
For default folder output, this loop stops at the first non-OK result:
for disc in /data/photos-gen1/discs/disc_*/; do
bd-archive verify "$disc" || break
doneFor optional ISO output:
for iso in /data/photos-gen1/images/disc_*.iso; do
bd-archive verify "$iso" || break
doneISO checks require working udisks2, D-Bus and mount permissions. Each image is loop-mounted read-only and detached afterwards. On a physical disc, the tool tries a normal mount, then udisks2 when available.
For damage, follow Raw disc repair or DAR restoration.
Getting started
Create archives
Use your archives
Reference