RPI and Saving Files to NAS

77 views
Skip to first unread message

nine...@gmail.com

unread,
Jan 17, 2019, 8:47:38 PM1/17/19
to weewx-user
I have my laptop running Linux and weewx set up to store the archive folder and the public_html folder on my Synology NAS.  I have entered the lines into the fstab to have the NAS mounted when the laptop boots up.

I have tried different combinations of fstab with my RPI and the RPI will not boot.  I can mount the NAS folders from the command line once the RPI boots.

I've tried googling without success.  

I thought it would be as easy as transferring my Ubuntu fstab to the RPI.  Boy was I mistaken.

Anyone had success putting your files on a nas using an RPI?

Thanks.

Tom

vk3...@gmail.com

unread,
Jan 17, 2019, 9:07:30 PM1/17/19
to weewx-user
I have Weewx running on a RPi (zero, also used 3B+) that connects to my Synology NAS via WiFi.The entire Weewx folder lives on the NAS so that the data base and regularly generated files all live on storage that is not so prone to wearing out.
I also use systemd to make sure that the network is up and the NAS drive is mounted before it tries to start Weewx.
Worked nicely and has done for a couple of years now.
(I also use a memory drive for the log files - in theory the SD card has very minimal writes to it.)
Susan

vk3...@gmail.com

unread,
Jan 17, 2019, 9:10:55 PM1/17/19
to weewx-user
The entry to the drive (whichis the root for weewx) is:
x.x.x.x:/volume1/weewx    /home/weewx   nfs   defaults,nofail,noatime,nolock,intr   0   0

Of course the first part is the reference to the NAS folder

Susan

Tom Robertson

unread,
Jan 17, 2019, 9:40:34 PM1/17/19
to weewx...@googlegroups.com
Thanks.  I tried this but the RPI still would not boot. 

Tom


From: weewx...@googlegroups.com <weewx...@googlegroups.com> on behalf of vk3...@gmail.com <vk3...@gmail.com>
Sent: Thursday, January 17, 2019 8:10 PM
To: weewx-user
Subject: [weewx-user] Re: RPI and Saving Files to NAS
 
--
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.
For more options, visit https://groups.google.com/d/optout.

Tom Robertson

unread,
Jan 17, 2019, 9:49:11 PM1/17/19
to weewx...@googlegroups.com
I read about using systemd and actually tried what I found on the internet but still no luck. I read about using systemd-networkd-wait-online.service as well.

Could you perhaps give details about your setup so I can try them? I am a fairly new at Linux.

Tom


Sent: Thursday, January 17, 2019 8:07 PM

To: weewx-user
Subject: [weewx-user] Re: RPI and Saving Files to NAS
--

ge...@cusick.org.uk

unread,
Jan 18, 2019, 8:10:41 AM1/18/19
to weewx-user
I’ve been using the combiation of RPi and Synology NAS for some time now. I’ve taken a slightly different approach, though.

I’ve configured weewx to use a MySQL database, hosted on the NAS under MariaDB. Pretty simple to set up, and seems to have been reliable. On the RPi, the log is stored in a local memory buffer (using Busybox’s syslogd, qv), and public-html is placed on a ramdisk (tmpfs). Thus, wrires to the SD card are minimised. Happy to share bits of weewx.conf if it would be helpful.

Geoff

kutz...@gmail.com

unread,
Jan 18, 2019, 9:14:42 AM1/18/19
to weewx-user
I would appreciate seeing the relevant parts of your weewx.conf file for this.

I assume that with this setup, you don't permit your NAS drives to spin down (as they are written to every archive period) assuming they are HDDs and not SSDs. If they are, indeed, HDDs I guess it would be best to use ones optimized for this kind of activity like Western Digital Purple drives (instead of Western Digital Red drives, for example). Is that right?

phil

Tom Robertson

unread,
Jan 18, 2019, 9:16:05 AM1/18/19
to weewx...@googlegroups.com
Thanks Geoff.

Your setup sounds neat.  I am a novice at Linux so your setup might be a bit too much for me but I'm willing to give it a go.  I need to learn sometime.  Anything you can provide to "help" me would be appreciated.  You can email me directly if that would be better.

Tom



From: weewx...@googlegroups.com <weewx...@googlegroups.com> on behalf of ge...@cusick.org.uk <ge...@cusick.org.uk>
Sent: Friday, January 18, 2019 7:10 AM

To: weewx-user
Subject: [weewx-user] Re: RPI and Saving Files to NAS
--
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.

Geoff Cusick

unread,
Jan 18, 2019, 11:45:33 AM1/18/19
to weewx...@googlegroups.com
Hi Tom,

Happy to help.

Might be best for me to work through the setup steps, mail you directly for you to try them, then to document the proven version for the forum.  It might take me a few days to drag it together - I set this up a while ago - but I’ll be in touch asap.

Regards
Geoff

17 Westcroft Road Holsworthy, EX22 6BY
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/-XHRFRFbDrc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Robertson

unread,
Jan 18, 2019, 12:54:46 PM1/18/19
to weewx...@googlegroups.com
Excellent Geoff.  Do it at your convenience.  My current setup is working fine so far.

Tom


From: weewx...@googlegroups.com <weewx...@googlegroups.com> on behalf of Geoff Cusick <ge...@cusick.org.uk>
Sent: Friday, January 18, 2019 10:45 AM
To: weewx...@googlegroups.com
Subject: Re: [weewx-user] Re: RPI and Saving Files to NAS
 
For more options, visit https://groups.google.com/d/optout.

vince

unread,
Jan 18, 2019, 1:35:05 PM1/18/19
to weewx-user
Guys - one thing to be careful for is sqlite3.  Their authors say to never use it on anything network-attached.
That doesn't mean it won't work of course, but they seemed to strongly suggest not doing it.
(switching weewx to mysql would solve that problem)

pon...@gmail.com

unread,
Jan 18, 2019, 3:06:46 PM1/18/19
to weewx-user
I've been saving files to a Synology NAS from an RPi for years. I don't allow any external access to the NAS however, besides 2 factor authenticated logins to the management UI. I've saved files to a web server there in the past but currently I just send logs to it from WeeWX and also backups. Website updates happen in a RAMdisk to save IO on the SD card. My Pi is on a wired connection. 

My /etc/fstab is

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that
192.168.X.Y:/volume1/Backup/RPiWeeWX/backup /mnt/backup nfs defaults,nolock 0 0
192.168.X.Y:/volume1/linuxbackup /mnt/linuxbackup nfs defaults,nolock 0 0
# use a ram drive
tmpfs           /tmp            tmpfs   nodev,nosuid,size=5M    0       0
tmpfs           /var/tmp        tmpfs   nodev,nosuid,size=2M    0       0
tmpfs           /var/lock       tmpfs   nodev,nosuid,size=1M    0       0
#tmpfs          /var/www/weewx  tmpfs   nodev,nosuid,mode=0775,size=5M 0 0

vince

unread,
Jan 18, 2019, 3:58:42 PM1/18/19
to weewx-user
On Friday, January 18, 2019 at 12:06:46 PM UTC-8, pon...@gmail.com wrote:
I've been saving files to a Synology NAS from an RPi for years.

Sure - totally understand and I'd possibly be doing it too if I had a NAS.

Here's one link to their docs https://www.sqlite.org/howtocorrupt.html which has a lot of ways it can possibly get hosed.  Possibly.  Sometimes.

Reply all
Reply to author
Forward
0 new messages