DD Command Usage
* Example use of dd command to create an ISO disk image from a CD-ROM: dd if=/dev/cdrom of=/home/sam/myCD.iso bs=2048 conv=sync *Using dd to wipe an entire disk with random data: dd if=/dev/urandom of=/dev/hda *Using dd to clone a hard disk to another hard disk: dd if=/dev/ad0 of=/dev/ad1 bs=1M conv=noerror *Duplicate a disk partition as a disk image file on a remote machine over a secure ssh connection: dd if=/dev/sdb2 | ssh user@host “dd of=/home/user/partition.image” *Overwrite the first 512 bytes of a file with null bytes: dd if=/dev/zero of=path/to/file bs=512 count=1 conv=notrunc *To duplicate a disk partition as a disk image file on a different partition: dd if=/dev/sdb2 of=/home/sam/partition.image bs=4096 conv=noerror *Create a 1 GiB file containing only zeros (bs=blocksize, count=number of blocks): dd if=/dev/zero of=file1G.tmp bs=1M count=1024 *To zero out a drive: dd if=/dev/zero of=/dev/sda *To make sure that the drive is really zeroed out: dd if=/dev/sda | hexdump -C | h