Dd

is Article description::a utility used to copy raw data from source to sink, where source and sink can be a block device, file, or piped input/output.

Installation
As part of the GNU, is installed in any standard any Gentoo GNU/Linux system.

Emerge
In the event that coreutils goes missing:

Usage
By default takes input from, optionally manipulates the data, and writes to.

Examples
Some common tasks where is used:

Boot stick
This should work with any live media as long as the memory stick is large enough.


 * : Defines the source.
 * : Defines the sink.
 * : Defines the block size (amount of data read/written at a time). The default is 512 bytes but most modern devices can read/write much faster. It is possible to define different sizes for source and sink using  and.

Master boot record backup
To backup the master boot record (MBR), copy only the first 512 bytes:


 * : The number of blocks to copy.

Hard disk backup
To backup a complete hard disk or partition, you can boot the computer with the gentoo minimal installation CD or the gentoo admin CD.

In the following example, we will backup a computer drive on /dev/sda to an external USB drive. To be able to mount that USB drive read/write, we will use its label:

To make the backup:

To restore the backup:

Input manipulation
As an example, convert any upper case character in a file to lowercase and reverse the input per line, then pipe the output to to display the file:


 * : Revert the input per line by swapping any input byte (writing backwards).
 * : Convert any upper case letter to lower case. To convert lower case to upper case use.
 * : Continue if a read error occurs.