Created
July 29, 2023 10:22
-
-
Save MDeiml/9a83bbd11f3b075a71b8313787c5c7c0 to your computer and use it in GitHub Desktop.
ddrescue -- power drive off and on after every slow read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DRIVE=sda | |
IMAGE= | |
MAPFILE= | |
until ddrescue /dev/$DRIVE $IMAGE $MAPFILE -n -a 10M --max-slow-reads=0 | |
do | |
sleep 5 | |
echo "turning off $DRIVE" | |
echo 1 >/sys/block/$DRIVE/device/delete | |
sleep 5 | |
echo "turning on $DRIVE" | |
echo "- - -" >/sys/class/scsi_host/host0/scan | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not tested yet