Just in case you thought I’d gone off on holiday.. I’ve been sat at the terminal over the last couple of days, experimenting.
You will have seen concerns mentioned here and elsewhere about using a Raspberry Pi as a central hub to control ESP8266s using MQTT and Node-Red. The issue is that the Pi uses an SD card and these don’t last forever. You can minimise use by using RAMLOG which keeps logs in memory and once a day backs them up to the SD. That in itself is fine (but not perfect, it’s caused me to lose an Apache log which in turn stopped Apache from powering up!) but there is also the MYSQL server – and while it should be possible to run THAT in RAM and back it up every night – I’ve not found anything remotely like plans to do that anywhere.
Swapping the internal SD for a USB stick doesn’t help, you could of course use a USB drive. Another way is to put the entire Pi (except boot) on a NAS drive. This is EASILY done if you happen to have something like a Synergy DiskStation – using BERRYBOOT which makes it easy to set up your NAS drive as a destination.
So – I did all that and decided I wanted a script like the one my friend Aidan has done so that once the drive is running – the script will do all the installation of everything I use. NOT as easy as it sounds and thanks to backup and restore facilities on the NAS, having made a backup of the basic setup (just Raspbian) I’ve been stuck in a testing scripts – restoring drive – testing scripts loop for much of the day.
Nothing to report yet, my scripts are the prettiest colours but don’t completely work yet. More soon. The idea being that the Raspberry Pi will be wall mounted – showing temperature and allowing control of temperature and lighting via a touch screen (on it’s way) while simultaneously being the hub for data, Node-Red etc with the actual code and data on my Diskstation which is RAID and can regularly back up the volume (sadly not incrementally).
Thanks Tony – more late night reading – once I get my teeth into something I like to fully understand and I’m sure other readers in here will be thankful for these useful links!
I’m using banata pi, this is a raspberry clone with allwinner A 20 cpu and built in SATA port. In this case just enought to choose a root partition that located on hdd
So have you had a Raspberry Pi – can you compare them? What do you think.. for example how does the Banana Pi compare to the Raspberry Pi 2 (I never bothered with the original PIs as I thought they were too slow and not enough memory – the current Pi2 are really quite nippy.
I don’t have RPi2, but think that banana is close to it by performance. Plus SATA, ir reciever, microphone.
In my opinion the bottle neck is SD card in most of cases.
Yes I think you’re right – my current experiment – using the Pi with my Diskstation – is yielding far more speed…. of course being over the network that will have it’s own issues. It’s been fine while I’ve been experimenting but the first morning after I set it up, the link had gone read-only and required a reset of the Pi. Not happened since.
I have a BananaPi as well as the server, more or less like you use the RPi2 Peter. Another major advantage apart from the obvious(SATA port), is the gigabit ethernet. And the fact that you can setup Bananian, a minimal distro that uses only the essential to begin with and after booting up it just takes 25MB of RAM. All the other RAM is free for you to play with. Only bad thing about BPi is the graphics chip, but this is totally pointless for what we want to do.
The only thing that should matter to you when you use BPi with HDD(even with SSD) is that you can’t power it from your router’s USB port as it will need more power for the disk. I have bought a cheap 3A charger from Aliexpress, just before the capital controls thing happened in Greece, but the rest of my project is halted now due to the current situation unfortunately.
Well, you know – when I started I had to have the graphical interface etc… I still do – but apps like NODE-RED come with their own in the web browser so actually I don’t need any graphical interfacing at all. So tell me – you say it’s all halted due to the situation… how is the Greek situation affecting getting stuff from the likes of China?
Have you seen this;
https://learn.adafruit.com/external-drive-as-raspberry-pi-root/hooking-up-the-drive-and-copying-slash
Regards
Ian
Thanks for sending this in – just getting a nice cold beer and I’ll take a look.
It’s GREAT Ian – good fun and I’ll give that a shot too – but the only thing that’s missing… it would be nice had they gone a little further and told you how to easily mount the remaining BOOT stuff onto a tiny SD and get yours back so you could put it in a cupboard as a backup!
I am interested in this too. However, iSCSI is a little too restricting for me as I prefer NFS (or SMB) so that I can use my UNRAID system. I have found an article here that may help me http://wiki.beyondlogic.org/index.php?title=RaspberryPi_RootNFS
I am currently using a small ssd for my Pi – MYSQL, EMONCMS, mosquitto and Node Red all reside on it. Backups are a pain though!
Hmm… happy to try anything once… my setup is working and I guess the most important bit is that I have a script now that automates the vast majority of the setup – I’m still working on making the installation “silent” – whoever added -qq to apt-get was joking I think… but now I can try other places to store files without the induction of tears when it fails. So – this example you’ve sent…. is that to just mount a standard partition on a NAS…. and presumably that has to be formatted in a linux compatible standard?? Want to give a specific example of how we might use the ideas in that link? Backups are now a LOT easier for me on the NAS (though not stunningly fast, a hell of a lot better than backing up a 16gig SD).
The guy in the link – I’m trying to get my head around this – is he doing the setup on a Linux computer or on the PI with an SD stuck in a USB? It’s not clear or I’m missing something?
He is formatting an sdcard in a linux computer to use as a boot SD Card. I guess that you could do it on a Pi as long as it isn’t your current boot sd card …
There seems to be a few options out there:
http://elinux.org/RPi_U-Boot
http://pinet.org.uk/
I need to read up when I get time.
more info: http://www.whaleblubber.ca/boot-raspberry-pi-nfs/