3

I am having issues cloning one MicroSD to another using my Mac. I have been working on this for days and have tried several things, all with the same end result.

Here is my process:

First, I put my good MicroSD into a USB adapter and plug that into my Mac. Then I do a diskutil list and determine the disk location. For arguments sake, let's say it was found in /dev/disk2.

Second, I put my new MicroSD into a USB adapter and plug that into my Mac. I do another diskutil list and determine the disk location. For arguments sake, let's say it was found in /dev/disk3.

Third, I unmount both disks using the following commands: sudo diskutil unmountDrive /dev/disk2, sudo diskutil unmountDrive /dev/disk3.

Then, I run the command to copy one to the other: sudo dd if=/dev/rdisk2 of=/dev/rdisk3 bs=1m.

Next, I take the good MicroSD and throw it into my RasPi and make sure everything still looks good.

Finally, I attempt to boot the new MicroSD in the RasPi.

It begins to boot, but always stalls and dies. It appears by the output that it is unable to mount the ext4 filesystem: the main os. I get error messages like so:

No filesystem could mount root, tried: ext4
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(179,6)
...
CPU: 2 PID: 1 comm: swapper/0 Not Tainted 4.1.7-v7+ #817
...
CPU: 1 PID: 0 comm: swapper/1 Not Tainted 4.1.7-v7+ #817
...
CPU: 3 PID: 0 comm: swapper/3 Not Tainted 4.1.7-v7+ #817
...
CPU: 0 PID: 0 comm: swapper/0 Not Tainted 4.1.7-v7+ #817
...
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,6)

Please help!

Note - I have tried dding to an image first and then the MicroSD.

Note - I have tried with multiple MicroSD cards

Note - I have tried with several RasPis

Note - I have tried different and no block sizes in dd

Wes Crow
  • 131
  • 4

3 Answers3

2

I'm no expert but I have just had a hell of a time using dd in my Mac to format cards for RPi. During my investigations I read about the difference in RW speeds and block sizes. IMHO I would get an image onto your OS of the good SD and run from there. I have done that before with success. Or if possible create a set up script you can run on any new image that will make the required changes? But that is untried!

Byte Insight
  • 236
  • 2
  • 11
2

What you are doing looks OK to me. I run similar on my Mac (although I usually use the inbuilt SDcard reader).

Not all SDcards are identical - it is quite common to have apparently identical cards with different capacities. If the target card is smaller this can cause crashes - although dd should indicate if the copy is incomplete.

You can get around this by shrinking the ext4 partition to leave some free space.

I would suggest you make a clean image on the new card to test if it works.

I use rsync to backup and synchronise SDcards between my Pis. See https://raspberrypi.stackexchange.com/a/28087/8697

PS Just noticed you are using NOOBS. This makes shrinking partitions a bit harder, but the principle is the same,

Milliways
  • 54,718
  • 26
  • 92
  • 182
0

I wasn't able to rectify the problem I was having. Eventually, I gave in and rebuilt the OS from the ground up. The dd then worked as expected, regardless of block-size or RW speeds.

One note, if anyone runs into this problem, the troublesome OS was Raspbian Wheezy on top of NOOBs. The second time around I axed NOOBs as it was one more thing that could go wrong. I'm not sure if that was the root of the issue or not, but this time it worked.

Wes Crow
  • 131
  • 4