Read only but write logs on raspi.

Associate
Joined
8 Feb 2012
Posts
500
Location
London
Hello.

I have created my raspi to be read only through several guides, which works perfectly fine.

However I'm having a problem to write logs into certain files. I tried logging data into the /var/log file but it doesn't seem to work unless I use the remount function.

These ones make the most sense to me.
http://raspberrypi.stackexchange.com/questions/5112/running-on-read-only-sd-card

http://blog.pi3g.com/2014/04/make-raspbian-system-read-only/

Does anyone know, if I can edit the fstab file to give me the option to write in the /var file? Also it doesn't have to just be in that file, it can be in any as long as writes.

Thank you.
 
If you want any log files to persist across reboots you could add a separate rw partition for /var/log.

Alternatively you could just have a rw partition for /var/log/programthatneedslogfiles so only the log files you want are kept.
 
Firstly, why do you want it read only?

You may want to make a partition for /var that is rw, it does after all contain variable data, this will also make PID files work again..
 
Back
Top Bottom