The Logical Volume Scanner
In the Linux ecosystem, system administrators often rely on LVM (Logical Volume Manager) to flexibly manage disk space, allowing them to resize partitions and create snapshots on the fly. As part of this subsystem, Ubuntu typically deploys a background service called lvm2-pvscan.service. This service is designed to scan block devices (like hard drives and SSDs) for LVM physical volumes during the boot process or when new devices are hot-plugged, ensuring the system can recognize and assemble logical volumes automatically.
While LVM scanning is critical for servers and desktops that actually utilize Logical Volume Management, it is entirely unnecessary on systems that do not use LVM. If your Ubuntu installation uses standard, static partitions (like ext4 or xfs on raw disks) or relies exclusively on ZFS or btrfs for volume management, the lvm2-pvscan service is simply wasting CPU cycles and delaying the boot process by unnecessarily probing your drives. To optimize your server’s startup time and reduce unnecessary disk polling, you can safely disable this background LVM scanner.
How to Disable the Lvm2-Pvscan Service
You can permanently prevent the LVM pvscan daemon from probing your disks using standard systemctl commands.
- Open your Ubuntu Terminal (or SSH into your server).
- To disable the service so it does not load during the boot sequence, run:
sudo systemctl disable lvm2-pvscan.service
(Note: Depending on your exact LVM configuration, there may be multiple related services like lvm2-monitor that you might also want to disable if LVM is completely unused.)
- To ensure that monitoring scripts, udev rules, or automated package updates cannot accidentally trigger the service to start up in the background, you must mask it:
sudo systemctl mask lvm2-pvscan.service
The system will now completely ignore the lvm2-pvscan daemon. Your disks will mount normally using standard partition tables, and your system boot time will slightly improve due to the lack of LVM volume probing.