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

“Verifying write failed. Contents of SD card is different then what was written to it.” #41

Closed
matiasandina opened this issue Mar 17, 2020 · 29 comments

Comments

@matiasandina
Copy link

I'm still able to boot if I cancel the verify process

@maxnet
Copy link
Collaborator

maxnet commented Mar 17, 2020

If it's a custom image. Make sure you are running v1.2 from the "releases" page.

@matiasandina
Copy link
Author

matiasandina commented Mar 17, 2020

I am running v1.2 and it's not a custom image

@maxnet
Copy link
Collaborator

maxnet commented Mar 17, 2020

Tried a different card?

(That it is boots is not proof that the card is 100% good. It will read back the entire card and if any byte is different, it will give a different hash and will give this error. Can also mean something else is odd on your system, e.g. broken memory).

@matiasandina
Copy link
Author

matiasandina commented Mar 17, 2020

Repeated the issue with another SD. My system is Ubuntu 19.1

Regarding internet, I do have internet if connecting to 4G mobile phone hotspot. However, I can't connect to public wifi. I have another RPi 4 that was not flashed with rpi-imager (which has the same wpa_supplicant.conf file) connected to the public 5G network, I don't know if this is related with install or not.

@lurch
Copy link
Contributor

lurch commented Mar 18, 2020

If you want to you could use https://fight-flash-fraud.readthedocs.io/en/latest/ to check that your SD card(s) is/are fully-working at a low-level?
I guess it wouldn't hurt to test with a different SD-reader too, if you have one? 🤷‍♂️

@wojciechsmigielskijr
Copy link

I'm getting this same issue using v1.2. :(

@ghollingworth
Copy link
Contributor

Which image are you trying to write? Have you tried using dd? Does that give a different result with the same card?

@lurch
Copy link
Contributor

lurch commented Mar 23, 2020

Verifying the written data with dd is bit tricky (since it has no built-in verification), but there's some steps here explaining how to do so.

@maxnet
Copy link
Collaborator

maxnet commented Mar 23, 2020

Verifying the written data with dd is bit tricky (since it has no built-in verification), but there's some
steps here explaining how to do so.

Do be aware that you need to skip the first MB when verifying an image written by Imager with dd. (Imager does not write the first MB of image, if it errors out).

E.g. to verify a 1500 MB image:

sudo dd if=/dev/sdX bs=1M skip=1 count=1499 | sha256sum

Should give same hash as:

dd if=uncompressedimage bs=1M skip=1 count=1499 | sha256sum

@wojciechsmigielskijr
Copy link

My SD card was buggered. I ordered a new one and the new one works fine.

@DrawingProcess
Copy link

DrawingProcess commented Apr 4, 2020

I'm getting this same issue.
then I tried 'Balena Etcher' attempt that was success. ('Balena Etcher', the old one.)
So There is no problem with SD card.

@lurch
Copy link
Contributor

lurch commented Apr 4, 2020

@seongjunChoi0714 Would you mind providing more details?
Are you definitely using RPi Imager v1.2? What OS are you running on? What image are you trying to flash? What make/model/size of SD card are you trying to write to? Just for the sake of comparison, what version of Balena Etcher are you using?

@DrawingProcess
Copy link

@lurch
OS : Window10
SD : SanDisk/Ultra/16GB
Imager v1.2
Etcher v1.5.?

@lurch
Copy link
Contributor

lurch commented Apr 4, 2020

Thanks 👍 And what image are you trying to flash?

@DrawingProcess
Copy link

@lurch [Ubuntu Preinstalled Server 18.04 image] for ROS2

@lurch
Copy link
Contributor

lurch commented Apr 6, 2020

I'm afraid I've got no idea what "[Ubuntu Preinstalled Server 18.04 image] for ROS2" means. Do you have a link to a download page?

@jeesang7
Copy link

jeesang7 commented Apr 30, 2021

