I have a raspberry Pi, Model B.

I installed Raspbian on the SD card and I would like to use it as a SVN server. The problem is that when it shuts down unexpectedly (i.e. there is a blackout, or DC power gets accidentally disconnected before shutting down the OS), it won't boot anymore. It hangs on a black screen and doesn't boot up. How can I fix this?

  • try UPS (uninterruptible power supply).
    – lenik
    Jul 14 '14 at 15:37
  • What is it? Like a battery which starts working when the DC power is lost?
    – BackSlash
    Jul 14 '14 at 15:42
  • 1
    Yes. More info.
    – Kevin Brey
    Jul 14 '14 at 19:22

I had the same problem of a corrupted file system after an unexpected shutdown. I used a Linux system with an SD card reader and used the fsck(check and repair Linux filesystems) tool to "repair" the file system.

There are LiveCDs/LiveUSBs with Linux so you don't need to install the entire OS if you don't want to.

After that, I made a image of the working SD card, so I am able to simply rewrite the whole SD card in case something happens later.

  • Ok, but that is really boring. With a normal computer, this doesn't happen, I can't believe there isn't a way to get rid of this problem
    – BackSlash
    Jul 14 '14 at 13:34
  • "Normal computers" don't use an sd card to store all OS files. See this for a way to stop sd card corruption
    – Kevin Brey
    Jul 14 '14 at 19:30
  • 2
    I use the SD-Card for boot only. The OS and the data are located on a usb-stick. @KevinBrey Thank you for the link, didn't thought of making the boot-partition read-only ;-)
    – Kuishi
    Jul 16 '14 at 15:46

Unfortunately, there's a known issue where if the Pi loses power; it can corrupt the SD card permanently. I've lost 2 so far. The best way to avoid this is to either use a UPS; or, as I do, keep it plugged into a cheap netbook with a 9 hour battery.

  • Can you provide sources for this? Is there an explanation why SD cards get destroyed so often in the Raspberry PI, but not in other devices? Sep 22 '14 at 9:28
  • Other than personal experience there's this thread tells more; there are a lot of theries such as if the card is genuine, if you are overclocking the Pi, and even if it's class 4 vs 10: raspberrypi.org/forums/viewtopic.php?f=28&t=36533
    – linuxgnuru
    Sep 23 '14 at 10:55

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.