Skip to content

Commit

Permalink
Fixed issue that would cause zxfer to fail with error when run from L…
Browse files Browse the repository at this point in the history
…inux with -D flag:

replaced obs=1m with obs=1048576 (same for bs=) to be compatible with both BSD and Linux versions of dd.
  • Loading branch information
zgypa committed Jan 1, 2019
1 parent aa6ac97 commit 387dc85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zxfer
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ copy_snap() {
echo "Estimated size is: ${SIZE_EST}"
PROGRESS_DIALOG=$( echo "$option_D" | sed "s#%%size%%#$SIZE_EST#g" | \
sed "s#%%title%%#$copysrc#g" )
$LZFS send "$copysrc" | dd obs=1m | dd bs=1m | $PROGRESS_DIALOG | \
$LZFS send "$copysrc" | dd obs=1048576 | dd bs=1048576 | $PROGRESS_DIALOG | \
$RZFS receive $option_F "$copydest" || \
{ echo "Error when zfs send/receiving."; beep; exit 1; }
else
Expand All @@ -420,7 +420,7 @@ copy_snap() {
PROGRESS_DIALOG=$( echo $option_D | sed "s#%%size%%#$SIZE_EST#g" | \
sed "s#%%title%%#$copysrc#g" )
$LZFS send -nv "$copysrc"
echo "$LZFS send $copysrc | dd obs=1m | dd bs=1m | $PROGRESS_DIALOG |
echo "$LZFS send $copysrc | dd obs=1048576 | dd bs=1048576 | $PROGRESS_DIALOG |
$RZFS receive $option_F $copydest"
fi
else
Expand All @@ -441,7 +441,7 @@ copy_snap() {
echo "Estimated size is: ${SIZE_EST}"
PROGRESS_DIALOG=$( echo $option_D | sed "s#%%size%%#$SIZE_EST#g" | \
sed "s#%%title%%#$copysrc#g" )
$LZFS send -i "$copyprev" "$copysrc" | dd obs=1m | dd bs=1m | \
$LZFS send -i "$copyprev" "$copysrc" | dd obs=1048576 | dd bs=1048576 | \
$PROGRESS_DIALOG | $RZFS receive $option_F "$copydest" || \
{ echo "Error when zfs send/receiving."; beep; exit 1; }
else
Expand All @@ -452,7 +452,7 @@ copy_snap() {
PROGRESS_DIALOG=$( echo $option_D | sed "s#%%size%%#$SIZE_EST#g" | \
sed "s#%%title%%#$copysrc#g" )
$LZFS send -nv -i "$copyprev" "$copysrc"
echo "$LZFS send -i $copyprev $copysrc | dd obs=1m | dd bs=1m | \
echo "$LZFS send -i $copyprev $copysrc | dd obs=1048576 | dd bs=1048576 | \
$PROGRESS_DIALOG | $RZFS receive $option_F $copydest"
fi
else
Expand Down

0 comments on commit 387dc85

Please sign in to comment.