2

I want to make a new SD card with Raspbian and OpenCV installed. Instead of making it from scratch, I have already done this from another SD card that I use with raspberry.

After cloning the SD card, I can't connect to the cloned SD card with Raspberry, and the filesystem is so different from the SD card that I cloned.

I have used the dd command in Ubuntu:

sudo dd bs=4M if=/dev/mmcblk0 of=raspbian.img

In the new SD card

df -h
umount /dev/mmcblk0p1
sudo dd bs=4M if=raspbian.img of=/dev/mmcblk0

I get the following error when connecting the pi 2 with a HDMI cable to a laptop : end kernel panic - not syncing : VFS : Unable to mount root fs on unknown-block (179.2) Is there any method to clone SD cards with possibility to use and connect both after the cloning operation?

Note : the two sd cards have the same size : 32 GB . But they are from different types (manufacturers), the cloned one is a samsung class 10 32 gb --> cloned to kingston 32 gb class 4

Links :

The Beast
  • 383
  • 1
  • 7
  • 20

2 Answers2

2

Did you check the exact sizes of both of the cards (eg. using fdisk)?
If the target card is a little bit smaller than the the original card, duplicating using dd can (or even will?) fail.

I roughly documented a way that finally worked for me here.

Js.
  • 176
  • 3
2

Perhaps you had a block error in an inconsequential part of your SD card. This would cause dd to quit writing the current block and resume immediately with the next block, so your file system would be off.

Including "sync" in both your dd commands may fix it by zeroing the remaining bytes in the bad block, but you would possibly also need to reduce your block size so that the zeroed portion doesn't take bytes out of other important blocks.

Tim G
  • 161
  • 6