The blk-availability service (Block Device Availability) in Ubuntu Server is a helper script executed during system shutdown or reboot. Its primary purpose is to ensure that complex block devices, specifically those mapped by Device Mapper (like LVM volumes or Multipath devices), are cleanly deactivated before the root filesystem is unmounted. However, if your server uses standard, flat partitions (e.g., direct EXT4/XFS formatting on /dev/sda1) and does not utilize LVM, SAN multipathing, or complex software RAID setups, this script is entirely redundant. Disabling it shaves a fraction of a second off shutdown times and removes an unnecessary init dependency on simple virtual machines.
This guide explains how to completely disable the blk-availability.service in Ubuntu Server.
Stop and Mask the Availability Script
To ensure the systemd initialization sequence completely ignores this shutdown script, we must stop any currently active instance of the unit and mask it so that it cannot be called upon during the next power state transition.
- Log into your Ubuntu Server via SSH or local console using an account with
sudoprivileges. - First, stop the service (though it typically only runs at shutdown, this clears its loaded state):
sudo systemctl stop blk-availability.service - Next, disable the service to prevent it from loading on boot:
sudo systemctl disable blk-availability.service - To guarantee that no other dependent service can accidentally invoke it, mask the service entirely:
sudo systemctl mask blk-availability.service
Verify the Service Lockdown
By masking the service, you have effectively symlinked its unit file to /dev/null, ensuring the systemd manager cannot execute it under any circumstances.
To verify the lockdown is successful, run the following command to check the status of the daemon:
systemctl status blk-availability.service
The output will clearly state that the service is masked. You have successfully optimized your system initialization sequence by removing a redundant block device script, assuming your server architecture relies on simple partition layouts.