During the startup sequence of an Ubuntu workstation or server, seeing red failure notifications can cause immediate concern. One common boot warning states Failed to start Update UTMP about System Boot/Shutdown. Running systemctl status systemd-update-utmp.service confirms that the unit entered a failed state. The systemd-update-utmp service is tasked with auditing system events and writing boot and shutdown records to /var/run/utmp and /var/log/wtmp. When filesystems mount read-only, log databases corrupt, or permission masks break, this service fails. Repairing it ensures accurate audit logging and seamless boot sequences.
Why the Update UTMP Service Fails
The UTMP daemon records user logins, system runlevels, and reboot cycles. When the service fails during boot, it is usually triggered by one of the following root causes:
- Read-Only Root Filesystem: The root filesystem mounted in read-only mode due to disk metadata errors or dirty unmount flags detected during startup.
- Corrupted UTMP/WTMP Database: Binary log files in
/var/run/utmpor/var/log/wtmpbecoming truncated or corrupted after a hard power loss. - Audit Subsystem Conflict: The Linux Audit daemon (
auditd) maintaining strict locking handles preventing systemd from writing user session markers. - Full Root Partition: The root (
/) partition running completely out of free disk blocks or inodes.
Step 1: Check Systemd Journal and Filesystem Mount State
Determine why the service could not write to its log targets:
sudo systemctl status systemd-update-utmp.service
journalctl -xeu systemd-update-utmp.service
Examine the exit code. If the log displays Read-only file system, your root filesystem is locked. Check mount flags with:
mount | grep "on / "
If the output shows ro instead of rw, an emergency filesystem check is required.
Step 2: Force Filesystem Check (fsck)
Filesystem errors prevent systemd from updating runtime databases. Schedule an automated fsck on next boot:
- Force an fsck during the next startup:
sudo touch /forcefsck - Alternatively, run fsck manually from an Ubuntu Live USB or recovery root shell:
(Replacesudo fsck -fvy /dev/sdXn/dev/sdXnwith your actual root disk partition identifier, such as/dev/nvme0n1p2). - Reboot the system once repairs complete.
Step 3: Recreate Corrupted UTMP and WTMP Files
If the filesystem is healthy and mounted read-write, the existing binary log files may be corrupted:
- Stop the failing service:
sudo systemctl stop systemd-update-utmp.service - Backup and recreate the log databases with proper permissions:
sudo mv /var/log/wtmp /var/log/wtmp.bak sudo touch /var/log/wtmp sudo chown root:utmp /var/log/wtmp sudo chmod 664 /var/log/wtmp - Recreate the runtime utmp file:
sudo touch /var/run/utmp sudo chown root:utmp /var/run/utmp sudo chmod 664 /var/run/utmp - Restart the update service:
sudo systemctl restart systemd-update-utmp.service sudo systemctl status systemd-update-utmp.service
Step 4: Check Disk Space and Inode Availability
Exhausted disk space or inode exhaustion halts binary writing instantly:
df -h /
df -i /
If Use% is 100%, clean out old package archives and rotated system journals:
sudo apt-get clean
sudo journalctl --vacuum-time=3d
Diagnostic Summary
| Observed Failure | Root Cause | Resolution Command |
|---|---|---|
| Read-only filesystem error | Dirty disk unmount / filesystem faults | sudo touch /forcefsck && sudo reboot |
| Permission denied writing wtmp | Incorrect file ownership or group mask | sudo chown root:utmp /var/log/wtmp && chmod 664 |
| No space left on device | Disk or inode capacity exhausted | sudo journalctl –vacuum-time=3d && apt-get clean |
| Failed to start during boot | Truncated binary log after hard freeze | Recreate wtmp/utmp files with proper permissions |
Repairing filesystem integrity and recreating corrupted log files guarantees that Ubuntu updates session audit markers cleanly during every boot and shutdown.