0

Was going through my usual process of writing a Raspbian image to a microSD card using sudo dd bs=1m if=/my_pi-zero.img of=/dev/rdisk3 conv=sync on my mac and I received the following message

dd: /dev/rdisk3: Device not configured
4451+0 records in
4450+0 records out
4666163200 bytes transferred in 582.264839 secs (8013816 bytes/sec)
Copied /Users/Matthew/Desktop/Photo-G/Pi-Zero.img to disk3

Typically dd: /dev/rdisk3: Device not configured is not part of that message.

However, when I plug the SD card into my Pi everything seems to be normal, could there be something wrong under the hood or should I just ignore it?

EDIT: It's also worth noting that the image file is 7.96gb so the transfer is being cut off partway through. The microSD card is 8gb and I haven't previously had a problem like this with this script.

Matt
  • 466
  • 2
  • 6
  • 19

3 Answers3

1

You try to write an image of 7.96gb but dd stopped to transfer data after 4666163200 bytes (4.66gb) without a definitely error message. This could be a sign that the SD Card is broken. You could test if the SD Card is complete writable with:

pc ~$ sudo dd bs=1m if=/dev/zero of=/dev/rdisk3 conv=fsync

Btw. you may use conv=sync to pad input blocks with null bytes but I suggest to also use conv=fsync to flush write buffers.

But failing buffered write to a SD Card cannot always be detected by the operating system even if you use a "read after write" test. To really check if a SD Card is writable without errors you have to use unbuffered I/O but this isn't supported by the OS out of the box. I have discussed this problem some times ago at Detect an SD card that became read-only. You may use that simple unbuffered I/O "read after write" test if your SD Card is complete writable.

Ingo
  • 42,961
  • 20
  • 87
  • 207
0

What is /dev/rdisk3: supposed to mean? What are the ":" there for? You are confusing the shell.

There is nothing wrong wrong with using dd but it is hazardous, and you risk ovderwriting your OS without warning.

I used to use a script with safety checks https://raspberrypi.stackexchange.com/a/29085/8697 but Etcher is easier and safer!

The discrepancy between records in and records out means the last (possibly) incomplete block is truncated. This may or may not cause problems, but unless the in/out sizes are identical is a cause for concern. There are many possible causes (including writing to a smaller card). As SD Cards are almost invariably multiples of the 4G Erase Block size, and you are using 1M blocks this seems unlikely.

Milliways
  • 62,573
  • 32
  • 113
  • 225
0

Surpisingly it wasn't an issue with the SD card as initially thought. It was an issue with the way I was reformatting the SD card to be FAT32.

I was trying to reformat the disk to FAT32 while setting the new name of the disk to new_name0. This was throwing an error though because the new name ought to be fully capitalized. After changing it to NEWNAME everything runs smoothly.

This would throw an error but I didn't notice because my python script would then immediately try to copy the image to the SD card, thereby burying the error in more text. This meant I was trying to write the img file to an unformated disk, ultimately resulting in the error dd: /dev/rdisk3: Device not configured

Matt
  • 466
  • 2
  • 6
  • 19