Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Clone a bootable hard disk the easy way System
I've got this new Mac mini, and I wanted to clone my old hard disk onto the new mac mini -- noe that this only works with same processor type in both machines. Of course, the first thing that pops into my mind is using Carbon Copy Cloner or SuperDuper or rsync or even ditto followed by some blessing. But wait ... I hooked up the old Mac in Target Disk Mode (start it up with the 'T' key held down) with a FireWire cable to the second Mac mini.

So I insert the MacOS X 10.4 install disk, boot from it, select Disk Utility from the Start menu, and choose the volume of the new Mac. I use the Restore tab, drag and drop the old drive as the source, and the new one as the target, and press the button. Et voila! After copying, I can boot the new Mac with an exact clone of the old one. This seems obvious, but I haven't seen it mentioned here before.

[robg adds: This technique may result in some issues if the machines aren't nearly identical -- as a matter of practice, I never clone an old machine's startup drive to a new machine, given that I don't know exactly what changes have been made on the new machine. But if you're setting up a number of identical machines, this could be one way of speeding the process.]
    •    
  • Currently 3.33 / 5
  You rated: 3 / 5 (6 votes cast)
 
[84,905 views]  

Clone a bootable hard disk the easy way | 12 comments | Create New Account
Click here to return to the 'Clone a bootable hard disk the easy way' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Clone a bootable hard disk the easy way
Authored by: neuralstatic on Apr 04, '07 08:17:25AM

this is done all the time... the OS is extremely forgiving on changes to hardware.



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: nickv2002 on Apr 04, '07 09:19:02PM
Agreed: I copy my bootable drive back and forth between my Mac Pro and MacBook all the time (for traveling). The only time I would expect things to not work would, obviously, be copying between PPC and Intel boot drives, but as long as you're on the same architecture and have the latest OS things should work fine. Also, every once in a while Apple ships new machines with newer OS version than currently are available (10.2.7 for the first gen of G5's comes to mind but there are other more recent examples). If you buy a new computer and Apple hasn't updated the OS recently it's a good idea to check and make sure the OS version and build number you're putting on the new computer is equal to or greater than the one it shipped with... you can check build numbers under the Apple Menu -> About this Mac, then click on the Version 10.x.x to see the build #.

