1

So I am running an HTTP server on my RPi2.

I'm running Raspbian Jessie. Everything was going smoothly (uptime 3 months+) until one day the website is not up anymore. The system hung and didn't reboot into Raspbian. When I checked the SD card was corrupt.

I had bought another RPi3 where I wanted to have my backups, using a USB hard drive. However after seeing what has happened with the SD Card I am a bit reluctant of using a RPi as a storage solution.

Why did my SD Card corrupt? Would it be safe to use Raspberry Pi 3 as a storage solution? Can it corrupt my USB Hard drive?

Aurora0001
  • 6,308
  • 3
  • 23
  • 38

3 Answers3

2

Generally speaking, most issues with the RPi (all models) can be traced back to power issues of some kind. Many of us have had RPis run for literally years without ever once corrupting an SD card.

Running for 3 months without an issue implies that the power supply to your RPi is satisfactory. My assumption is that your power source had a hickup during which the RPi was doing something important. I keep both of mine connected to a UPS, and if you're going to use the RPi (or any other device) as a mission critical device, I would suggest you plug one of those in yourself.

Jacobm001
  • 11,898
  • 7
  • 46
  • 56
1

There is recommendations to move extensive write to the SD card to either a RAM drive or to a USB flash or hard disk drive.

And the cause for the corruption could be either extensive write to the SD card or a unmanaged poweroff.

MatsK
  • 2,791
  • 3
  • 16
  • 20
  • Hi MatsK do you know where I could read these recommendations? The SD card is always being written : log files... I dont think the power is the issue in my case. – Rui Bandarra Sep 03 '17 at 22:33
  • Peter Scargill writes qyite good - https://tech.scargill.net/the-raspberry-pi-sd-wear-issue/ – MatsK Sep 03 '17 at 22:47
0

You should not trust any kind of storage, and always carry a good backup.

About SD cards

I had some bad experience with SD cards, in particular with low-cost and unbranded cards. Some SD card vendors provide "industrial" SD cards. These cards are usually pretty slow but will wear after far more erase cycles (see for instance this product).

Please note that the speed is not a problem on the raspberry pi, since it's SD card interface seems slow.

Anyway, it's always a good idea (for performances and for the uptime) to reduce the number of writes on a flash based media.

About your problem

Your power supply does not seem faulty since it worked for months, your problem may have been caused by a very short power failure.

Unfortunately smartcl does not work on SD cards, so besides badblocks, which is slow and will wear your SD card a little bit more, I don't know any tool that can be used to identify a dying SD card.

From my personal experience, once faulty, a SD card will show I/O errors when running badblocks.

pim
  • 622
  • 1
  • 5
  • 17