Jump to content

How to copy a disk using dd command?


Netaro
 Share

5 posts in this topic

Recommended Posts

Although i'm using mac os x, it's rather a Linux/BSD question, so it goes there... I think.

 

So, as I noticed, MacOS X's Disk Utlity doesn't allow to make a copy of the whole disk, only it's partitions (which sucks, as bootloader won't be copied then.). As both my laptop's hard disk and my spare external hard disk are both seagates 320gb (one is 7200rpm, second is 5400rpm), I've decided to make a copy of my disk onto my external, as it's doing nothing at the moment. So, I'm going to use dd command. However, I've had some... bad times with dd, so I'm little paranoiac now.

 

As now, I'll try to do this -

dd if=/dev/disk0 of=/dev/disk1

.

But then, I don't know whether it's correct. I don't know what's the difference between /dev/diskNumber and /dev/rdiskNumber, and google found me nothing. so which one should I use? Also, what should i set as block size? Leave it blank, or set bs=512? Calculate the count value or leave it blank?

Link to comment
Share on other sites

To copy the MBR try these.

This backs up the MBR into a file called mbr.bin

dd if=/dev/<ata drive devicename> of=/mbr.bin bs=512 count=1

This restores it.

dd if=/root/mbr.bin of=/dev/<ata drive devicename>

Your "<ata device drivename>" is disk<number>. To determine your number, check in disk utility. Click info and look at disk identifier. There should be disc<number> (as outlined here).

Link to comment
Share on other sites

To copy the MBR try these.

This backs up the MBR into a file called mbr.bin

dd if=/dev/<ata drive devicename> of=/mbr.bin bs=512 count=1

This restores it.

dd if=/root/mbr.bin of=/dev/<ata drive devicename>

Your "<ata device drivename>" is disk<number>. To determine your number, check in disk utility. Click info and look at disk identifier. There should be disc<number> (as outlined here).

 

What about if it's GUID?

Link to comment
Share on other sites

<br />To copy the MBR try these.<br />This backs up the MBR into a file called mbr.bin<br />
dd if=/dev/<ata drive devicename> of=/mbr.bin bs=512 count=1

<br />This restores it.<br />

dd if=/root/mbr.bin of=/dev/<ata drive devicename>

<br />Your "<ata device drivename>" is disk<number>. To determine your number, check in disk utility. Click info and look at disk identifier. There should be disc<number> (as outlined <a href="http://www.insanelymac.com/forum/index.php?showtopic=220112" target="_blank">here</a>).<br />

<br /><br /><br />

Thanks guys, however, I want to make an exact copy of my disk, so that i i were to swap my external and my internal I'd see absolutely no difference.

Link to comment
Share on other sites

 Share

×
×
  • Create New...