Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a linux distribution that I installed on an SD card. After the lengthy installation was finished I created a DMG backup of all the partitions using the Mac's built in disk utility. The recovery image is currently 865.5MB large and seems to contain the correct information.

I am currently attempting to restore this image onto another SD card to ensure the recovery process will work appropriately. To perform this action I went into disk utility under the restore tab and entering the appropriate fields. I selected the DMG recovery file as source while selecting the SD card bay as the destination. All seemed to be working since disk manager prompted me if it was alright to fully erase the SD card as well as my root password for permissions. However, my victory was short lived as it promptly showed me this error: Recovery Error: Could not validate source - Invalid argument. I guessed that the source was incorrect, so I tried opening the DMG and providing the virtual drive as the source. However the same error persists.

Since this card contains three partitions with one being a blessed bootable partition, I would like to see if there are any ways to get my Mac to generate these for me. Since disk-utility archived the full SD card with partitions, I would assume is has a way to recover it going the other way.


Full logs from Disk Utility:

2013-01-23 19:02:27 -0500: Restore Disk
2013-01-23 19:02:27 -0500:  Source: “Raspbian.dmg”
2013-01-23 19:02:27 -0500:  Destination: “APPLE SD Card Reader Media”
2013-01-23 19:02:27 -0500:  Erase Destination: Yes
2013-01-23 19:02:27 -0500:  Erase “APPLE SD Card Reader Media” and copy the contents of “Raspbian.dmg” to it.
2013-01-23 19:02:27 -0500: 
2013-01-23 19:02:27 -0500: Starting Restore…
2013-01-23 19:02:27 -0500: Validating target...
2013-01-23 19:02:27 -0500: done
2013-01-23 19:02:27 -0500: Validating source...
2013-01-23 19:02:27 -0500: Could not detect format of volume on device ""
2013-01-23 19:02:27 -0500: Could not validate source - Invalid argument
2013-01-23 19:02:27 -0500: Could not validate source - Invalid argument
2013-01-23 19:02:27 -0500: 
share|improve this question
    
What is the format of the DMG you created? HFS+? –  Thorgrim Feb 6 '13 at 22:14
    
@Thorgrim Disk Description : Apple UDIF read-only compressed (zlib) The partition map scheme is master boot record. This dmg also contains 3 partitions. FAT32, linux-swap, and linux partition type which I forgot the name of (and apple doesn't recognize). Hope this helps, post another comment if it doesn't or you need more info. Thanks for the reply. –  jakebird451 Feb 6 '13 at 22:25
add comment

1 Answer 1

Use the dd command-line tool.

  • Mount the SD
  • Use "Disk Utility": Select the top level of the SD card and "Get Info". Note the "Disk Identifier" (example disk13)
  • Unmount all of the volume on the SD, if they are mounted, but do NOT removed the SD card. This is important because the dd will fail if it detects any mounted volumes.

In the Terminal:

  • If you are not in an Admin account, use "su (admin account name)" to gain admin authority
  • sudo dd if=/path/to/DMG/file of=/dev/(disk identifier from above) bs=16k

Then wait a long time for the operation to complete. In a 4 GB copy I performed recently to a CF card, it took 21 minutes to finish.

You will eventually get 3 lines stating records in & out and bytes copied. Example:

243528+1 records in
243528+1 records out
3989970432 bytes transferred in 1278.252950 secs (3121425 bytes/sec)

In my case I have been copying .img files to CF cards, hopefully it works just as well for DMG's

share|improve this answer
2  
Pro tip: press Ctrl+T at any time while the dd command is running to get a quick status report, among the lines of load: 1.82 cmd: gdd 17747 uninterruptible 0.05u 3.81s 15730+0 records in 15730+0 records out 257720320 bytes (258 MB) copied, 179.779 s, 1.4 MB/s. –  Mathias Bynens Dec 27 '13 at 16:44
    
I can't seem to get the bs=?? right. What number is supposed to be there (what data do i use to calculate the bs number?) –  Tor Jan 8 at 16:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.