Page 1 of 1

SD card broken after dd???

Posted: Wed Jan 16, 2013 10:08 pm
by mattmezza
Hi everybody,

i flashed raspbian on my kingston 8GB SD using dd on my macbook pro: all worked fine!
Then I decided to flash openelec but I messed up with block size parameter and then I ctrl+c dd bash leaving the sd card in a state where I can't modify.
I tried everything to reset my sd card: dd with if=/dev/zero, inizialize from disk utility, format via Windows with diskpart...
Is my SD broken or can I fix it?
Now it shows two partition: System -> about 113Mb in which I can recognize some openelec files, disk1s2 to which I cannot access.
When I try to initialize from Utility Disk it gives me a Unable to write last block error.
Hope I can fix it.

Thanks everybody.

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 12:27 am
by Mobius
Try running the free version of EaseUS Partition Master. It should allow you to easily delete partitions, format them, etc.

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 1:17 am
by Dilligaf
Go here http://www.alexpage.de/usb-image-tool/download/ and download the empty bootsector image and write it to the card

usb image tool result

Posted: Thu Jan 17, 2013 10:52 am
by mattmezza
tried usb image tool and no result

error code 23 CRC error

the fat partition with openelec files is still on the card. When I try to format (from explorer) it says that partition it's write protected

Same error using disk managment

It is possible my sd it's broken?

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 10:55 am
by RaTTuS
move the write protect tab

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 11:00 am
by mattmezza
RaTTuS wrote:move the write protect tab
already tried that but no result!
Same issue.

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 11:03 am
by RaTTuS
but I messed up with block size parameter and then I ctrl+c dd b
may have nadgered something low level :(
if a reflash of raspbian cannot work then it may be dead

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 11:14 am
by mattmezza
RaTTuS wrote:may have nadgered something low level :(
if a reflash of raspbian cannot work then it may be dead
I think so too. :?
Now I learned that dd is powerful and dangerous !!! :D
I'm going to do one last attempt to bring it back to life and then I'm going to declare it dead, prepare funeral and go buyin another one! :)

Anyways thank you all for support.

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 12:42 pm
by jojopi
All dd does is ask the kernel to write data to the device. Ctrl+C interrupts dd, not the kernel, so the card will still see a valid sequence of writes, just fewer of them than originally intended.

Unplugging a card while it is being written could conceivably cause damage, but if the card is broken after merely interrupting dd then I believe it must have been faulty already.

Out of interest, what block size did you mistakenly use? If it was very small or not a multiple of the flash block size then it would make extra work. But still, the card should not be damaged unless it is of very poor quality.

Re: SD card broken after dd???

Posted: Thu Jan 17, 2013 1:42 pm
by mattmezza
I was using a BS=8m but I thought that it was too large so I decided to stop dd with ctrl+c. Then the card came into this state and now, when I try to use dd with it, it seems that nothing happens and after 5 or 6 hours dd is still running.
The card is a Kingston class 4 with 8GB of capacity.
I tried to reset card by doing dd if=/dev/zero of=/dev/disk1 bs=512 count=512 to reset mbr but nothing changed... then tried to dd if=/dev/zero of=/dev/disk1 bs=4m but another ttime nothing has changed. Now i'm in this state where it'impossible to change nothing.
What can I do? :)

Re: SD card broken after dd???

Posted: Mon Jan 28, 2019 5:56 am
by thepibob
I guess it won't help the author of this post now but maybe other guys hitting this thread. What worked for me (on mac) is using diskutil to fix the issue. Assuming your SD Card is disk2 try

Code: Select all

diskutil eraseDisk FAT32 <name> /dev/disk2

Re: SD card broken after dd???

Posted: Mon Jan 28, 2019 7:50 pm
by ejolson
mattmezza wrote:
Thu Jan 17, 2013 1:42 pm
I was using a BS=8m but I thought that it was too large so I decided to stop dd with ctrl+c. Then the card came into this state and now, when I try to use dd with it, it seems that nothing happens and after 5 or 6 hours dd is still running.
The card is a Kingston class 4 with 8GB of capacity.
I tried to reset card by doing dd if=/dev/zero of=/dev/disk1 bs=512 count=512 to reset mbr but nothing changed... then tried to dd if=/dev/zero of=/dev/disk1 bs=4m but another ttime nothing has changed. Now i'm in this state where it'impossible to change nothing.
What can I do? :)
I generally use bs=1M but 4M should also work fine.

Kingston class 4 cards are quite generic and not well suited for the Raspberry Pi even if not broken. A common recommendation at present is a non-counterfeit 16 or 32GB SanDisk A1 class SD card. Lots of trouble will be spared by using a good card and the A1 application class rating is particular good for Raspberry Pi.