Hi Praveen,

It's on the first page, but I agree that it probably doesn't leap out at
you. You can put it anywhere you like but the default is in memory.

The filesystem layout is defined around an apt install of weewx.

The directory /var/lib/weewx is moved into RAM and mounted as a tmpfs with
a bind mount performed on the system boot.

df -Th /var/lib/weewx
Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs  486M  279M  208M  58% /var/lib/weewx

Anything within that directory is therefore within memory. The voyage
script will take care of writing that directory back to the SDCard on an
orderly shutdown, which means it's available (remounted) on the next boot
up. If it's anything less than orderly shutdown (eg: power failure) then
the directory contents will be lost forever. That's why the notes have an
excessive emphasis on backups and why the last page in the wiki was
added - Using
weewx's RSYNC skin as a backup solution
<https://github.com/glennmckechnie/rorpi-raspberrypi/wiki/rorpi-Using-weewx%27s-RSYNC-skin-as-a-backup-solution>

If you don't want to go to that bother then remove that bind mount entry
for /var/lib/weewx and instead point it to a seperate read/write drive -
usb stick, usb HDD (whatever floats your boat) and carry on as normal. But
still do backups anyway :-)  You'll still have a read only, root filesystem
that will better survive power failures but your writable database drive
won't have that protection.

All the above assumes you are using the default sqlite database type.
I wouldn't recommend using mysql database on a tmpfs as it requires more
memory than a raspberry pi can supply. It can be done but is not worth the
effort or constant monitoring. It also requires a few extra tweaks to the
mounted directories if you run it under a read only filesystem, even if the
database is moved to a writable drive. Actually, If I recall correctly it's
easiest to move all of /var to the writable drive but memory is still a
squeeze. I'd suggest a usb HDD rather than a usb stick too - I haven't had
much luck with them and mysql probably due to the high disk traffic.

Stick with the sqlite default database, it's way easier.
If you feel like living dangerously, try with mysql but the remaining
pieces are all yours. (If you succeed and have notes though, let us know :-)

There is an ultra low traffic group for rorpi.
<https://groups.google.com/forum/#%21forum/rorpi-discussion>  If you have
any further questions relating to the rorpi setup then it's probably best
to ask them over there.

Pre rorpi I used a very similar approach to Vince. Logs and web to memory
and I wrote the sqlite databases to a sandisk usb stick.
I live in a rural area, the power network has no redundancy and trips at a
sideways glance and UPS's aren't cheap here. I would end up with corrupted
filesystems, sometimes unwritable disks, all resulting in missing data. I
probably also asked too much of the SDCard and usb sticks - extra
databases, short archive intervals, multiple skins. Anyway, this eventually
happened one too many times. As a result I ended up travelling the longer
path and so rorpi evolved.

Vince's method is way simpler.  Choose according to your needs.  But
whatever you do, remember your backups. :-)


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

On 14 January 2018 at 03:07, Praveen Chandrasekaran <praveen.c...@gmail.com>
wrote:

> Hi Glenn,
>
> Where are the SQL databases stored? Are they still stored on the SD card?
> I could not get that reading your page or maybe I missed it.
>
> Regards,
> Praveen
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to