[systemd-devel] making journald logs persistent on raspberry pi

Mantas Mikulėnas grawity at gmail.com
Fri Jan 24 16:36:49 UTC 2020


On Fri, Jan 24, 2020 at 5:32 PM Dave Howorth <systemd at howorth.org.uk> wrote:

> It's quite common on the Raspberry Pi to make /var/log a tmpfs, in
> order to reduce the number of writes to the SD card that is the pi's
> main storage. That's quite acceptable for most logs but I'd like to
> make journald's logs persistent so I'll be able to investigate any
> problems that occur whilst booting or shutting down more easily.
>
> My first thought was to configure journald to write the log somewhere
> else, but it seems there's no possibility to do that? (why not?)
>
> So I think I will need to create /var/log/journal as a symlink to a
> directory in a permanent filesystem. The symlink needs to be created
> after the tmpfs is created but before journald starts (or else journald
> will need to be told to notice the change).
>
> My systemd foo isn't up to that and a web search hasn't found an answer.
> What's the best way to do it please?
>

Mount --bind a persistent directory on top of /var/log/journal, using the
same method that you currently use for mounting the tmpfs.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200124/86abccc6/attachment.htm>


More information about the systemd-devel mailing list