Sign in with
Sign up | Sign in
Your question

How to Transfer Data Between Two Hard Drives in LINUX

Last response: in Storage
Share
February 25, 2010 9:02:28 AM

Dear sir,
Could you please tell me How to Transfer Data Between Two Hard Drives in LINUX ?
I hope a positive response from any one else,
thanks in advance
Meressa Abrha
e-mail:merchemaau@gmail.com
a c 127 G Storage
February 25, 2010 11:34:13 AM

You did not specify what kind of Linux you are using.
Also not whether your disks are SATA/PATA etc.

But generally, you can try the dd command.

First, open a terminal, and execute:

dmesg | grep sd

exactly like that, it should give you a list of your harddrives (/dev/sda or /dev/sdb). Once you know which is which, by looking at the size of the drives, you can try the dd command below:

sudo dd if=/dev/sda of=/dev/sdb bs=1M


NOTE: In this example /dev/sda is the source/read device and /dev/sdb is the target/destination device, adjust accordingly. This command will read from disk /dev/sda and write to /dev/sdb, causing /dev/sdb to be an exact copy of /dev/sda. /dev/sdb needs to be at least as large as /dev/sda.

WARNING: any mistakes with the dd-command, such as using the wrong device names, may lead to total data loss. Use with care!
a c 127 G Storage
February 25, 2010 11:35:36 AM

Note: my commands will make a clone of /dev/sda and write it to /dev/sdb. If you don't want to clone but just copy files of two normal disks with NTFS on it, you shouldn't use my dd-command.

Please in the future add more information to your query so we may help you with more targeted and specific advice.
a c 415 G Storage
February 25, 2010 4:39:05 PM

> sudo dd if=/dev/sda of=/dev/sdb bs=1M

...and just as a cautionary note - don't type this command in verbatim! As sub mesa described, make sure you know which device ("/dev/sdx") is which before you start and use the right device names in the right positions in the command. That last thing you want to do is copy in the wrong direction!
Related resources
!