Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a backup of a MacBook hard drive (WD2500BEVS-88US) by hooking it up as a secondary drive on my linux system (Ubuntu 10.10). I used the following command:

sudo dd if=/dev/sdc of=/home/backup.img bs=2M

This appears to have completed with no errors. I noticed that the file is only 68 GB in size even though the drive is 250 GB in capacity.

I restored the image to a spare drive (WD2500BEVS) with the following command:

sudo dd if=/home/backup.img of=/dev/sdb bs=2M

When I boot the spare drive in the Mac, it appears to start up for a few seconds and then shuts down. (It does not appear to load into the OS at all).

When I open up the drive that won't boot in GParted, it looks like this: enter image description here When looking at the information for the middle partition with the little red exclamation mark, it shows this: enter image description here

The original hard drive that boots ok shows up like this: enter image description here

Further info on both drives:

sudo fdisk -l
Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30402   244198580   ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       30402   244198580   ee  GPT

So why is my backup or restore failing? Why is dd not creating a byte for byte duplicate?

share|improve this question
up vote 0 down vote accepted

Try adding conv=sync,noerror to make sure empty/marked bad (if any) blocks are copied like for like. eg:

sudo dd if=/dev/sdc conv=sync,noerror of=/home/backup.img bs=2M

You will also need to use those options for the restore:

sudo dd if=/home/backup.img of=/dev/sdb conv=sync,noerror bs=2M

That's a big block size too - not sure if it matters, but if the above still doesn't work try something like bs=64k

share|improve this answer
    
Thanks for the response. I probably won't be able to test it for several days. – James T Feb 16 '11 at 22:33
    
Maybe it was a combination of using USB 1.0 and a huge byte size that messed it up somehow. I didn't end up having to use the conv options. Thanks for the help! – James T Feb 22 '11 at 2:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .