lvm-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* lvm2-monitor.servcie block boot process due to bad storage device
@ 2024-04-23  0:41 Winston Wen
  2024-04-23 11:41 ` Zdenek Kabelac
  2024-04-25 17:02 ` David Teigland
  0 siblings, 2 replies; 3+ messages in thread
From: Winston Wen @ 2024-04-23  0:41 UTC (permalink / raw)
  To: lvm-devel

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?

Thanks!

-- 
Thanks,
Winston


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lvm2-monitor.servcie block boot process due to bad storage device
  2024-04-23  0:41 lvm2-monitor.servcie block boot process due to bad storage device Winston Wen
@ 2024-04-23 11:41 ` Zdenek Kabelac
  2024-04-25 17:02 ` David Teigland
  1 sibling, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2024-04-23 11:41 UTC (permalink / raw)
  To: Winston Wen, lvm-devel

Dne 23. 04. 24 v 2:41 Winston Wen napsal(a):
> 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?


Hi

We are aware of this weakness and we are thinking about the solution for this.

However - for booting -  you should not be actually monitoring things in ramdisk

(lvm.conf should use  monitoring=0)  - so the boot is monitore-less.


Once system is switch to rootfs - monitoring should be enabled with

vgchange --monitor y  (if enabled in /etc/lvm/lvm.conf)


But we need to rethink some caching strategy - as the code for plain lvm2 
command is now causing some troubles within dmeventd instance.


Regards

Zdenek


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lvm2-monitor.servcie block boot process due to bad storage device
  2024-04-23  0:41 lvm2-monitor.servcie block boot process due to bad storage device Winston Wen
  2024-04-23 11:41 ` Zdenek Kabelac
@ 2024-04-25 17:02 ` David Teigland
  1 sibling, 0 replies; 3+ messages in thread
From: David Teigland @ 2024-04-25 17:02 UTC (permalink / raw)
  To: Winston Wen; +Cc: lvm-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-25 17:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23  0:41 lvm2-monitor.servcie block boot process due to bad storage device Winston Wen
2024-04-23 11:41 ` Zdenek Kabelac
2024-04-25 17:02 ` David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).