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.
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?
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.
sudo give root permission to the command being executed, not for stdin and stdout.
So trying to pump stdout onto a file that needs root permissions will always fail.
So to be able to write to a file you need a tool that does that for you:
tee
Tee will write to a file and to stdout as well, so: