Re: lvm2-monitor.servcie block boot process due to bad storage device

David Teigland <[email protected]> Thu, 25 Apr 2024 12:02:44 -0500
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
On Tue, Apr 23, 2024 at 08:41:01AM +0800, Winston Wen wrote:
> Hi,
> 
> If a device's IO does not respond, it will block in the path of
> partition scanning. But at this point, it has already created the
> part0, like /dev/sda, in devtmpfs, but the mutex of the device has been
> held by the partition scanning code, so all processes attempting to
> open it will enter a wait.
> 
> lvm scans and opens block devices under /dev/ during startup, so if
> there are any bad devices mentioned above, lvm2-monitor.server will be
> blocked, and because its type is oneshot, it will block the boot
> process, even if the poor device is not using lvm.
> 
> May I ask if there is a way to avoid it? For example, can the
> type of this service be changed from oneshot to simple? Or is there
> any other better way?

I suggest using the devices file, or a filter (depending on your lvm
version) to prevent lvm from scanning devices other than PVs.

Dave