Formatting RPi FW image on SD card | Input file is not valid disk image. File size 102736650 bytes is not a multiple of 512 bytes

Hi,

In relation to the other post I’m trying a new installation to fix this issue.

In Step 2 of the doc: PiFi Docs - Download & Setup Guide

I selected RPi imager.

Step 3: I downloaded the latest RPi FW image for Rpi5.

Version 0.1.5.21 ( based on OpenWRR 24.10.1

At step 4 of PiFi Docs - Download & Setup Guide I get the below error:

"Input file is not a valid disk image. File size 102736650 bytes is not a multiple of 512 bytes. "

I recall having this same error last time I did the installation but can’t remember what was the resolution.

Hi,

Odd issue, haven’t experienced it myself. Can I ask which version of imager you have (should show on Pi imager)

I can see if I can recreate issue to help fix. Another way is to flash via https://etcher.balena.io/ but if I know which Pi imager you’re using as I haven’t seen that issue before

Hi again,

Thanks for the reply.

I think it was due to the wrong file type being used when I was using RPi imager. But I’m not sure

I think I didn’t extract the file fully or properly. I’m.not sure tbh…bcos I tried numerous times.

Although I was going through this step multiple times with a friend over WhatsApp chat doing it very systematically it failed numerous times.

I thought I was loading the correct file ( .img ) into the RPi imager.

i.e the .img file inside the extracted folder ( the folder that was extracted from the .gz file )

It may have been that I chose the incorrect option in 7zip to extract the folder which was causing the issue I’m not sure.

The menu options of 7zip were in Spanish so I maybe didn’t choose the right one ( I think I chose “Extract here” and the other option was “Extract Archive”)

It could be nice to put those ( *** simple but important *** ) steps on the PiFi guide doc ( bcos I see related posts on related forums about similiar error messages )

E.g:

Thanks again for your feedback,

“I think I didn’t extract the file fully or properly. I’m.not sure tbh…bcos I tried numerous times.”

No need to do so at all. Take the file as it is and add it to Raspberry Pi imager.

No suggestion to extract anything. Flash image exactly as-is from website (the img.gz version). Should just work?

Hi again,

Thanks for the reply.
Well I’m still not 100% sure what I did ( cos I thought I did these steps already several times last week when I had the PiFi issue ) but I got the FW flashed today again.

I formatted the SD card
I ran Balena etcher as Admin.
I deleted all previous downloaded version of the FW image 0.1.5.21
I downloaded a fresh copy for RPi5 from the PiFi downloads page.
I loaded the .img.gz file into the Balena Etcher.
I was able to proceed through the 3 steps and finish the process!

Just to note:

Before that I tried RPi imager 2.0.6 and used the .img file and got the error. So it does seem that the .img file is not the correct one (for either RPi imager or Balena Etcher )





Pi Imager requires a valid raw .img (size must be a multiple of 512 bytes). Your extracted .img isn’t, so it’s invalid or got corrupted during extraction. I generally don’t recommend unzipping/extracting the .img.gz it should be flashed as-is

Flash the .img.gz as-is in Pi Imager instead of extracting it first. That’s how it should be flashed.

1 Like

Hi there,

Came here after experiencing the same error. I was trying to flash the SD card from the .img.gz , downloaded from the official downoad page, using Pi Imager, with the current version ( (0.1.4.1) for my Pi 4. Tried on both a 500+ and a Win11 machine with the same negative result (see screenshot).

I also tried the Pi 5 version ( 0.1.5.21) for good measure, giving the same error. I was using the SD card provided with the kit, formatted using the Disks utility on PiOS.

After several attempts using Pi Imager I tried Rufus on Win11 which completed the flash successfully and allowed me to boot the PiFi normally.

Putting this out here for anyone else who is experiencing this issue.

Can I ask if you’re extracting it - so it’s .img rather than .img.gz?

It’s not an issue I’ve been able to replicate yet but I will get to the bottom of it

Not the original poster, but I am also having the same image with raspberry pi imager. I have tried both the img and img.gz file same error both times.

I’ll release an updated image - this needs to be something that’s happened only on newer versions of Pi imager but was working on previous builds.

Continues to work on Balena Etcher for now - will get a new image released

1 Like

I can help test if you need, I work from home and am next to my personal computer all day.

Using Rufus I used the .img.gz, so not extracted.

Updated image is now online at pifi.org/downloads

Thanks for identifying this issue :slight_smile:

2 Likes