What is "cloning a hard drive" and how does one go about doing it?

11

3

What does cloning a hard drive mean? Is it just simply copying over all the "CONTENT" of the hard drive EXCLUDING the operating system, drivers, all the installed programs? or is it copying the ENTIRE hard drive BIT for BIT? Is the cloned hard drive bootable?

I have an external USB hard drive and trying to make a exact copy of my computer system by cloning, so that I can connect the cloned hard drive to another machine and boot into it, or install the cloned disk on another computer system and boot into it. Is this possible? Or am I going about this totally wrong?

What is ghosting a hard drive?

ThN

Posted 2017-06-28T18:45:47.477

Reputation: 827

2Like a biological clone, the intention is that the copy is complete, fully functional and capable of action independant of the original. – Mokubai – 2017-06-28T18:56:20.730

1It is important not note that, while, as explained below, "cloning" is technically taken to mean making an exact copy, complete with OS, etc, it is apt to be used "casually" to simply mean copying off some large subset of the files. You need to establish what is actually meant in the real-life context. – Daniel R Hicks – 2017-06-29T01:42:18.550

also note that booting from USB drive is going to be slower than booting from normal SATA drive – jena – 2017-06-29T12:31:56.213

All the answers are great. I had hard time choosing one. Even though gronostaj is very thorough in his answer, I ended up choosing ianc1215, because he did provide simple explanation and answer with list of software that are available to do this with. I finally cloned my whole hardrive using Macrium Reflect Software Free Version and when you restore the cloned hardrive you get EVERYTHING back not just your files but drivers, operating system and all the programs you've installed. It is an exact copy of my old hardrive. Awesome. Thank you for all the replies. – ThN – 2017-06-30T12:54:59.370

1Cloning a system HD and boot on another machine will work as you expect only if the PC has the same hardware. – giammin – 2017-07-05T18:06:35.920

@giammin That's factually inaccurate.... For an OS like Android, which is compiled with a specific device's drivers only, that would be factual, but for an OS like Windows, Ubuntu, etc. it's wholly inaccurate. Most, if not all, modern day desktop OSes contain drivers for core system hardware, and while the system will not run in an optimal state if the OS drive is booted from a system with different Chipset, IMEI, etc. drivers, it will still boot and run. – JW0914 – 2018-08-06T03:39:55.740

Answers

7

Cloning a hard drive means to make a duplicate copy of the original source data. This duplicate copy can be either bit for bit which will duplicate EVERYTHING on the disk. Another option is to clone individual partitions, this can be useful if you only want to copy specific data such as an OS or data partition.

If I make a clone of my computer's hard disk it will be an exact duplicate (of the data that is included. To clone a hard disk you need special software.

Some examples of cloning software:

  • Clonezilla, a Linux based cloning utility
  • Acronis True Image
  • Norton Ghost

Once a drive is cloned you can use it as a bootable device (assuming you copied the bootloader data).

By the sound of it what you are trying to do is not a clone but instead what is called a sync. You want to have data reside on one computer. Then using a portable medium you want to take data to another computer for use. Yet you want both locations to remain identical.

Does that sound accurate?

ianc1215

Posted 2017-06-28T18:45:47.477

Reputation: 2 884

2The default operation mode of Clonezilla which you mentioned in the first place is to not clone bit for bit, so that kinda undermines your definition. – gronostaj – 2017-06-28T18:55:53.390

1@gronostaj Sorry about that I mispoke and did not catch my own error. Let me correct that. – ianc1215 – 2017-06-28T19:00:20.077

I strongly advise against both Acronis and Norton solutions. Acronis once was a good option, but since 2010, it is buggy and unreliable. Norton Ghost in outdated and outmoded. It does not support new hardware and new configurations. Also, both of these are costly. There excellent free solutions out there, like Veeam Agent for Windows Free edition. – None – 2017-06-29T05:49:39.937

3and dd for *NIX – OrangeDog – 2017-06-29T10:08:45.113

@ianc1215 I used Macrium Reflect Software Free Version. It did the job. Thanks. – ThN – 2017-06-30T12:56:35.693

15

