![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
D :
DD :
DD( :
Dd (Unix) |
|
|
Dd (Unix) dd is a common Unix program whose primary purpose is the low-level copying of files. Introductiondd has a different set of command line options than the ordinary cp command (which copies files in their entirety) that allow copying a fixed number of bytes or blocks, performing on-the-fly byte order conversions, as well as more esoteric EBCDIC to ASCII conversions. Nowadays dd is mostly used to copy regions of raw device files, e.g. backing up the boot sector of a hard disk, or to read fixed amounts of data from special files like /dev/zero or /dev/random. Because dd can copy entire partitions or disks (this is more due to Unix providing access to these devices than the functionality of dd per se), it is used in computer forensics when the contents of a partition need to be preserved in a byte-exact copy. Using cp would not be enough, since data from deleted files that may still be present on a disk are not visible through the file system interface. The command line syntax of dd is unlike that of any other Unix program, resulting in widespread fear and loathing. The fear is due to the fact that dd is used for low-level operations on hard disks: one tiny mistake, and instead of restoring a boot sector one may have rendered an entire disk virtually unusable. The loathing is triggered by the blatant violation of the Unix philosophy of using a common syntax for all command line tools. Usage dd [Operands or Options] Operands if=file - of=file - ibs=bytes - obs=bytes - bs=bytes - cvs=bytes - conv=keywords - skip=blocks - seek=blocks - Keywords When specifying conv as parameter the following keywords may be used: ascii - ebcdic - ibm - block - unblock - lcase - ucase - notrunc - swab - noerror - sync - Notes and unitsOn various systems the option --version is supported. dd will then output its version number and quit. file may be any real file or any block-device file. On certain systems bytes may be specified with multiplicative units. This units may then be: c - w - b - kD - k - MD - M - This can be carried on (if available) with G, T, P, E, Z, Y. ExamplesTo copy an imagefile of name floppy.img to a floppy-disk whose block-device name is /dev/fd0, invoke dd in the following way:
To create a file with name reallylargefile with the size of 1 GB, filled with random data, do this:
To increase writing performance obs can be increased:
Anti-examplesWARNING: If you care for your data, do NOT try this. The following examples are provided to warn about the dangers of dd, if used incorrectly: This overwrites the complete first harddisk with NULL characters:
Note that this examples are Linux-centric. On other platforms the device names may be different. Other meanings of dd In the vi editor typing of dd in command mode deletes the current line. External links
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2009 Chamas Enterprises Inc. |