Skip to content

Instantly share code, notes, and snippets.

@linux4life798
Last active May 28, 2024 06:53
Show Gist options
  • Save linux4life798/1d284302a2c805112306a9d97c5970c9 to your computer and use it in GitHub Desktop.
Save linux4life798/1d284302a2c805112306a9d97c5970c9 to your computer and use it in GitHub Desktop.
Info about enabling kernel log dump to pstore

On Debian the /usr/lib/tmpfiles.d/systemd-pstore.conf file can modified to enable pstore log saving on panic and shutdown.

w- /sys/module/printk/parameters/always_kmsg_dump - - - - Y
w- /sys/module/kernel/parameters/crash_kexec_post_notifiers - - - - Y

The systemd-pstore service is already configured to read from /sys/fs/pstore on the next boot and add these log fragment to the journal log and directly copy to /var/lib/systemd/pstore/.

Note: I have seen some inconsistencies in both sides of this mechanism. After a clean shutdown, the systemd-pstore service usually always reports the /sys/fs/pstore dir is empty. Also, the logs captured by pstore don't seem to be fully appended/merged with the journal log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment