Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you clone a drive?

broaches drive recovery.

How do you clone a drive?

by  Grenage  Posted    (Edited  )
Cloning a drive is a relatively simple process, and does not require any fancy software. In the case of drive recovery, see the bottom section of this FAQ. For making a copy of a drive, you will need:

Source Drive (the drive you wish to copy).
Destination Drive (the drive you wish to copy to).
Linux Live CD (I recommend Knoppix: http://www.knoppix.net/).
A functional computer and drive cables.

1) Connect both drives to the computer you are using to perform the clone. If using EIDE it is faster to have one drive per cable, but not essential.

2) Insert the Live CD into your CDROM and boot from it.

3) When loaded, open up a terminal; if your Live CD has no GUI, this obviously does not apply.

4) Become the root user (either "su" or "sudo su").

5) Perform "fdisk -l" and check the read-out. Your source and destination drives should be listed; if the destination drive is new then you will probably be informed that the drive does not have a valid partition table. Make a note of the names given to your drives (eg:/dev/sda, /dev/sdb). Names with a number following them (/dev/sda1) are partitions on the host drive (sda1 is a partition on sda).

6) "dd if=/dev/sda of=/dev/sdb bs=4096" where 'sda' is the source disk and 'sdb' is the destination disk. Do not get these the wrong way around, or you will end up cloning the empty/destination drive onto your source drive.

7) Leave it to run, a 100GB drive may take an hour or more


If you are attempting to clone a failing drive, you will want to avoid the above command. For speed it takes larger sections of data at once, if any of it cannot be read then dd will blank out the remainder. Your best bet here is to try dd_rescue:

Perform steps 1-5, but for step 6 run "dd_rescue /dev/sda /dev/sdb" where 'sda' is the source disk and 'sdb' is the destination disk. Depending on the extent of damage, this could take a while.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top