Interesting stuff and surprisingly hard to get done completely....

My job from 2000-2013 was to develop+support a very custom minimized 
fedora/centos system that ran totally into ramdisk on a small-memory Intel 
box, treating it like an embedded system.  Reason was that these systems 
'never' had an orderly shutdown, they just had the power yanked from them 
when the platform they were on was powered off for the night.

Stuff I had to do a the time included:

   - strip the heck out of the list of installed packages, remove 
   everything other than stuff needed to boot the box, then 'add' things you 
   need back in. (for example - redhat used to require a sendmail agent.  
   Really?)
   - take out man pages, docs, internationalization, localization, etc.   
   Remove 'everything' possible.  Libraries you don't use.  Everything 
   possible.
   - I wrote a routine that could be used to periodically write logs out to 
   the physical disk.  We had a spinning disk, so I did it once/minute.  
   Result was that you'd lose the good stuff you needed if/when the system was 
   unexpectedly shut off or crashed, but having logs up to a minute max 
   beforehand was helpful in 95% of the post-mortem cases
   - I tried to separate read-write from big read-only stuff (for example, 
   a JRE).  Installed big stuff to the disk, symlinked to it from the 
   ramdisk.  Mounted those big things ro whenever possible
   - built all that remained into a initramfs that  I'd boot with the right 
   lilo (then grub) kernel parameters
   - result was 'really' small in ramdisk - I was far smaller than a 64 MB 
   partition for the whole thing, although Redhat/Fedora/Centos got fatter 
   over time.
   
But that's a heck of a lot of work.  A 'lot' of work.   And it doesn't help 
the pi problem where the SD might/can/will eventually corrupt on you.  
Lastly it makes you really custom, so it's harder to get support.



Re: Raspbian, my belief is that you don't have to be read-only, you have to 
be read 'mostly', concentrating on where the os writes 'often' (hint: 
/var/log) and doing everything possible to not write to the SD...


Looking at one pi model-B that's been up 184 days running nginx, weewx 
simulator, some cron jobs querying ds18b20 temperature sensors, and driving 
a nokia 5110 lcd screen, I see the following files modified in the last 16 
months:

   - the weewx public_html tree - easy to put in ramdisk
   - the weewx archive tree - easy to put in ramdisk (but save to physical 
   media occasionally and 'check' it was saved !)
   - /var/lib/{apt,dpkg,cache} - for debian packages, written to rarely
   - /var/log - of course this is the big one........

Some thoughts:

   - raspbian logrotate saves too much.  Save less versions.  Rotate less 
   often.  Maybe don't save most of them (logrotate.d edits required)
   - raspbian syslog is too chatty.  There are options to quiet it down a 
   bit
   - you might be able to move syslog to ramdisk, but it would probably 
   involve some gymnastics, again, you'll want to save syslog 'someplace' 
   occasionally to give you forensics when/if you get an unexpected happening
   - moving your public_html tree to ramdisk means weewx will regenerate 
   the noaa files every boot.  That's very slow.   You could probably fake 
   that with symlinks so that those written-rarely files are on SD card 
   without too much risk.

Assuming you could handle the /var/log tree, I could see a little 
fix-up-my-pi script folks could run once to do the fun after installing 
Raspbian and before doing weewx perhaps.  That would be pretty slick.


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

Reply via email to