Thursday, 27 March 2014

Linux Copy One Hard Disk to Another Using dd Command

dd command can copy disk in raw format. It will copy partition table and bootloader and all partitions within this disk. For example, you can copy /dev/sda to /dev/sdb (same size) using the following dd command. dd should complete with no errors, but output the number of records read and written.

Login as the root user (use sudo or su command)

Open terminal or shell prompt and type the following dd command:
# dd if=/dev/sda of=/dev/sdb

Where,

if=/dev/sda : Input disk (source)
of=/dev/sdb : Output disk (destination)
You can also copy hard disk or partition image to another system using a network and netcat (nc) command.

No comments:

Post a Comment