blob: 66ad5572c823a2cba00411841487cd8749138a4d [file] [log] [blame]
<?xml version='1.0'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
<refentry id="systemd-pstore" conditional='ENABLE_PSTORE'
<refpurpose>A service to archive contents of pstore</refpurpose>
<para><filename>systemd-pstore.service</filename> is a system service that archives the
contents of the Linux persistent storage filesystem, pstore, to other storage,
thus preserving the existing information contained in the pstore, and clearing
pstore storage for future error events.</para>
<para>Linux provides a persistent storage file system, pstore, that can store error records when the
kernel dies (or reboots or powers-off). These records in turn can be referenced to debug kernel problems
(currently the kernel stores the tail of the kernel log, which also contains a stack backtrace, into
<para>The pstore file system supports a variety of backends that map onto persistent
storage, such as the ACPI ERST and UEFI variables. The pstore backends
typically offer a relatively small amount of persistent storage, e.g. 64KiB,
which can quickly fill up and thus prevent subsequent kernel crashes from
recording errors. Thus there is a need to monitor and extract the pstore
contents so that future kernel problems can also record information in the
<para>The pstore service is independent of the kdump service. In cloud environments
specifically, host and guest filesystems are on remote filesystems (e.g. iSCSI
or NFS), thus kdump relies (implicitly and/or explicitly) upon proper operation
of networking software *and* hardware *and* infrastructure. Thus it may not be
possible to capture a kernel coredump to a file since writes over the network
may not be possible.</para>
<para>The pstore backend, on the other hand, is completely local and provides a path
to store error records which will survive a reboot and aid in post-mortem
<para>The <command>systemd-pstore</command> executable does the actual work. Upon starting,
the <filename>pstore.conf</filename> file is read and the <filename>/sys/fs/pstore/</filename>
directory contents are processed according to the options. Pstore files are written to the
journal, and optionally saved into <filename>/var/lib/systemd/pstore/</filename>.</para>
<para>The behavior of <command>systemd-pstore</command> is configured through the configuration file
<filename>/etc/systemd/pstore.conf</filename> and corresponding snippets
<filename>/etc/systemd/pstore.conf.d/*.conf</filename>, see
<title>Disabling pstore processing</title>
<para>To disable pstore processing by <command>systemd-pstore</command>,
set <programlisting>Storage=none</programlisting> in
<title>Kernel parameters</title>
<para> The kernel has two parameters,
<filename>/sys/module/kernel/parameters/crash_kexec_post_notifiers</filename> and
<filename>/sys/module/printk/parameters/always_kmsg_dump</filename>, that control writes into pstore.
The first enables storing of the kernel log (including stack trace) into pstore upon a panic or crash,
and the second enables storing of the kernel log upon a normal shutdown (shutdown, reboot, halt). These
parameters can be managed via the
mechanism, specifically the file <filename>/usr/lib/tmpfiles/systemd-pstore.conf</filename>.
<para>Data stored in the journal can be viewed with
as usual.</para>
<title>See Also</title>