summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/restore-image.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index c167c4e1d..ade481511 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -215,8 +215,12 @@ function write_image()
*) uncomp=cat ;;
esac
+ if [ -s /tmp/fdisk.log ]; then
+ skipstart='dd of=/dev/null bs=1 count=32256 &>/dev/null;'
+ fi
+
# the actual dumping command, from image to disk
- ${uncomp} ${images_dir}/${image} | (dd of=/dev/null bs=1 count=32256 &>/dev/null; dd bs=4M of=/dev/${root} >/tmp/backup.out) &
+ ${uncomp} ${images_dir}/${image} | (${skipstart} dd bs=4M of=/dev/${root} >/tmp/backup.out 2>&1>>/tmp/log) &
sleep 3
pid=$(ps ax | grep 'dd bs=4M of' | grep -v grep | awk '{ print $1 }')