PCX
Well-Known Member
- Reaction score
- 134
Main Uses for HDD Cloning.
- Upgrading from a smaller HDD to a larger HDD without losing data or programs (you will have to either resize the main partition to take up the whole drive or use the unallocated space as additional storage)
- Replace failing hard drive. (make sure you are using a hard drive that is the same size or larger.)
- Pull recovery and partial OS partitions for reinstall when no disk or product key is available. There are usually better ways around this though.
- Recovering data from drives that will not mount
There are other uses for HDD cloning, but these are the main ones that I use it for.
Installation
Open up the terminal in Ubuntu and type in
Using Gddrescue
There are several uses for Gddrescue, including data forensics and recovering data for damaged disks, but I will only go into detail about cloning HDDs.
First I will start by breaking down this code
sudo gives the user administrative privileges, you will still need to enter your password
-v is the switch that prints out the results as the cloning process is done
The -r3 switch is the number of times Gddrescue will retry to recover information from a bad block. It is really upto you how many times you want to retry bad blocks. It will take you several hours on one try alone. I usually opt out of this option unless I have ample time. Just make sure you run a chkdsk /r.
/dev/sdb is the source (HDD to be cloned) location
/dev/sdc is the target (HDD to be copied to) location
The locations of the hard drives may obviously be different depending on your set-up and location of the drives. For instance, you may actually be cloning /dev/sdc to /dev/sdb
The easiest way to find the location of the drives you are cloning is to use disk utility. Make sure you double and triple check the drive location before you start cloning, you do not want to clone the empty drive onto your customers HDD. IT WILL COPY EMPTY SPACE!
logfile is the name of the logfile saved for each cloning process. This logfile will allow you stop in the middle of a cloning process, unplug the hard drives and plug them back in at a later time and begin where you left off. You can name this anything you like, for instance, Dell-1545. Just make sure that if you stop and restart later, that you use the same logfile name. An example of this would be
Cloning process starts
Stopping the cloning process
Swap out drives, do some diagnostics, see the real progress of the cloned drive (via plugging it into the original computer), etc.
Start cloning process again
Keep in mind, that the location of the drives can change, so double and triple check them to make sure that if they need to be changed, that you change them appropriately. As long as you keep the same logfile name, it will not matter where the drives are located.
Copying Single Partitions:
This would be good if you are only trying to recover the recovery partition. You will find that will not always work due to the MBR being missing. If you are going to copy all the partitions but the main partition, make sure you maintain the same partition structure on the new drive. You can do this in Gparted.
To copy a single partition, simply ad the partition number to the end of the drive letter. For instance
You can easily find this in gparted or disk utility.
- Upgrading from a smaller HDD to a larger HDD without losing data or programs (you will have to either resize the main partition to take up the whole drive or use the unallocated space as additional storage)
- Replace failing hard drive. (make sure you are using a hard drive that is the same size or larger.)
- Pull recovery and partial OS partitions for reinstall when no disk or product key is available. There are usually better ways around this though.
- Recovering data from drives that will not mount
There are other uses for HDD cloning, but these are the main ones that I use it for.
Installation
Open up the terminal in Ubuntu and type in
Code:
sudo apt-get install gddrescue
Using Gddrescue
There are several uses for Gddrescue, including data forensics and recovering data for damaged disks, but I will only go into detail about cloning HDDs.
First I will start by breaking down this code
Code:
sudo ddrescue -v -r3 /dev/sdb /dev/sdc logfile
sudo gives the user administrative privileges, you will still need to enter your password
-v is the switch that prints out the results as the cloning process is done
The -r3 switch is the number of times Gddrescue will retry to recover information from a bad block. It is really upto you how many times you want to retry bad blocks. It will take you several hours on one try alone. I usually opt out of this option unless I have ample time. Just make sure you run a chkdsk /r.
/dev/sdb is the source (HDD to be cloned) location
/dev/sdc is the target (HDD to be copied to) location
The locations of the hard drives may obviously be different depending on your set-up and location of the drives. For instance, you may actually be cloning /dev/sdc to /dev/sdb
Code:
sudo ddrescue -v -r3 /dev/sdc /dev/sdb logfile
The easiest way to find the location of the drives you are cloning is to use disk utility. Make sure you double and triple check the drive location before you start cloning, you do not want to clone the empty drive onto your customers HDD. IT WILL COPY EMPTY SPACE!
logfile is the name of the logfile saved for each cloning process. This logfile will allow you stop in the middle of a cloning process, unplug the hard drives and plug them back in at a later time and begin where you left off. You can name this anything you like, for instance, Dell-1545. Just make sure that if you stop and restart later, that you use the same logfile name. An example of this would be
Cloning process starts
Code:
sudo ddrescue -v -r3 /dev/sdb /dev/sdc Dell-1545
Stopping the cloning process
Code:
CTRL + C
Swap out drives, do some diagnostics, see the real progress of the cloned drive (via plugging it into the original computer), etc.
Start cloning process again
Code:
sudo ddrescue -v -r3 /dev/sdb /dev/sdc Dell-1545
Keep in mind, that the location of the drives can change, so double and triple check them to make sure that if they need to be changed, that you change them appropriately. As long as you keep the same logfile name, it will not matter where the drives are located.
Copying Single Partitions:
This would be good if you are only trying to recover the recovery partition. You will find that will not always work due to the MBR being missing. If you are going to copy all the partitions but the main partition, make sure you maintain the same partition structure on the new drive. You can do this in Gparted.
Code:
sudo apt-get install gparted
To copy a single partition, simply ad the partition number to the end of the drive letter. For instance
Code:
sudo ddrescue -v -r3 /dev/sdc1 /dev/sdb1 logfile
You can easily find this in gparted or disk utility.
Last edited: