Read the statement by Michael Teeuw here.
dead SD-card every aprox. 6 months
-
@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?
-
https://www.tomshardware.com/news/boot-raspberry-pi-from-usb,39782.html
really easy, copy all the data from sd to ssd, then change one line in sd config, reboot… voila
on one machine I had trouble with regularly, I had a 500gb ssd drive I wasn’t using…
for my main dev machine, I just bought a 128gig usb stick ssd. came with a cable, took 20 minutes to copy the data…spent $35 from amazon -
@BKeyport I am NOT trying to BOOT from the usb stick, most pi’s don’t support that
-
Speak of the evil, the evil happens. Blew up my SD card.
-
@BKeyport boooooo
-
@MoreLinux so how do you edit this text file using root?
-
@MoreLinux said in dead SD-card every aprox. 6 months:
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 0could you potentilally give a more in-depth guide to doing this?
-
@PHAGE-GOV edit the file as root
if u are not root, then u must use the sudo prefix on a command
commands to edit on linux are vi, nano and (too many) others…
I use nano
SO its
sudo nano /etc/fstab
has nothing to do with MM, just basic linux skills.