The e2scrub_reap service is a systemd background job in Ubuntu designed to clean up lingering, stale LVM snapshots created by the e2scrub utility. The e2scrub tool allows for online checking of ext4 filesystems residing on Logical Volumes (LVM) by taking a snapshot, running e2fsck on the snapshot, and then destroying it. The e2scrub_reap service specifically exists to catch any snapshots that failed to delete properly. If your Ubuntu Server does not use LVM, or if it uses LVM but strictly relies on offline filesystem checks during maintenance windows rather than online scrubbing, this service is entirely redundant. It periodically wakes up, checks for snapshots that don’t exist, and goes back to sleep.
This guide explains how to completely disable the e2scrub_reap service in Ubuntu Server, optimizing your background processes on non-LVM deployments.
Stop and Mask the e2scrub_reap Service
To ensure systemd completely ignores this background cleanup task, we must disable and mask the service. This guarantees it will not be triggered by timer units or dependency chains.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, check if the service is currently running and force it to stop immediately:
sudo systemctl stop e2scrub_reap.service - Next, disable the service to prevent it from automatically launching on boot:
sudo systemctl disable e2scrub_reap.service - To absolutely guarantee that the daemon cannot be invoked by systemd timers (specifically
e2scrub_all.timer) or rogue scripts, mask it entirely:sudo systemctl mask e2scrub_reap.service
Verify the Service Lockdown
By masking the service, you have instructed systemd to symlink the unit file to /dev/null, effectively treating it as a black hole. The systemd manager will immediately reject any attempt to start it.
To verify the lockdown is successful, run the following command to check the status of the service:
systemctl status e2scrub_reap.service
The output will clearly state that the service is masked. Additionally, since the service is typically triggered by a systemd timer, you should ensure the overarching timer is not needlessly firing: systemctl disable e2scrub_all.timer. You have successfully streamlined your server by removing an unnecessary LVM snapshot garbage collector.