5

I was trying to move the Pidora (Fedora for Raspberry Pi) image to my sd card using the dd command, but I realized that I had forgot to put in the bs=4M argument and had to terminate the program half way. After I tried to copy again with the right command, I saw that the SD card led won't flash and the computer won't write anything to the sd card, just as the sd card was corrupted. So I terminated the command again and tried to format it with fdisk. But with no success. Everything that was trying to access the sd card was freezing.

I tried to fix it with testdisk, but every time it tries to read/write something from the card, it returns read error.

I tried to write 0 to the sector 0 of the card, but it won't work:

[0x4d@nathalia ~]$ sudo dd if=/dev/zero count=1 of=/dev/mmcblk0
dd: writing to ‘/dev/mmcblk0’: Input/output error
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00558315 s, 0.0 kB/s 

However, writing to the second partition of the card works:

[0x4d@nathalia ~]$ sudo dd if=/dev/zero count=10 of=/dev/mmcblk0p2
10+0 records in
10+0 records out
5120 bytes (5.1 kB) copied, 0.00309397 s, 1.7 MB/s

Is there anyway I can somehow repair the sd card? The information on it is not important. I just need it to work again.

Thanks.

6
  • Specifying the block size is purely optional, by the way.
    – Daniel B
    Mar 20 '14 at 8:07
  • @DanielB I know, but I have found out that the copying speed is very slow of you don't provide it. Is that right? Mar 20 '14 at 8:17
  • Yes, SD cards have a relatively large "erase block size". Every write that is smaller results in the block being read and written as a whole. Quite similar to a regular hard disk's sectors.
    – Daniel B
    Mar 20 '14 at 9:07
  • 1
    try a full format of the card, remove the partitions, then format it
    – nwgat
    Mar 20 '14 at 22:53
  • 2
    It might be hardware - the card broke down because the copy was too intense. Try a card of better quality, or newer. SD cards are fragile.
    – harrymc
    Mar 22 '14 at 15:30
1
  1. Use the "Disk Utility" program provided with the OS. Or use Gparted

  2. Delete all the partitions in it. Create a single new partition.

Hopefully your problem will be resolved. All the best

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.