25 lines
599 B
Bash
25 lines
599 B
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
# Based on Forensic Wiki recomendations:
|
||
|
# http://www.forensicswiki.org/wiki/Ddrescue#Partition_recovery
|
||
|
#
|
||
|
# Usage: ddrescue_wrapper.sh DEVNAME TASKNAME
|
||
|
|
||
|
export DEVNAME=$1
|
||
|
export TASKNAME=$2
|
||
|
|
||
|
# Step 1
|
||
|
[ -f step1.done ] || \
|
||
|
ddrescue --no-scrape ${DEVNAME} ${TASKNAME}.img ${TASKNAME}.log && \
|
||
|
touch step1.done
|
||
|
|
||
|
# Step 2
|
||
|
[ -f step2.done ] || \
|
||
|
ddrescue --direct --retry-passes=3 ${DEVNAME} ${TASKNAME}.img ${TASKNAME}.log && \
|
||
|
touch step2.done
|
||
|
|
||
|
# Step 3
|
||
|
[ -f step2.done ] || \
|
||
|
ddrescue --direct --retrim --retry-passes=3 ${DEVNAME} ${TASKNAME}.img ${TASKNAME}.log && \
|
||
|
touch step3.done
|