Page 1 of 1
Raspberry Pi: Input file is not a valid disk image
Posted: Mon Aug 02, 2021 2:15 pm
by Sammyueru
Hello,
I have been creating a OS for the raspberry pi but whenever I put the
.img file into the raspberry pi imager I get this error:
Code: Select all
Input file is not a valid disk image.
File size 532516 bytes is not a multiple of 512 bytes.
I have been using the gcc cross compiler for aarch64 and I'm trying to compile to the Raspberry Pi 4.
If you need more information please just ask.
Anyways thanks in advance.
Re: Raspberry Pi: Input file is not a valid disk image
Posted: Mon Aug 02, 2021 2:38 pm
by Octocontrabass
The Raspberry Pi imager expects a complete disk image, not just a kernel image.
If all you have is a kernel image, you'll need to prepare an SD card with an appropriate boot partition and boot files, then copy your kernel image into that partition.
Re: Raspberry Pi: Input file is not a valid disk image
Posted: Mon Aug 02, 2021 2:46 pm
by Sammyueru
Octocontrabass wrote:The Raspberry Pi imager expects a complete disk image, not just a kernel image.
If all you have is a kernel image, you'll need to prepare an SD card with an appropriate boot partition and boot files, then copy your kernel image into that partition.
Sorry but how would I go about doing that?
Re: Raspberry Pi: Input file is not a valid disk image
Posted: Mon Aug 02, 2021 4:05 pm
by Octocontrabass
Create a FAT32 partition if one doesn't already exist, download the necessary boot files, and copy everything necessary over to the FAT32 partition. If your SD card is 32GB or less, it should already be partitioned in a way that will work, since that's the standard for SDHC.
The information on the wiki is not always the most up-to-date, so I suggest looking at
the official documentation for which files you need instead of using the list on the wiki.