rpi-imager icon indicating copy to clipboard operation
rpi-imager copied to clipboard

Apple M1 macOS 12.6 corrupting SD cards

Open lantren opened this issue 2 years ago • 7 comments

I just attempted to use imager on my Mac M1 running MacOS 12.6 to create a new boot SD card with two micro SD cards and now both micro SD cards are locked and can't be erased on either windows or Mac M1. Both cards were working previously as Pi boot SD's

There is no lock switch on the cards. Attempted to remove write protect flags and reformat via software (diskutil on Mac and DISKPART on windows) to not avail.

I was able to image another card on Windows successfully. The 2 "locked" SD cards are now unusable

I just attempted to use "parted" on the PI with the SD in the SD slot and that also fails due to "locked" read only status

lantren avatar Dec 02 '22 16:12 lantren

What does Imager report for error?

maxnet avatar Dec 02 '22 16:12 maxnet

the card was working before the attempt Imager downloads assets and at 1% of the write it fails with an error. Verbatim unknown. I failed to write down the error dialog. I was just working through it and not actually trouble shooting. Sadly there is no error logging I can look at and I don't have an expendable SD card at the moment. When I have another one to burn up , I'll try again and update with the exact error dialog. I still have 2 more to do tomorrow. I've downloaded the image file and balenaEtcher will do for now. rip-imager just saves me some steps.

lantren avatar Dec 02 '22 19:12 lantren

I tried it again with fresh a SD card. I still couldn't write to it with imager , but this time it didn't trash the card. fwiw , imager is allowed full disk access in the security settings.

Screen Shot 2022-12-05 at 12 31 07 PM

lantren avatar Dec 05 '22 17:12 lantren

Is the card of the same brand as the ones that failed before?

Can also try launching Imager through: "Launchpad" -> "Other" -> "Terminal" and enter:

/Applications/Raspberry\ Pi\ Imager.app/Contents/MacOS/rpi-imager

Would be interested if it reports a more detailed write error through console.

As far as it "trashing" cards. If the write is interrupted you may end up with a card without partition table. That can be rectified by selecting "Erase, format as FAT32" as "operating system".

maxnet avatar Dec 05 '22 18:12 maxnet

One was the same, the other was not.

Actually, I did attempt to re-create the partition map/reformat those cards on three different platforms, an RPi4 with the "parted" command, a Windows machine with "DISKPART" and "fdisk" and my Mac mini m1 with "diskutil". Each time the failure was "locked disk" or similar verbiage.

They simple weren't recoverable. maybe rip-imager didn't corrupt them but that was the end result. One card I would have written off as a wonky card, two made me suspicious.

I ran rpi-imager via the command line and it works as expected. I successfully imaged the card.

Then I double clicked the app to launch and tested again. I got the same "Error writing to storage" message

FWIW this is the terminal output from the successful command line run.

me@mycomputer ~ % /Applications/Raspberry\ Pi\ Imager.app/Contents/MacOS/rpi-imager OSX most preferred language: "en_US" qt.qpa.fonts: Populating font family aliases took 90 ms. Replace uses of missing font family "Roboto" with one that exists to avoid this cost. qrc:/main.qml:281:21: QML Rectangle: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. Available disk space for caching: 734 GB Telemetry done. cURL status code = 0 info sent = "url=https%3A%2F%2Fdownloads.raspberrypi.org%2Fraspios_armhf%2Fimages%2Fraspios_armhf-2022-09-26%2F2022-09-22-raspios-bullseye-armhf.img.xz&os=&image=Raspberry%20Pi%20OS%20%2832-bit%29&imagerVersion=1.7.3&imagerOsType=osx&imagerOsVersion=12.6&imagerOsArch=x86_64&imagerLocale=en_US" RECEIVED SIZE: 2 SCMRIGHTS fd received: 49 Zeroing out first and last MB of drive Done zeroing out start and end of drive. Took 0 seconds Image URL: "https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2022-09-26/2022-09-22-raspios-bullseye-armhf.img.xz" Received header: HTTP/2 200

Received header: date: Mon, 05 Dec 2022 21:49:17 GMT

Received header: server: Apache

Received header: last-modified: Thu, 22 Sep 2022 00:49:12 GMT

Received header: etag: "37dd91c8-5e9396e133048"

Received header: accept-ranges: bytes

Received header: content-length: 937267656

Received header: content-type: application/x-xz

Received header:

Download done in 240 seconds Hash of uncompressed image: "10159c715b8f9313173f5633c7d91ee8ab5b9b0b027bd68aa9ac9967a66a9586" Write done in 256 seconds Done writing cache file Verify hash: "10159c715b8f9313173f5633c7d91ee8ab5b9b0b027bd68aa9ac9967a66a9586" Verify done in 86.57 seconds Writing first block (which we skipped at first)

lantren avatar Dec 05 '22 21:12 lantren

If you just want to burn an sd card, use an old 1.6.3 based Universal build, for images you're out of luck, none of the releases work properly as I've seen the whole slew of issues, including mine (#466). Here's the link for the only universal build that I could get to work reliably.

miklosakos avatar Dec 25 '22 14:12 miklosakos

If you just want to burn an sd card

Thank you very much for the information. I was really just reporting an issue I ran into. I was easily able to download the image file and burn the a new sd with balenaEtcher

lantren avatar Dec 26 '22 17:12 lantren