Read the statement by Michael Teeuw here.
dead SD-card every aprox. 6 months
-
I have one system (physical location.) that eats sd cards too Pi or odroid hardware doesn’t matter…
haven’t figured out the cause yet -
I use the cheapest SSD I could get for my Pi at that time. It’s running non-stop for 2 years without any issues. You can get 120GB SSD’s for less than 20€. A SATA-USB adapter costs around 2€ from China. Maybe that’s an option for you.
SD cards are not designed to be permanently written to. They wear out too fast. -
@MadScientist thx, sounds great, i’ll try that
-
Hi Zdeněk,
SD cards have limited write cycles so it’s just a question of time when your pi will not start.To increase their life, all manufactures have implemented an internal algorithm which uses different physical sectors when writing data to the SD-Card, see wear leveling.
You can help your hardware if you “oversize” the SD-Card, avoid ram discs and swap partitions.
I am using a 16GB SD-Card even though just 4GB is used by the system. It’s running now for more than 4 years without any trouble.Brgds, Michael…
-
@marvin424 that’s really weird. I’m also using 16 cards, in both my mirrors (one is for testing) a in both I’ve had to replace card in about 6 months max. Maybe I’m using to many modules, maybe there is al lot of writes on card… I’ll try SSD
-
I know this is an old thread, but hope someone finds this helpful.
-
Use a proper power source, one reason for SD-cards to wear out fast is that the RPi doesn’t receive enough power to actually perform the writes and therefore writes bad data which corrupts the card. Depending on which model it is it might need more power. Since I switched to better power supplies I haven’t had a dead SD-card for quite a while, so it seem to have an impact.
-
Use RPi-images that writes to
/tmpfs
, or configure them to write temporary data to RAM to reduce wear on the SD-card. -
Since it hasn’t been mentioned before in this thread, avoid powering off the device by removing power since this could cancel an ongoing write which potentially could corrupt the card. If you need to power it off, do it properly.
-
-
@almliden said in dead SD-card every aprox. 6 months:
Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.
How to do that?
-
@Serge said in dead SD-card every aprox. 6 months:
@almliden said in dead SD-card every aprox. 6 months:
Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.
How to do that?
As root user, edit the file /etc/fstab and add the following lines:
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0 tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=30m 0 0 tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0 tmpfs /var/run tmpfs defaults,noatime,nosuid,mode=0755,size=2m 0 0 tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0
Now most of the write intensive files write to the Raspberry PI’s ram.
Disable the swap file, as it can be write intensive too. First check if you have swap activated with the command:
free -h
If your total swap is 0B, you are good, if not, execute the following commands:
dphys-swapfile swapoff dphys-swapfile uninstall systemctl disable dphys-swapfile
Now the command activated with the command:
free -h
should tell you that you are not using the swap file anymore.
-
i switched to using a small ssd USB stick, boot from the sd card, run from the usb stick… all the i/o goes to the ssd
-
can you explain how to do this, or provide a link to an explaination?