Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mailinglists35
Created November 23, 2018 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mailinglists35/81011ec29bfe02d45f5b8956091e25e7 to your computer and use it in GitHub Desktop.
Save mailinglists35/81011ec29bfe02d45f5b8956091e25e7 to your computer and use it in GitHub Desktop.
speed up dd_rhelp
# cat `which watch_dd_rhelper`
#!/bin/bash
PREVIOUS=/tmp/previous
LAST=/tmp/last
reset=false
while true; do
[ "$reset" == "false" ] || reset=false
cat /proc/$(pidof dd_rescue)/io > $PREVIOUS
sleep 10
cat /proc/$(pidof dd_rescue)/io > $LAST
if [ "x$(diff -q $PREVIOUS $LAST)" == "x" ]; then
kill -SIGINT $(pidof dd_rescue)
reset=true
echo -n "dd_rescue hung, restarting..."
else echo -n "ok..."
fi
done
@mailinglists35
Copy link
Author

no data read in 10 seconds => give up and try a different area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment