RPi Overlay file system?

68 views
Skip to first unread message

Eric Gammeter

unread,
Oct 5, 2021, 8:33:38 AM10/5/21
to weewx-user

Any information about using the RaspberryPi Overlay Filesystem to facilitate lower read/writes to the SD card?  I have lost one SD card so far- granted that was over a 2-year period of running WEEWX.  Just curious.


vince

unread,
Oct 5, 2021, 11:07:02 AM10/5/21
to weewx-user
On Tuesday, October 5, 2021 at 5:33:38 AM UTC-7 n8a...@gmail.com wrote:
Any information about using the RaspberryPi Overlay Filesystem to facilitate lower read/writes to the SD card?  I have lost one SD card so far- granted that was over a 2-year period of running WEEWX.  Just curious.

You'll need your syslog(s),  and the archive and public_html trees someplace weewx can write to.

You can get most of the way there in alternate ways by setting up a tmpfs and writing the most chattery things there.  I do this on my model-B pi which 'do' have occasional SD failures.

#---- /etc/fstab snippet ---
#---- put logs and tmp dirs in ramdisk ---
tmpfs           /tmp            tmpfs   defaults,nosuid,mode=0755,nodev,noatime   0       0
tmpfs           /var/log        tmpfs   defaults,nosuid,mode=0755,nodev,noatime   0       0
tmpfs           /var/tmp        tmpfs   defaults,nosuid,mode=0755,nodev,noatime   0       0


Eric Gammeter

unread,
Oct 5, 2021, 4:21:36 PM10/5/21
to weewx-user
OK Vince-  sounds like a plan.  Do they eventually get written to perm storage?  Perhaps during a reboot? 

vince

unread,
Oct 5, 2021, 4:52:48 PM10/5/21
to weewx-user
Unsure what you are asking, but if you choose to put things into tmpfs or ramdisk then 'you' have to do something manually to copy any such data out to physical read-write media somehow.   In a past $job I did this with a cron job that mounted a partition, copied the file out, then unmounted the partition.  That didn't eliminate issues, but it minimized the risk of taking a power hit at the wrong time.

That said, you really don't have to do this with a pi3/3+/4 and a good SD card unless you really want to.   My pi3 and later have never corrupted a SD card.

Eric Gammeter

unread,
Oct 6, 2021, 3:55:52 PM10/6/21
to weewx-user
That's good- that you have never had an SD card go south.  I have tested out the file overlay process for a day or 2 now- and things are operating normally- as far as I can se...that is:  I don't see any errors in the syslog with debug=1.  Thanks for your input.
Im good to close this one out. 
/EricG 
Reply all
Reply to author
Forward
0 new messages