From: "heming.zhao@suse.com" <heming.zhao@suse.com>
To: David Teigland <teigland@redhat.com>
Cc: Peter Rajnoha <prajnoha@redhat.com>,
Martin Wilck <mwilck@suse.com>,
LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] LVM autoactivation and udev
Date: Wed, 23 Mar 2022 15:33:00 +0800 [thread overview]
Message-ID: <a4df63ee-1381-de03-7490-bb1d51fa1e0e@suse.com> (raw)
In-Reply-To: <20220321164431.GA23151@redhat.com>
On 3/22/22 00:44, David Teigland wrote:
> On Mon, Mar 21, 2022 at 04:57:09PM +0800, heming.zhao@suse.com wrote:
>> ```
>> Mar 10 10:27:54 Mobile-PC systemd[1]: Stopped target Local File Systems.
>> Mar 10 10:27:55 Mobile-PC systemd[1]: Reached target Local File Systems.
>> Mar 10 10:27:55 Mobile-PC lvm[658]: Udev database has incomplete information about device /dev/nvme0n1.
>> Mar 10 10:27:55 Mobile-PC lvm[658]: /dev/nvme0n1: Failed to get external handle [udev].
>> Mar 10 10:27:55 Mobile-PC lvm[658]: Udev database has incomplete information about device /dev/sda.
>> Mar 10 10:27:55 Mobile-PC lvm[658]: /dev/sda: Failed to get external handle [udev].
>> ```
>
> Since vgchange --monitor runs during startup, it should also override any
> udev settings to disable them, like pvscan does:
>
> init_obtain_device_list_from_udev(0);
> init_external_device_info_source(DEV_EXT_NONE);
>
> (Those are the default settings we use, so we don't see this.)
>
you mind me, I forgot SUSE chose to use udev by default.
So this is a SUSE special issue.
>
>> In my understand, lvm2-monitor.service does the "clean up" job, which will complete the
>> monitor job for thin/mirror/others LVs, which was created during initrd phase. (because
>> lvm_scan doesn't have ability to start monitoring.)
>> on current lvm2-monitor.service, the dependency asks this service start as early as possible:
>> ```
>> After=dm-event.socket dm-event.service
>> ```
>> It makes monitor service start too early, and triggers libudev not ready issue.
>>
>>
>> To fix above issue, we find a workaround:
>> ```
>> - After=dm-event.socket dm-event.service
>> + After=dm-event.socket dm-event.service sysinit.target
>> ```
>
> Yes, I think starting it later would be better. I don't know enough about
> these systemd targets to comment on how well that change would work. I've
> not given much attention to lvm2-monitor, but I've also wished it would
> start later>
>> And maybe there is another workaround (not verify):
>> ```
>> -ExecStart=@SBINDIR@/lvm vgchange --monitor y
>>
>> +ExecStart=@SBINDIR@/lvm vgchange --config 'devices { external_device_info_source="none" \
>> obtain_device_list_from_udev=0}' --monitor y
>> ```
>
> Let's patch vgchange monitor as mentioned above.
>
> Dave
>
I inclined to use the "--config" option to avoid booting warning.
(or write additional codes for vgchange "monitor_ARG")
I have two reasons:
1>
Martin & I also found it is a difficult to find the best time to start lvm2-monitor.service
So modification "After=" dependency will still failed with some cases.
2>
the lvm2-monitor.service helps to finish monitoring job for lvm_scan. So it's not necessary
to ask this service to handle the VG/LV which starting after switch rootfs. (These VG/LV
should be monitored by "pvscan --cache".)
So starting lvm2-monitor.service as early as possible is accepted.
Thanks,
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
next prev parent reply other threads:[~2022-03-24 15:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 15:29 [linux-lvm] LVM autoactivation and udev Martin Wilck
2022-03-09 16:27 ` David Teigland
2022-03-09 17:04 ` Martin Wilck
2022-03-09 17:26 ` David Teigland
2022-03-09 19:48 ` Martin Wilck
[not found] ` <1f49866ba907896dc3678b47c5bb68d87e28b3c1.camel@suse.com>
2022-03-09 20:07 ` David Teigland
2022-03-09 17:07 ` Roger Heflin
2022-03-09 17:17 ` Martin Wilck
2022-03-21 8:57 ` heming.zhao
2022-03-21 16:44 ` David Teigland
2022-03-23 7:33 ` heming.zhao [this message]
2022-03-23 7:51 ` Martin Wilck
2022-03-24 8:26 ` heming.zhao
2022-03-24 9:02 ` Martin Wilck
2022-03-24 19:01 ` David Teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4df63ee-1381-de03-7490-bb1d51fa1e0e@suse.com \
--to=heming.zhao@suse.com \
--cc=linux-lvm@redhat.com \
--cc=mwilck@suse.com \
--cc=prajnoha@redhat.com \
--cc=teigland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).