InfiniteMac OSx86  


Reply
 
Thread tools Display modes
  #1  
Old 12-17-2009, 01:24 AM
gp-se gp-se is offline
Cheetah
 
Join Date: Dec 2009
Posts: 5
New Hard Drive

Hey guys, I got a new hard drive, can I clone my current hard drive to the new one? will it clone everything including bootloader\hidden EFI partition?
I'm running: Snow Leopard 10.6.2
Chameleon RC3
thanks guys
Reply With Quote
  #2  
Old 01-17-2010, 03:41 PM
LawlessPPC's Avatar
LawlessPPC LawlessPPC is offline
 
Join Date: May 2008
Location: United Kingdom
Posts: 506
if you use a utiltiy like hdclone then yes this a sector for sector copy

Reply With Quote
  #3  
Old 01-17-2010, 08:14 PM
Imkantus Imkantus is offline
 
Join Date: Jul 2009
Location: Germany
Posts: 779
You can also create a partition on the new HD and copy the content using the Disk Utility but this will force you to install your prefered bootloader on the new HD again.

If you want to clone the hole partition table, I would just use dd.

AMD Phenom II X4 955 - ASRock AM3A770DE - 8GB DDR3-1333 - Radeon HD 5570 1GB passiv - BCM4318 802.11b/g - Snow Leopard Retail
+++
AMD Phenom X3 8450 - ASRock AM2NF6G-VSTA (BIOS L2.39) - 4GB DDR2-800 - Radeon HD 4650 512MB - Snow Leopard Retail (retired) / OpenBSD
Reply With Quote
  #4  
Old 01-18-2010, 01:39 AM
srs5694 srs5694 is offline
Puma
 
Join Date: Jan 2010
Location: Woonsocket, RI
Posts: 29
Using dd (or any other byte-for-byte exact copy) has several drawbacks:

  • If the taget disk is smaller than the original, one or more partitions will be truncated, which will be a serious problem. This will also lose the backup partition tables if you use a GUID Partition Table (GPT) partitioning scheme.
  • If the target disk is larger than the original and you use a GPT scheme, the backup GPT data structures will be copied to the wrong location. I don't know offhand how Mac OS deals with this, but it could be bad. This problem can be corrected by at least some disk partitioning tools. Until the problem is corrected, you might not be able to create new partitions to use the extra space.
  • A low-level dd copy will recreate the current partitions' sizes and positions exactly. If you want to resize any partition, you'll have to do this after the fact, and possibly move partitions to make room. Such actions are both risky and time-consuming.
  • The GUIDs of the disk itself and the partitions (in GPT), as well as the filesystems (in both GPT and MBR) will be duplicated on the copy. This may be OK if you intend to wipe the original disk clean and start fresh with it, or move it to another computer; however, if you intend to re-use the original disk on the same computer, duplicate GUIDs could cause problems. I've not studied how Mac OS reacts to this situation, though, so I don't know how serious a problem this would be in practice. I recommend completely wiping the GPT or MBR data structures and starting again if you go this route.
  • A whole-disk byte-for-byte copy is likely to take longer than a filesystem copy using Disk Utility or something similar. The extent of this difference will depend on the utility in question and how full the disk is.


Overall, IMHO it's better to use Disk Utility, Carbon Copy Cloner, or something similar to move a system from one hard disk to another. I've done precisely this with Carbon Copy Cloner many times. These utilities can not be relied upon to copy the boot loader from the original disk's MBR to the new disk's MBR, though. For that, either use dd or be prepared to boot using the boot loader on the new disk or an emergency optical disc to boot the system and then re-install your boot loader. To use dd, the following command should work, assuming the original disk is /dev/disk0 and the new disk is /dev/disk1:

Code:
dd if=/dev/disk0 of=/dev/disk1 bs=440 count=1
Be sure to get the disk devices right! If you don't, you'll end up wiping out the boot loader on the old disk rather than copy it to the new disk! This command copies just 440 bytes, so it will complete very quickly, compared to a whole-disk copy (omitting the bs and count parameters).



💡 Deploy cloud instances seamlessly on DigitalOcean. Free credits ($100) for InfMac readers.

Reply With Quote
Reply