What happens before that?
Does it crash, is the power cycled without shutdown, or another
I have a Raspberry Pi running 24/7 for almost 3 years now, and it has
never corrupted its SD card.
My Pi runs for nearly three years, too. Its first SD card got corrupted
again and again, sometime once a month, sometimes even more often. But,
I found out that the card itself had a data cell problem from the
beginning. After a change with a card of the same type these problems
never occured anymore. So this can be a reason, too.
yes, it certainly can be a problem with the specific card or the
general quality of the type of card.
also note that the sticker on the card is no real way of identification,
because cards are being made with any sticker by our far-east friends...
(e.g. with Transcend or other A-brand marking on a cheap card, or with
32GB capacity while it really is only 8GB, pre-written 32GB partition
table on it as well)
I have a client who uses RPis for industrial displays. They ended up
rolling their own Linux distro to avoid SD card corruption. They now
run entirely from RAM.
These clients do not pretend to be clever or to know everything. They
just did what was needed to solve their problem.
Stephen Pelc, stephenXXX@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
The actual problem will depend on the scenario of failure, which has
not yet become clear in this thread.
In my case the Rpi is on reliable power and the failure scenario
would be: bugs, crashes, bad SD card, etc. I have not seen these.
In the case of industrial displays, they probably suffer from random
powerdowns without proper shutdown. In that case (and the use permitting),
mounting the filesystem R/O and putting all dynamic data in RAM is
certainly the best solution.
My experience was frequent corruption of SD cards with the 1st gen Pi,
but after adding a fast USB flash drive and configuring /boot/cmdline.txt
to boot from it instead of the SD card, I've had no corruption problems
going on three years now.
...plus what packages you've installed: some, e.g. the Apache web server
and almost any mail server generate quite large logs when run with
default settings on a normal desktop system.
However, the default logging levels used by Raspbian are set to ignore a
lot more log messages than my Fedora systems, e.g. /var/log/messages only
contains the stuff shown by dmesg - stuff logged by the kernel while its
martin@ | Martin Gregorie
gregorie. | Essex, UK
I have several Pi's running continuously for years.
They continously log data to the card, not a large volume, but typically
every 10 seconds with flushed writeback. Somewhat to my surprise, I've
never had any major corruption, but I do try to buy good quality cards.
The only thing I see is that after an unexpected power cut, the logfile
has occasionally ended with a number of nulls, which were not written by
the app, and this is probably data which the SD card accepted but didn't
get into flash memory before the power to it was lost.
The Pi 1 which used full-size SD cards did suffer from poor contacts
with the card in a few cases, although none of mine were impacted in
this way. I haven't heard of this since the switch to microSD cards.
[email address is not usable -- followup in the newsgroup]
Whichever is the newest Raspberry Pi I've been using as my home ssh
gateway, cloud and version control server (data stored externally on a
NAS), usually chews through a card in 12-18 months. I've looked at only
logging to RAM. but not come up with a solution I'm happy with yet.
The last card to go was a Samsung Evo branded 16GB, rated at class 10.
It's failure mode was to go read only when certain parts were accessed,
which at least meant data wasn't lost. I got a Samsung class 6 to
replace it to see if that offered better random I/O performance, testing
showed there wasn't much difference as the Samsung had good 4K
reads/writes anyway. However there was something wrong with the card as
it wouldn't boot after the fs was expanded (could be an undersized fake).
I got a Class 10 SanDisk Ultra as an immediate replacement, stonking
peak performance as expect, giving 75MB/s read, but poor 12MB/s writes,
and the same story for random I/O with reads good, but writes poor. For
the new Pi3 I've picked up a Class 4 SanDisk which as swapped read
performance for write, peaking at 45MB/s read but with 42MB/s write, and
random 4K writes are similarly improved. With the same image as on the
class 10, the class 4 booted in 40 rather than 60 seconds, and a full
dist-upgrade took under half the time (8 rather than 17 minutes) - so
well worth going for the class 4.
The big question is how gracefully it will die next year, or if by then
I will have changed to mounting root on a USB stick or even a small SSD.
I thought everyone would check new cards for this before using them.
I'm disorganised and a bit too casual about most computer/network admin
stuff, but I do manage to check the integrity of new SD cards.
Indeed - I use h2testw with all new blank SD cards I purchase (mostly
for camera use):
I must confess to /not/ checking the cards I buy with NOOBS ready
installed which is remiss of me. Yes, I know it's easy to make such
cards oneself, but if they come as part of a bundle it saves a little
time and bother. OTOH if the OS is out of date, you can spend a lot of
time updating it!