PiShrink icon indicating copy to clipboard operation
PiShrink copied to clipboard

resulting img file not divisible by 512bytes

Open ghost opened this issue 3 years ago • 3 comments

After I run pishink, the resulting img file can not be used in the Raspberry Pi Imager. The error is that the img is not in 512 byte increments. I can use the image in BalenaEtcher. I guess that program is not as picky. How do I fix this so the image works in the Raspberry Pi Imager application?

ghost avatar Apr 27 '21 14:04 ghost

I've never run into that issue actually. You can pad the file with anything to get it to a nice 512 byte block and that should fix it.

I'm going to leave this open to try and add it as a feature.

Drewsif avatar Jun 11 '21 04:06 Drewsif

Dumb question, how would I pad it?

Sent from my iPad

On Jun 10, 2021, at 10:09 PM, Drew Bonasera @.***> wrote:

 I've never run into that issue actually. You can pad the file with anything to get it to a nice 512 byte block and that should fix it.

I'm going to leave this open to try and add it as a feature.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost avatar Jun 11 '21 12:06 ghost

this worked for me:

size=$(stat -f '%z' test.img)                   
pad_size=$(( 512 - $size % 512 ))               
dd if=/dev/zero of=test.img bs=1 count=$pad_size seek=$size

jcard0na avatar Jun 22 '23 11:06 jcard0na