Cloning a hard drive is the process of making an effective copy of the hard drive on another one. It doesn't necessarily mean that both drives are identical bit for bit, although that's an option.

Most of the time cloning means that the target drive is partitioned in a similar fashion, partitions are formatted with identical file systems and all data is copied over to analogous partitions on the target drive. Extra information that's not stored in files, such as MBR, VBRs, data hidden in partition tables are usually cloned too. (This data would be omitted in regular file system-level copy and target drive wouldn't be bootable.)

Making a bit for bit copy would count as cloning, but it's the slowest and least flexible way of doing that. It works only if target drive isn't smaller (any space surplus is wasted) and some gibberish is copied too (removed files, unused space etc.). This may be desired though, eg. when making a safe copy during recovery of a failed hard drive or in forensics.

The usually preferred way of cloning is to replicate source partitioning and copy files with consideration of file systems. If the cloning program understands how file system stores files, it can recreate a new one (possibly on a partition of different size) and copy only meaningful data. Even if both partitions have identical size, this process will most of the time result in partitions that aren't bit for bit identical, but contain exactly the same data nonetheless.

Booting a properly cloned hard drive in the same PC is possible. Using it in another machine is a different story. OS may be already configured for specific hardware configuration of original machine and may fail to boot. Linuxes don't have much problems booting after transplantation most of the time. Modern versions of Windows are quite good at this and will usually boot if hard disk controllers in both machines are similar and work in identical modes (ie. IDE/AHCI/RAID). Keep in mind that some software licenses don't allow transplantation or tie software to one specific machine - for example OEM versions of Windows do this.

Ghosting is probably just another term for cloning, I suppose it refers to Norton Ghost which was a de facto standard for disk cloning some 15-ish years ago.

gronostaj

Posted 2017-06-28T18:45:47.477

Reputation: 33 047

3"Booting a properly cloned hard drive in the same PC should be possible". It definitely is possible, and is often done for this very reason. Many companies use cloned hard drives to roll out identical installations of an OS on identical PC's. And just today, I cloned a hard drive to use in the same PC, because the original drive showed early signs of failing (the Windows Event Log was full of atapi errors). Lastly, bit-for-bit cloning may also be useful when doing forensic analysis. You can examine the clone without being concerned about potentially damaging evidence. – Charles Burge – 2017-06-29T00:27:00.030

2It works only if target drive is larger - can you explain why? Can't the target drive be exactly equal to the original, and it is possible to access/write to every single bit of the original/target? – user202729 – 2017-06-29T02:19:52.317

In my experience source and target drives can have the same capacity. – eromana – 2017-06-29T05:14:45.997

2Making a bit-for-bit copy (e.g. with dd) is miles faster than formatting the drive and individually copying every file. – OrangeDog – 2017-06-29T10:00:43.637

I don't think this answer sufficiently emphasises the distinction between 'clone' and various versions of 'copy the files to another disk'. I'd expect a clone to be bit-for-bit, or very close to it. If it's not bootable in the same PC, it's not a clone, IMO – peterG – 2017-06-29T10:05:57.477

Downvoters, please explain what's wrong with this answer and how I can improve it. – gronostaj – 2017-08-04T10:44:54.060

7

What is cloning a disk?

Cloning a disk originally meant copying the contents of a disk at sector level, bit by bit, to an identical disk. At sector level, everything including partitioning, boot sectors, file systems, files, metadata and even deleted files gets copied. Cloning was used for mass-producing identical computers, mass-deploying identical configurations to identical computers, or for forensics.

Nowadays, however, people expect a cloning app to do more, e.g. clone to a dissimilar disk, clone to a virtual hard disk, defragment the disk upon cloning, speed up cloning by not bothering with free areas of the disk, or even prepare the clone for use on dissimilar hardware.

What happens if I transfer the clone to another system?

The same thing that happens if you transfer the original to another system.

Unless the other system is identical to the original, you can expect dissimilar hardware components to require new device drivers before they work. Also, some commercial closed-source computer programs might detect this new change and require additional licensing steps in order to work, as an anti-piracy measures. Windows comes with a sysprep utility that solves this problem for Windows only.

