Unable to boot after cloning SD card using linux dd command

July 18, 2024, 18:52

abovefreezing

Used linux dd command to clone an SD card to another SD card of the same size. The dd command copied successfully. It looked like this: sudo dd if=~/imagefile.img of=/dev/<path to SD card to be copied> bs=1M status=progress And that is how the new SD card was imaged (I had previously used dd to get the image file from the original SD card, and that appeared successful too). However, it would not boot. Tried the SD imager program the comes with Raspberry Pi OS and that worked ok. However, online, many people specify commands that match what I did above when using the linux dd tool and it apparently works for them. I hadn't put on a partition table to the new SD card prior to using dd. Would that have been a reason for the dd clone to not work? What should I have done so that dd would successfully clone the SD card containing my Raspberry Pi operating system?

oops.se

When posting commands it is easier to read if you format it, see https://discord.com/channels/818384379197784084/1189386838788542464 for guidenace.

abovefreezing

Updated : )

oops.se

You have only provided 50% of the commands needed to duplicate/clone a SD card...

abovefreezing

Oh? And I thought I had it correct... So, what is the proper command to clone an SD card to a file and then from a file to another sd card? Also, what is the proper way to clone from one SD card to another without an intermittent file?

oops.se

First you create a image. Then you transfere that image to a SD card.

abovefreezing

Oh, I see. I only showed what I did once I had the image. Here was the whole attempt: Copying from the card to an image file: sudo dd if=/dev/<path to SD card to be copied> of=~/imagefile.img bs=1M status=progress Copying from the image file to a new card: sudo dd if=~/imagefile.img of=/dev/<path to SD card to be copied> bs=1M status=progress It all should have worked. Did I miss something?