Yesterday night, my RasPi wouldn’t boot (black screen). It’s an SD card issue: macOS reports I/O timeouts, so something’s clearly going wrong.
First, we can use ddrescue
to gather all of the blocks:
sudo ddrescue -vv -n /dev/rdisk4 sd-card.img sd-card.img.ddrescue-map-2
The default configuration is to read 128 sectors of 512 bytes each per read() call, ad if any fail, to skip 128 sectors (64kb) ahead. This takes all night because each time reads something from a failing part of the card, MacOS takes 30 sec to I/O timeout, and I think this can’t be configured.