I shutdown one of my RPI’s to bring up a ‘test’ version on a different SD card. Once I was done, I replaced the old SD Card and rebooted. The RPI failed to boot. Only the RED power LED turns on. For a normal boot, the ACT light flashes once almost immediately.
The ACTivity light flashes on SD card access. So it looked like my SD card was corrupt. This is the second time that has happened on this particular RPI in the past 12 months.
I went down the path of fixing a corrupt SD card the last time. I could find no evidence of corruption. fsck worked fine, I could see everything on the SD card from another linux system. I eventually reformatted the SD card on a windows system and it worked just fine – unless I tried to use it in the RPI – then NADA.
This time I started looking for a physical issue. Then it happened again on yet another RPI and SD card, but then it came back to life with no apparent explanation. But it proved my theory the problem was physical.
Somewhere I saw someone mentioning poor physical contact with pins so I started messing with pins and some how noticed the SD card was warped ever so slightly. Surely that couldn’t be the problem.
I squeezed the SD card and applied power. Sure enough the RPI started to boot properly. So warping was the problem.
I started googling RPI Warped SD card. Someone else had noticed the problem and was suggesting putting something in the slot with the SD card to hold it in place. Looking at my setup, that wasn’t going to work.
As I pondered this problem, I realized that this particular RPI is using a 3D printed case and the others are not. Although the top of the case has lots of venting, the bottom has none, so perhaps that is the source of the problem.
Anyway the SD card is clearly not going to work in that RPI. So now I had the task of moving the data to another SD card.
Transferring the Operating System to Another SD Card the Easy Way
I googled how to transfer the O/S to another SD card. This should be simple. Use Win32 Disk Imager to copy the old SD card to your PC’s hard drive. Then use it again to transfer the O/S from your PC’s hard drive to a good SD Card.
That should work, but, of course, did not for me. Even though both SD cards are the same size, Win32 Disk Imager kept reporting the destination card was just a bit smaller.
I found someone else battling this problem. Supposedly version .1 of Win32 Disk Imager doesn’t check the destination size, it just blindly copies.
I grabbed a copy of that and ran it. The O/S transferred fine, but the partition was corrupted. It would boot but things were a mess. Clearly the easy way wasn’t going to work for me.
I want the final image to go on an SD card that I already had in hand. If you have problems like this, you can always purchase a larger SD card and transfer to that card. That will be faster than my final solution.
Transferring the O/S the Hard Way
To deal with the problem I figured I better use the linux dd command. If you are comfortable with linux command line and the dd command, this worked for me. If you are not, the best solution would be to simply buy a destination SD card that is bigger than the original.
First, I installed the stock Raspian image to the card using Win32DiskImager. Then I booted the RPI on that card and used the option to expand the operating system to the full size of the SD card.
I used the linux dd command to get the old partition off the SD card. Using fdisk -l, I found the device name of the SD card is mmblk0 and the second partition where the linux O/S is kept is called mmblk0p2.
With that information in hand, I was able to copy the partition:
dd if=/dev/mmblk0p2 of=sdcard.img conv=sync,noerror bs=64K
Now remove the bad card, put in the new card, use fdisk -l again to be 100% sure you are copying to the correct location (still /dev/mmblk0p2 for me). Now use dd again to move the O/S onto the new card:
dd if=sdcard.img of=/dev/mmblk0p2 conv=sync,noerror bs=64K
That gets the data onto the SD card, but now the partition needs to be error checked and resized. To do this, run GPARTED. Select the SD card (mmblk0).
Right click mmblk0p2, and select check. Now click on the little apply button (or control-m). This will run quite quickly.
You should be good to go now. Put the SD card into your RPI and turn it on.
May 2015 Update:
Had the problem again. Different RPI which had a commercial case. The SD card that warped this time was a Transcend SD card (8GB). The last one was a Transcend card as well. I wouldn’t be surprised all three were Transcend SD cards.