# ddrescue (BRINTOS-149) — GNU ddrescue 1.28: data recovery / block copier # with mapfile resume. A C++ tool, built against the exceptions-off libc++ arm # (wasmc++-glibc): it carries no throw/try/catch of its own, so -fno-exceptions # costs it nothing. . "$BST_LIB" require ddrescue ddrescue/present tmp=${TMPDIR:-/tmp}/bst-ddrescue.$$ mkdir "$tmp" 2>/dev/null check_out ddrescue/version "GNU ddrescue 1.28" ddrescue -V # regular-file copy with a mapfile: the everyday rescue shape i=0 while [ $i -lt 64 ]; do printf 'block-%04d 0123456789abcdef\n' $i; i=$((i+1)); done > "$tmp/in.bin" check ddrescue/copy-rc ddrescue -q "$tmp/in.bin" "$tmp/out.bin" "$tmp/map" check ddrescue/roundtrip cmp "$tmp/in.bin" "$tmp/out.bin" # the mapfile records the rescue and ends finished ('+' status) check_out ddrescue/map-header "Created by GNU ddrescue" cat "$tmp/map" if grep -q '^0x[0-9A-Fa-f]* *0x[0-9A-Fa-f]* *+' "$tmp/map"; then bst_ok ddrescue/map-finished else bst_notok ddrescue/map-finished "no finished (+) block in mapfile"; fi # resume against a finished mapfile is a clean no-op check ddrescue/resume-rc ddrescue -q "$tmp/in.bin" "$tmp/out.bin" "$tmp/map" # ddrescuelog ships alongside; -D exits 0 only when the rescue is finished check_out ddrescuelog/version "GNU ddrescuelog 1.28" ddrescuelog -V check ddrescuelog/done-status ddrescuelog -D "$tmp/map" rm -rf "$tmp"