In Ubuntu Server environments, systemd-pstore.service is a background daemon designed to archive the contents of the Linux persistent storage (pstore) filesystem during boot. The pstore interface (typically mounted at /sys/fs/pstore) allows the kernel to save panic logs, oops messages, and hardware error data (like Machine Check Exceptions) into NVRAM or UEFI variables immediately before a system crash. The systemd-pstore service then extracts these logs on the subsequent reboot and saves them to /var/lib/systemd/pstore/ for forensic analysis. While invaluable for debugging kernel panics on bare-metal hardware, this service is entirely useless on virtual machines, cloud instances (like AWS or Azure VMs), or highly restricted embedded systems that lack hardware pstore capabilities. Leaving it enabled on these systems wastes boot time as it searches for non-existent hardware interfaces.
This guide explains how to completely disable the systemd-pstore service in Ubuntu Server, streamlining the boot sequence by eliminating unnecessary hardware polling.
Stop and Mask the Systemd-Pstore Service
To ensure systemd never attempts to archive kernel panic logs from the UEFI NVRAM, we must both disable and mask the service, preventing any other target from invoking it.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, stop the service if it is currently running or pending:
sudo systemctl stop systemd-pstore.service - Next, disable the service to remove its symlinks from the multi-user boot target:
sudo systemctl disable systemd-pstore.service - Finally, explicitly mask the service. This links the unit file to
/dev/null, creating an absolute block against it starting:sudo systemctl mask systemd-pstore.service
Verify the Service Lockdown
By masking systemd-pstore.service, you have instructed the init system to completely ignore the pstore archiving process, saving a few milliseconds during early boot and eliminating related journal errors on VMs.
To verify the lockdown is successful, run the following command to check the status of the service:
systemctl status systemd-pstore.service
The output will clearly state that the service is masked. If you attempt to start the service manually using sudo systemctl start systemd-pstore.service, systemd will return a fatal error, confirming that the unit is blocked and the server is optimized for environments without NVRAM panic storage.