Personally I wouldn't bother doing ramdisk on a pi3, pi3+ or pi4, and I'd 
instead just shoot a backup of your /home/weewx tree once (to baseline it) 
and then occasionally grab your archive and NOAA directories via cron or 
something to another computer or dropbox or something.

When you get down to it, all that is important is the archive and your 
weewx.conf file - you can rebuild anything else in just a few minutes if it 
ever becomes necessary.

On Saturday, March 12, 2022 at 2:33:23 PM UTC-8 Eric K wrote:

> Its' a Raspberry Pi 3B+ 
>
> On Saturday, March 12, 2022 at 4:25:00 PM UTC-6 do...@dougjenkins.com 
> wrote:
>
>> Eric, if you have pi4 with firmware older than 09/2021, you can boot from 
>> a usb3 drive. This is what I have been doing with my RPI as I have lost 2 
>> good sdcards due to write failures.
>>
>> On Sat, Mar 12, 2022, 4:46 PM Eric K <eric.k...@gmail.com> wrote:
>>
>>> Hi Peter.
>>>
>>> Correct, extending the life of the SD card is my goal.
>>>
>>> I am currently rebuilding my weewx Raspberry Pi system because of a 
>>> suspected SD card failure.
>>> I had 2 local Linux users tell me that the symptoms are consistent with 
>>> an SD card corruption.
>>> The card is only 9 months old, and it's not bottom-of-the barrel quality!
>>> I reached out for help 2 weeks ago and got zero responses.
>>> see:
>>>
>>> https://forums.raspberrypi.com/viewtopic.php?p=1979221&hilit=kernel+panic#p1979221
>>>
>>>
>>>
>>> On Saturday, March 12, 2022 at 3:35:06 PM UTC-6 peterq...@gmail.com 
>>> wrote:
>>>
>>>> If you're wanting a ramdisk because SD cards are unreliable, I wouldn't 
>>>> bother. There is plenty of history of people running Weewx on Raspberry 
>>>> Pis 
>>>> for many years without a problem with corrupted SD cards. 
>>>>
>>>> On Sat, Mar 12, 2022 at 12:55 PM vince <vince...@gmail.com> wrote:
>>>>
>>>>> I would try 'mkdir /home/weewx/public_html/forecast' so the parent 
>>>>> directory exists when weewx tries to write it.
>>>>>
>>>>> I'd also add that doing it your way means your NOAA files will be 
>>>>> recreated every time it boots, which could take ages if you have many 
>>>>> years 
>>>>> of info like many of us do.
>>>>>
>>>>> One way would be to put something in your rc.local which runs after 
>>>>> things mount ala:
>>>>>
>>>>>     if [ -d /home/weewx/public_html ]
>>>>>     then
>>>>>        # prepopulate things here
>>>>>        mkdir /home/weewx/public_html/forecast
>>>>>     else
>>>>>        logger "error - rc.local could not mkdir for weewx"
>>>>>     fi
>>>>>
>>>>> You might run into timing issues if you do too much this way since 
>>>>> rc.local tends to run toward the end of the startup sequence, but a quick 
>>>>> mkdir should work.
>>>>>
>>>>> On Saturday, March 12, 2022 at 12:40:49 PM UTC-8 Eric K wrote:
>>>>>
>>>>>> Currently running weewx 4.5.1 in a Raspberry Pi 3B+ with the Bullseye 
>>>>>> version of Raspberry Pi OS.
>>>>>> For a Raspberry Pi (using a microSD card as the OS system drive) I 
>>>>>> want to create a ramdisk for the /home/weewx/public_html directory.  
>>>>>> I followed examples from various webpages on the ramdisk topic.  
>>>>>> What I've tried thus far doesn't fully work.
>>>>>> How are others implementing this?
>>>>>>
>>>>>> I started by renaming my /home/weewx/public_html directory to 
>>>>>> /home/weewx/public_html_backup, so there would be no conflict when the 
>>>>>> ramdisk was created at bootup.  
>>>>>> Then, I put this line in the /etc/fstab file and rebooted.
>>>>>> tmpfs   /home/weewx/public_html   tmpfs   defaults,noatime,size=100M  
>>>>>>  0 0
>>>>>> I tested it with sudo mount -a and the new partition was visible by 
>>>>>> using the df command.
>>>>>>
>>>>>> After a reboot, a /home/weewx/public_html directory was created as a 
>>>>>> tmpfs volume.
>>>>>> To test the functionality, I manually ran wee_reports to force the 
>>>>>> webpage to be created.
>>>>>> When wee_reports ran, the process crashed with errors, because some 
>>>>>> of the files don't exist from previous runs of wee_reports.
>>>>>>
>>>>>> pi@rpi3b:/home/weewx $ sudo bin/wee_reports
>>>>>> Using configuration file /home/weewx/weewx.conf
>>>>>> Generating for all time
>>>>>> Traceback (most recent call last):
>>>>>>   File "/home/weewx/bin/user/belchertown.py", line 1390, in 
>>>>>> get_extension_list
>>>>>>     with open(forecast_file, "wb+") as file:
>>>>>> FileNotFoundError: [Errno 2] No such file or directory: 
>>>>>> '/home/weewx/public_html/json/forecast.json'
>>>>>>
>>>>>> During handling of the above exception, another exception occurred:
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File "/home/weewx/bin/weewx/reportengine.py", line 196, in run
>>>>>>     obj.start()
>>>>>>   File "/home/weewx/bin/weewx/reportengine.py", line 281, in start
>>>>>>     self.run()
>>>>>>   File "/home/weewx/bin/weewx/cheetahgenerator.py", line 152, in run
>>>>>>     ngen = self.generate(gen_dict[section_name], self.gen_ts)
>>>>>>   File "/home/weewx/bin/weewx/cheetahgenerator.py", line 222, in 
>>>>>> generate
>>>>>>     ngen += self.generate(section[subsection], gen_ts)
>>>>>>   File "/home/weewx/bin/weewx/cheetahgenerator.py", line 222, in 
>>>>>> generate
>>>>>>     ngen += self.generate(section[subsection], gen_ts)
>>>>>>   File "/home/weewx/bin/weewx/cheetahgenerator.py", line 310, in 
>>>>>> generate
>>>>>>     searchList = self._getSearchList(encoding, timespan,
>>>>>>   File "/home/weewx/bin/weewx/cheetahgenerator.py", line 387, in 
>>>>>> _getSearchList
>>>>>>     searchList += obj.get_extension_list(timespan, db_lookup)
>>>>>>   File "/home/weewx/bin/user/belchertown.py", line 1399, in 
>>>>>> get_extension_list
>>>>>>     raise Warning(
>>>>>> Warning: Error writing forecast info to 
>>>>>> /home/weewx/public_html/json/forecast.json. Reason: [Errno 2] No such 
>>>>>> file 
>>>>>> or directory: '/home/weewx/public_html/json/forecast.json'  
>>>>>>
>>>>>> I found that if I copy the contents of my 
>>>>>> /home/weewx/public_html_backup folder into the /home/weewx/public_html 
>>>>>> ramdisk, then wee_reports completes and creates the fully populated 
>>>>>> /home/weewx/public_html directory.
>>>>>>
>>>>>> Is everyone else populating the ramdisk with a backup of the 
>>>>>> puclic_html folder at bootup time?
>>>>>>
>>>>>> Thanks,
>>>>>> Eric
>>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "weewx-user" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to weewx-user+...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/71a87cdb-be9b-4cfc-b67b-e72802faceean%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/71a87cdb-be9b-4cfc-b67b-e72802faceean%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> -- 
>>>> Peter Quinn
>>>> (415)794-2264 <(415)%20794-2264>
>>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to weewx-user+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/d8e90467-dfcd-46fc-8a2d-af534c0f1dcdn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/d8e90467-dfcd-46fc-8a2d-af534c0f1dcdn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/456b7b03-162b-4cdf-9e5f-896d077113e6n%40googlegroups.com.

Reply via email to