[ Reply to This | # ]
Clone a bootable hard disk an easier way
Authored by: mclbruce on Apr 04, '07 08:29:32AM

The "Boot from CD" step is not necessary. Disk Utility is located on the system hard drive and will make a clone from the system HD. You may have to turn journalling off on the target HD to get this to work.



[ Reply to This | # ]
Clone a bootable hard disk an easier way
Authored by: ploesslkh on Apr 04, '07 10:31:15AM

if the source hard disk was journaled then the target disk has to be journaled too and vice versa(?)



[ Reply to This | # ]
dd
Authored by: SOX on Apr 04, '07 09:46:43AM

I've never actually tried this, but I think the following would clone a drive at the bit level:

dd if=/dev/macHarddrive of=/dev/otherdisk

you might also want to switch on
dd dd if=/dev/macHarddrive of=/dev/otherdisk conv=noerror

the latter switch cause the transfer to ignore any corrupted parts of the disk without aborting the entire copy.



[ Reply to This | # ]
dd
Authored by: zebrum on Apr 05, '07 02:50:31AM

But dd will also copy fragmentations.



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: toppledwagon on Apr 04, '07 01:35:12PM

If you're really just trying to migrate to another computer, Apple has a program called Migration Assistant which will copy users, settings, applications, etc. from one machine to another.

-Dave



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: tiagobugarin on Apr 04, '07 07:07:36PM

If the machines have closer hardwares I don't think it will be a problem but i really recommend fresh install and migration assistent.

Some one suggested to use dd but this is too much for lots of people and Apple has just the tool for doing it the "Apple way": Disk Utility. Pop the disk you want to clone, create a image with Disk Utility and then use the Restore tab to install the image back to a hard drive.

And ALWAYS, verify and repair the disks after such a process!

Another good thing to do, with dd or with Disk Utility is to generate a md5 hash of the image for comparation before a restore... just to be shure everything is as was at the imaging time.

In command line just type:

md5 name_of_the_image.img

In Disk Utility go to the menu Images > Check Sum > Check Sum MD5 Image

(I do not use my computer in english so it maybe not exactly like this, but it is some like this! :)

Btw, I usualy install my OS X updates using this technique: create a dvd image (I like to do this for backuping purposes), Restore the image to a HardDrive (even non-empy HDs are OK since you cant choose to not destroy any data), reboot the machine and choose to boot from the HD with the OS Installer.

It's faster then any other method I know!

Done this from 10.2 to 10.3 to 10.4 and will do this to 10.5!



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: hooverm on May 16, '07 09:07:44PM

Well, for those of you who are interested in how to clone an OSX boot disk across a network:

Note: The remote machine must have enough space to copy the entire disk. I used gzip and was able to get 111Gb to fit in 74Gb. our mileage may vary
Here are the steps I used to make an image of my MacBook Pro across my LAN and onto my G5:

The G5 looks like this:

Machine Name: Power Mac G5
Machine Model: PowerMac7,3
CPU Type: PowerPC G5 (3.0)
Number Of CPUs: 2
CPU Speed: 2.5 GHz
L2 Cache (per CPU): 512 KB
Memory: 5 GB
Bus Speed: 1.25 GHz
Boot ROM Version: 5.1.8f7

The Laptop looks like this:

Machine Name: Mac
Machine Model: MacBookPro2,2
Processor Name: Intel Core 2 Duo
Processor Speed: 2.33 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache (per processor): 4 MB
Memory: 2 GB
Bus Speed: 667 MHz
Boot ROM Version: MBP22.00A5.B00
SMC Version: 1.12f5



On the G5:
Allow SSH
Note the IP address. Mine was: 192.168.1.40

On the Laptop:
Boot from CD: Knoppix 5.0.1
Note that I tried Helix 1.8 and DSL 3.3 but neither of these recognized the hard drive.
Become root: sudo su
Logon to remote machine test connection: ssh 192.168.1.40 -l myuserid

Create the image:
dd if=/dev/sda | rsh myuserid@192.168.1.40 "gzip >/Volumes/Emergency/laptop-sda.dd.gz"
or to compress on local host:
dd if=/dev/sda | gzip | rsh myuserid@192.168.1.40 "cat >laptop-sda.dd.gz"
or for no compression:
dd if=/dev/sda | rsh myuserid@192.168.1.40 "cat >laptop-sda.dd"

I used the first choice listed. My storage location was /Volumes/Emergency. Note that this took a looooong time.
I ran on a gigabit network and the G5 never ran over 10% of CPU or memory use and this still took 51.5 hours!
Transferred 470 packets (662Kb) per second

Zero out the drive:
dd of=/dev/sda -if=/dev/zero
I actually checked the state of the disk after this and it was indeed unbootable.
Don't know how long this took exactly because I ran it overnight.

Now to restore:
rsh myuserid@192.168.1.40 "cat /Volumes/Emergency/laptop-sda.dd.gz | gunzip" | dd of=/dev/sda
or if no compression:
rsh mary@192.168.1.40 "cat laptop-sda.dd" | dd of=/dev/sda

Since I used the gzip compression I had to use the first choice here too.

The restore also took 50 hours.

So, 120 hours after I started the test I was complete.
In my case it certainly is a better solution to re-install the system but I wanted to know whether or not this could be done.
The answer is yes, but....



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: ldm on May 17, '07 07:43:55AM

You probably should consider increasing the default block size to something larger that 1024. It should result in significant speed increases. (Keep it a power of 2 of course).

dd bs=8192 if=... of=....

Should result in 8x less system calls. Larger is better of course, so consider trying things as large as 2^16.


---
--
Laurent



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: hooverm on May 24, '07 07:37:50AM

I guess seeing that the actual command didn't fail with any bad blocks that might be a thought...



[ Reply to This | # ]
Clone a bootable hard disk the easy way
Authored by: hooverm on May 25, '07 11:09:23AM

I tried setting the block size to 65536 and it had no appreciable effect upon the transfer times.



[ Reply to This | # ]