Disk Imaging

A common complaint is how slow the dd command is when copying disk to disk.

I performed some simple tests with an existing disk image on a SATA disk and copying that image to a PATA disk. The disk image size was 20 GB.

The default dd block size is 512 bytes. This can indeed be slow. With the default block size the dd command took about 45 minutes to copy the 20 GB image.

Bumping the bs option to 4 megabytes (4M) improved the copy time to about 15 minutes. Bumping to 64M added no notable improvement.

The cat command took about 15 minutes, about the same time as the bs=4M option.

Another common complaint is the dd command terminating abruptly before completing the disk copy. Often this is caused by bad sectors on the destination disk. There are two ways to resolve that problem.

The first approach is to perform a full zero write (dd if=/dev/zero) to the destination disk to trigger the disk firmware to map bad blocks.

The second method with dd is using the conv=noerrors,sync option to instruct the dd command to ignore disk errors and continue operation.

Posted: Category: Tutorial Tagged: General

Next: Running Windows in Linux

Previous: Cleaning Linux Systems