DD
Introduction
This article is about how to use the DD command for a variety of tasks. It is simple, yet powerful and versatile tool. That can be used to copy from source to destination, block-by-block, regardless of their filesystem types or operating systems.
Guide
- To Display Current Partition Table For Drives -
# fdisk -l
- Creating A Bootable Live USB For GNU/Linux (Replace X With Drive Letter) -
# dd bs=4M if=/path/to/disc-image.iso of=/dev/sdx && sync
- Imaging A Drive (Replace X With Drive Letter) -
# dd if=/dev/sdx conv=sync,noerror bs=64K | gzip -c > /mnt/sdx/sdx.img.gz
- Restore A Drive (Replace X With Drive Letter) -
# gunzip -c /mnt/sdx/sdx.img.gz | dd of=/dev/hda conv=sync,noerror bs=64K
DD is the command to make a bit-by-bit copy of “if=/dev/sdx” as the input file to “of=/mnt/sdx/sdx.img.gz” as the output file. Everything from the partition will go into an output file named “sdx.img.gz”.
“conv=sync,noerror” tells DD that if it can’t read a block due to a read error, then it should at least write something to its output of the correct length. Even if your hard disk exhibits no errors, remember that DD will read every single block, including any blocks which the OS avoids using because it has marked them as bad.
“bs=64K” is the block size of 64x1024 Bytes. Using this large of block size speeds up the copying process. The output of the DD command is then piped through gzip to compress it.nder helps you with this by rotating the focusing ring on the lens, the range finder will update accordingly to help you get the focus perfect on the photograph. If you want to use the rangefinder, please make sure that it has been turned on in the setup menu.
Links
- Linux Web Log “Image Your Hard Drive Using DD” - Link
Contact
If you need any advice or comments about this article, either email me at info@matthew-allan.co.uk or comment below this article. Thanks.