2

This is related to this question. I have 3 hard drives in my laptop and Fedora 32 is installed in /dev/sdb. /dev/sda and /dev/sdc are just extra storage formatted in ext4. Every boot takes more than a minute now but it was less than 20 seconds in Fedora 31. The culprit of the longer boot time seems to be lvm2-monitor.service. journalctl shows:

-- Reboot --
Jun 09 01:36:48 localhost.localdomain lvm[696]:   WARNING: Device /dev/sda not initialized in udev database even after waiting 10000000 microseconds.
Jun 09 01:36:58 localhost.localdomain lvm[696]:   WARNING: Device /dev/sda1 not initialized in udev database even after waiting 10000000 microseconds.
Jun 09 01:37:18 localhost.localdomain lvm[696]:   3 logical volume(s) in volume group "fedora_localhost-live" monitored
Jun 09 01:37:18 localhost.localdomain systemd[1]: Finished Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.

So, how to add a block to udev database manually that works after reboot?

1 Answers1

1

That's a known bug in LVM. Gentoo proposes the following workarounds:

  • Use vgscan as shown above (simplest solution)
  • Mount by UUID or label instead of using /dev/VG/root. It works because findfs is happy with just /dev/dm-42
  • Build a LVM binary with the -udev USE flag (specifically for the initramfs only!)
  • Disable udev dependency by including a minimal /etc/lvm/lvm.conf in the initramfs:

` /usr/src/initramfs/etc/lvm/lvm.conf Disable udev in lvm.conf

devices {
    # Disable scanning udev for md/multipath components.
    # This is required with recent versions of lvm2, even if you use another solution for
    # your LV device nodes; without it lvm commands will stall for minutes waiting for udev.
    multipath_component_detection = 0
    md_component_detection = 0
}
activation {
    # Set to 0 to disable udev synchronisation (if compiled into the binaries).
    udev_sync = 0
    # Set to 0 to disable the udev rules installed by LVM2
    udev_rules = 0
}
  • I saw this before but 1 has no effect. 4 breaks gdm. 3 is not an option. Will try 2. Does mounting by UUID means I modify /etc/fstab? – Basil Eric Rabi Jun 09 '20 at 00:11
  • Tried mounting by UUID in fstab. Also no effect. Thanks anyway. – Basil Eric Rabi Jun 09 '20 at 00:49
  • From the page linked in the answer: "Recent versions of sys-fs/lvm2 rely on sys-fs/udev... but there is no udev in a simple initramfs." This is specific to Gentoo, and may or may not be true with Fedora. Note that step 4 means having the LVM tools use a modified configuration within initramfs (when gdm is nowhere near running) and the standard one in the real /etc/lvm/lvm.conf when the system is running: it sounds like you modified the actual lvm.conf instead of the one that gets packaged in initramfs. – telcoM Jun 09 '20 at 06:15