I have set up my Raspbian and need to clone the SD Card to about 20 other Raspberry Pis now.
I used the following command (on OS X) to clone the SD Card:
sudo dd if=/dev/rdisk3 of=~/Desktop/pi.img bs=1m gzip -c ~/Desktop/pi.img > ~/Desktop/pi_img.gz diskutil unmountDisk /dev/disk3 gzip -dc ~/Desktop/pi_img.gz | sudo dd of=/dev/rdisk3 bs=1m
I also tried the same thing with disk (instead of rdisk) and without gzipping it.
sudo dd if=/dev/disk3 of=~/Desktop/pi.dmg diskutil unmountDisk /dev/disk3 sudo newfs_msdos -F 16 /dev/disk3 sudo dd if=~/Desktop/pi.dmg of=/dev/disk3
results are the same:
kernel panic not syncing: VFS: Unable to mount root fs on unknown-block 179,6
Of cause the main SD Card still works. This error is only on the cloned SD Card
Is there another way to clone the SD Card 1:1? or is there a way to fix the broken cloned SD? If possible this should be an automatable solution because I have to do this to 20+ PIs 2-3 times a year or so.
EDIT I just noticed, that my .dmg image has 4 partitions (boot, RECOVERY, disk4s3, disk4s6) but the cloned SD Card has only 3 (boot, RECOVERY, disk4s6). So.. disk4s3 seems to be the problem..