This bash script creates an image out of a damaged disk while trying to minimize more damage during recovery.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/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
|