dd Linux Commands
What is Linux dd Command?
Explanation
dd COMMAND:dd command is used to dump the data. The data in a file or device or partition can be dumped to another file or device or partition. This command is also used for creating bootable devices.
SYNTAX :
dd [options]
OPTIONS:
| -if |
Specifies the input device or partition (or) file from which data is to be dumped |
| -of |
Specifies the output device or partition (or) file to which data is to be dumped |
| -ibs |
Specifies how many bytes is to be readed from a input file at a time during the dumping process |
| -obs |
Specifies how many bytes is to be written to the output file at a time during the dumping process |
| -bs |
Specifies how many bytes is to be readed and written at a time during the dumping process |
| -count=[bytes] |
Specifies how many bytes is to be dumped from 'if' to 'of' |
EXAMPLE:
- To create bootable floppy :
dd if=diskboot.img of=/dev/fd0
This command creates the bootable floppy.
| In above command: |
| diskboot.img | -Is the bootable image |
| /dev/fd0 | -Is a floppy disk |
- To import the data from one hard-disk to another hard-disk:
dd if=/dev/sda of=/dev/sdb
| In above command: |
| /dev/sda | -Is the hard-disk from which data is dumped |
| /dev/sdb | -Is the hard-disk to which data is dumped |
- To import the data from one partition to another partition:
dd if=/dev/sda1 of=/dev/sda2
| /dev/sda1 | -Is the partition from which data is dumped |
| /dev/sda2 | -Is the partition to which data in /dev/sda1 is dumped |
- To Specify number of bytes readed and written at a time during dumping:
dd if=/dev/sda1 of=/dev/sda2 bs=2100
The above command will dump data from /dev/sda1 to /dev/sda2 by reading and writing 2100 bytes at a time.