What is ghosting?

It is another name for cloning, derived from an app named Ghost, developed in 1995 by Murray Haszard. It is now discontinued; don't bother with it.

user477799

Posted 2017-06-28T18:45:47.477

Reputation:

Ghost still exists. It's a Symantec product now, but it still does the job. – cHao – 2017-06-30T16:05:02.250

@cHao Norton Ghost was discontinued in 2013. Symantec Ghost Solution is still sold but to enterprises only. They won't give it to an individual. And it is awful. – None – 2017-07-01T11:51:36.423

5

For backup purposes I periodically clone my hard drive.

To clone a drive using the Linux dd command.

1- Make or get a Linux installation disk, the Live CD or USB. What follows is for Linux Mint Mate but any other Linux flavor is just as well.
2- With both he source and target drives plugged in to the computer, boot up from the separate Linux installation media.
3- Open the command prompt console and type:

sudo blkid

This will display a sequence of lines, one for every partition of every drive in the system scope,

/dev/sda1: LABEL="newmate2015" UUID="142698fe-5f97-4ca2-9a4c-3e20df" ... /dev/sda2: ... /dev/sdb1: ...

The number before the colon in /dev/sda<number>: designates the partition number, and the letter before the number /dev/sd<letter><number>: designates the drive.

4- In the dd command line, the variable if= designates the source drive or the input file, and the of= variable designates the target drive or the output file.

5- To verify the correct source and target drive letters, we display the same assignment in a different way. At the command prompt enter:

gnome-disks

6- If all is consistent, at the command prompt type:

dd if=/dev/sd<source-drive-letter> of=/dev/sd<target-drive-letter> conv=noerror,sync bs=4k

With the conv=sync,noerror option dd will not halt the transfer if a bit(s) in a source block can not be read, in that case to keep the transfer source and target drives at the same data position and of the same length, dd will instead write an all zeros block of the correct length.

The bs= argument is the transfer block size, and it also affects the cloning operation transfer bit rate, it can be determined by trial and error, 4k works fine with most HDD, SSD and USB drives, CD drives use 512b block size.

The target drive has to be of the same or larger capacity than the source drive. I use same size drives. Eventually when the target drive bad sector reallocation reserve capacity runs out the dd command will fail.

On my simple computer it takes about 3 hours to clone a 1Tb disk drive

After cloning,

7 Shut down the machine normally.

8 Do Not Attempt to Boot a machine that has 2 drives with the same UUID.

9 Unplug the original source drive from the computer.

10 Boot Up and verify that the cloned drive boots normally.

11 Label or record the the removed drive with the: removed date, user, machine name, location, contents, s/n, etc.

eromana

Posted 2017-06-28T18:45:47.477

Reputation: 102

5This does not answer any of the OP's question. He never asked how to perform a clone. His questions are: (1) What is cloning? (2) Will a clone work on another PC? and (3) What is Ghosting? – None – 2017-06-29T05:45:16.200

@FleetCommand "and how does one go about doing it", though it is tagged windows-7 – OrangeDog – 2017-06-29T10:42:01.867

@OrangeDog Exactly. – None – 2017-06-29T12:40:01.500

3

A clone is a direct copy, bit for bit, so that the data stored on the cloned drive is identical to the data on the original drive. From the operating system to the hidden directory files, from your desktop to the device drivers, everything is copied identically. Swap the old drive out for a freshly made clone and there should be no functional difference. You can also use the cloned drive in another PC, and aside from some potential missing drivers due to hardware differences, it should work just like your old system, making it an ideal backup in the event of a damaged PC. The downside to this, however, is that a direct bit-for-bit clone will usually be the only thing on the backup drive.

People usually use a program to clone a drive. I use Acronis.

Sergio Dominguez

Posted 2017-06-28T18:45:47.477

Reputation: 131

1I strongly advise against Acronis. It once was a good option but now, it is buggy and unreliable. Also, it is very costly. – None – 2017-06-29T05:47:09.913

1@FleetCommand Thanks for the heads up. I'll give Veeam Agent a try next time. – Sergio Dominguez – 2017-06-29T21:13:53.597