Introduction: Restore DMG to SD Card - MAC OS X
After making a backup of a SD Card, and trying to restore it using 'Disk Utility' you may have some issues during the process like:
Error: Could not validate source - Invalid argument
To solve this, there is this 3 step process that you can perform in the terminal.
If you do not want to run this steps you can just run a script I made:
Step 1: Step 1: Converting the DMG
First you need to convert the .dmg image to a raw image:
hdiutil convert foo.dmg -format UDTO -o bar.img
(Note: change directories to the one with the dmg file (if in Desktop do first: 'cd Desktop'), and change 'foo' and 'bar' with the filename)
Step 2: Step 2: .CDR (raw Image) to .IMG
In the last step we created a file with .cdr extension but it is a raw image. So you can change the file extension to .img, by easily renaming the file name:
mv bar.img.cdr bar.img
Step 3: Step 3: Copy IMG to SD Card
Before this step unmount all the partitions of the SD Card, or you will get this error:
dd: /dev/diskX: Resource busy
Finally you can copy the image to your SD card using dd:
sudo dd bs=2048 if=bar.img of=/dev/diskX
(Substitute X with the disk num, you can find this under: Disk Utility -> Select the SD Card on the right -> Info (top button), and in the window you can see the disk number)
And patiently wait for it to end, if it takes more than 2 hours, just check if it is complete by removing the SD Card and reinserting it, if not try this command in the terminal again. But you really need to wait... like a lot... not kiddin (depends on the SD Card size)
We have a be nice policy.
Please be positive and constructive.
Sorry - Internet doesn't like my key combinations:
If you press [CTRL]+t whilst the tool is running you get a status report.
To see how far you have left to go press [CMD]+[SPACE], you can type the number of bytes transferred (e.g. 10000000 bytes) and you'll be able to see how many gigabytes have been written...
If you press +t whilst the tool is running you get a status report.
To see how far you have left to go press +, you can type the number of bytes transferred (e.g. 10000000 bytes) and you'll be able to see how many gigabytes have been written...