Creating image with dd

I have issues lately when I build the image with dd.
In 30% of the cases one of the two partitions isn’t created correctly although dd had said, that everything is ok.
But when I enter the sd card into my linux pc, one of the partitions cannot be read.
Most of the time a second build is correct.
I just tested with a brand new sd card and a freshly rebooted pc.

Am I the only one having this issue?

I normally use “pv”, that is nearly the same than dd, and never have a problem like that.

I am creating my images only with dd. Do you use the option “bs=1M” for setting the block size? That’s what I normaly use, perhaps this fixes your problem?

Regards, Holger

Could be that it isn’t syncing writes to the disk at the end of the operation. I use
sudo dd if=imgfile of=dev oflag=sync status=progress bs=4M

1 Like

I always use this simple command:

pv 2020-06-01-zynthianos-buster-lite-armhf-1.0.0.img > /dev/sdc

and never never have a single problem.

I use “pv” because it gives a nice progress feedback :wink:


Ok, it’s my problem. Nothing helped. pv is nice and fast. You need to be root though. sudo is not enough.

Maybe my latest Mint update is the root cause.

I think I found a relation.
When I plugin the sd card, two partitions will be mounted.
When I want to change the sd card, I eject one partition and the other one will be unmounted automatically.
The next creation fails and only one partition is shown. When I create the image again, I can eject the sd card by ejecting only this single partition (old one, which doesn’t exist anymore)
Then the sdcard was correctly built.

OS issue, I reckon. Next Mint version is near and I hope for the best.

I’m unconvinced by pv. It’s just a tool for monitoring data rate through a pipe. You still might get issues if you don’t sync after the write before you remove the sdcard.

Doing a “sync” doesn’t cost a penny … i always do it after pv :wink:

I use dd on Mac OSX, and you can press CTRL-T during the copy to see progress:
dd bs=32m if=image.img of=/dev/rdisk2