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


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: 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 | # ]