I want to reopen this issue.
Because getting this same error and then didn't find flashed SD card. But Etcher's attempt was a success.
My environment:

  • OS: macOS Big Sur
  • SD: SanDisk/Ultra/64GB
  • Imager: v1.6.1
  • Etcher: v1.5.101

@sastofficial
Copy link

this happends to me every time

@123sc0ut
Copy link

Same thing here. Trying to install OpenWRT on a Pi 4B and after 3x memory cards on 3x different card readers on 2x different computers they all come up saying “Verifying write failed. Contents of SD card is different then what was written to it.”
Would love to know a fix

@lurch
Copy link
Contributor

lurch commented Dec 12, 2021

@123sc0ut Did you buy all 3 SD cards from the same place? Perhaps they're faulty or fake? You can use H2testw to check your cards for errors.

@123sc0ut
Copy link

123sc0ut commented Dec 12, 2021

Ok so I got a work around - rather that using the Raspberry Pi Imager I used Rufus to install the image and it worked perfectly. @lurch There was nothing wrong with my cards, looks like the fault was Pi Imager on Windows v1.6.2, not sure why. . .

@penguin-number-123
Copy link

I get the same problem with a brand new 64gb ultra microsd. I'm just trying to put the rasberry pi 64 bit os to it. If I use etcher 1.7.8, with the zip from https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2022-01-28/ , I get flash failed, right after validation. Imager 1.7.2 also fails/

@lurch
Copy link
Contributor

lurch commented Mar 31, 2022

@penguin-number-123 If both Etcher and RPi Imager are both failing, then perhaps there's a problem with your microSD card or your SD card-reader? (or some security setting on your PC is blocking the low-level access that these tools need?)

@rolandog
Copy link

In my case, I also got the same error:
Screenshot from 2022-04-21 21-48-29

Perhaps it has to do with customization?

I had changed the following options:

  • Set hostname: hostname.local
  • Enable SSH
    • Allow public-key authentication only
    • Set authorized_keys for username:
  • Set username and password
  • Set locale settings
    • Time zone
    • Keyboard layout
  • Play sound when finished
  • Eject media when finished
  • Disabled telemetry

@Leander250
Copy link

I just fixed it by using an USB Port on the back of my PC instead of the front. I used a Micro-SD-Card to USB adapter.

@tomwojcik
Copy link

I just fixed it by using an USB Port on the back of my PC instead of the front. I used a Micro-SD-Card to USB adapter.

I had the same problem in the front USB port while using miscrosd USB adapter. Tried external USB hub and there was no verification error. 🤷🏼

@hosseindamavandi
Copy link

I just fixed it by using an USB Port on the back of my PC instead of the front. I used a Micro-SD-Card to USB adapter.

Surprisingly, it worked for me too! It's funny how such a simple solution can resolve technical problems. It's great to hear that you also found success with this workaround!

@TheMariday
Copy link

TheMariday commented Sep 18, 2023

I just fixed it by using an USB Port on the back of my PC instead of the front. I used a Micro-SD-Card to USB adapter.

You have got to be kidding me.

Yep. That worked. Why oh why is this a thing?

Is there a fix for this or another issue that we could link that covers this?

@Leander250
Copy link

I just fixed it by using an USB Port on the back of my PC instead of the front. I used a Micro-SD-Card to USB adapter.

You have got to be kidding me.

Yep. That worked. Why oh why is this a thing?

Is there a fix for this or another issue that we could link that covers this?

I knew that it is recommended to use USB Ports on the back of your PC if you do a BIOS update. The difference is that the ports on the back are directly soldered to the motherboard, while the ports on the front of your PC go through a cable which is only plugged into your motherboard. It kinda makes sense for a BIOS update but felt rather random for this raspberry OS problem.
Another trick is to prefer USB 2.0 ports instead of USB 3.0.

Anyway, thanks for spreading the knowledge. :)

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