Wednesday, October 26, 2005

dd - How to create a bit-for-bit copy of a disk?

Lets say you have a hard drive on /dev/hd1 that you would like to copy to /dev/hd2, you can use dd as follows

dd if=/dev/hd1 of=/dev/hd2 bs=1024



This will create a bit-for-bit copy of the original hard drive.

dd allows you to convert and copy a file with many cool options.


dd - convert and copy a file

SYNOPSIS
dd [OPTION]...

DESCRIPTION
Copy a file, converting and formatting according to the options.

bs=BYTES
force ibs=BYTES and obs=BYTES

cbs=BYTES
convert BYTES bytes at a time

conv=KEYWORDS
convert the file as per the comma separated keyword list

count=BLOCKS
copy only BLOCKS input blocks

ibs=BYTES
read BYTES bytes at a time

if=FILE
read from FILE instead of stdin

obs=BYTES
write BYTES bytes at a time

of=FILE
write to FILE instead of stdout

seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output

skip=BLOCKS
skip BLOCKS ibs-sized blocks at start of input

--help display this help and exit

0 Comments:

Post a Comment

<< Home