Skip to main content
Clarify potential corruption point
Source Link
Chris Davies
  • 128.3k
  • 16
  • 179
  • 324

If you use dd with a compressed stream but without iblock=fullblock you are likely to end up with a corrupted image. It's much easier just to use cat (or in this case, gzip) and dispense with the complexities of dd entirely:

ssh -n [email protected] shell 'gzip </dev/md0' >md0_monSecondary.gz

If the server on 192.0.0.0 really cannot handle gzip directly from a device, for example if it's based on BSD rather than Linux, then use this. But only use this variant as a last resort:

ssh -n [email protected] shell 'dd bs=128M if=/dev/md0 | gzip' >md0_monSecondary.gz

The shell component of the command line is very unusual. I assume it's something related to the type of server you're using. For a normal server you wouldn't need it at all.

Bear in mind that if /dev/md0 is still mounted as a filesystem on the remote server while you're copying it the resulting image is highly likely to be corrupted. If you're lucky you'll notice straightaway. If you're not, then the potential corruption will sit there until you need the image restored.

If you use dd with a compressed stream but without iblock=fullblock you are likely to end up with a corrupted image. It's much easier just to use cat (or in this case, gzip) and dispense with the complexities of dd entirely:

ssh -n [email protected] shell 'gzip </dev/md0' >md0_monSecondary.gz

If the server on 192.0.0.0 really cannot handle gzip directly from a device, for example if it's based on BSD rather than Linux, then use this. But only use this variant as a last resort:

ssh -n [email protected] shell 'dd bs=128M if=/dev/md0 | gzip' >md0_monSecondary.gz

The shell component of the command line is very unusual. I assume it's something related to the type of server you're using. For a normal server you wouldn't need it at all.

Bear in mind that if /dev/md0 is mounted as a filesystem on the remote server the image is highly likely to be corrupted. If you're lucky you'll notice straightaway. If you're not, then the potential corruption will sit there until you need the image restored.

If you use dd with a compressed stream but without iblock=fullblock you are likely to end up with a corrupted image. It's much easier just to use cat (or in this case, gzip) and dispense with the complexities of dd entirely:

ssh -n [email protected] shell 'gzip </dev/md0' >md0_monSecondary.gz

If the server on 192.0.0.0 really cannot handle gzip directly from a device, for example if it's based on BSD rather than Linux, then use this. But only use this variant as a last resort:

ssh -n [email protected] shell 'dd bs=128M if=/dev/md0 | gzip' >md0_monSecondary.gz

The shell component of the command line is very unusual. I assume it's something related to the type of server you're using. For a normal server you wouldn't need it at all.

Bear in mind that if /dev/md0 is still mounted as a filesystem on the remote server while you're copying it the resulting image is highly likely to be corrupted. If you're lucky you'll notice straightaway. If you're not, then the potential corruption will sit there until you need the image restored.

Source Link
Chris Davies
  • 128.3k
  • 16
  • 179
  • 324

If you use dd with a compressed stream but without iblock=fullblock you are likely to end up with a corrupted image. It's much easier just to use cat (or in this case, gzip) and dispense with the complexities of dd entirely:

ssh -n [email protected] shell 'gzip </dev/md0' >md0_monSecondary.gz

If the server on 192.0.0.0 really cannot handle gzip directly from a device, for example if it's based on BSD rather than Linux, then use this. But only use this variant as a last resort:

ssh -n [email protected] shell 'dd bs=128M if=/dev/md0 | gzip' >md0_monSecondary.gz

The shell component of the command line is very unusual. I assume it's something related to the type of server you're using. For a normal server you wouldn't need it at all.

Bear in mind that if /dev/md0 is mounted as a filesystem on the remote server the image is highly likely to be corrupted. If you're lucky you'll notice straightaway. If you're not, then the potential corruption will sit there until you need the image restored.