Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resulting img file not divisible by 512bytes #195

Open
ghost opened this issue Apr 27, 2021 · 3 comments
Open

resulting img file not divisible by 512bytes #195

ghost opened this issue Apr 27, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 27, 2021

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?

@Drewsif
Copy link
Owner

Drewsif commented Jun 11, 2021

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.

@ghost
Copy link
Author

ghost commented Jun 11, 2021 via email

@jcard0na
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants