Description of problem: When a system has tons of disks attached (~7000), user logins are slow due to "systemd --user" instance reading all the disks. A customer reported 11 seconds to log in: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- $ time ssh system date Tue Jul 6 06:39:59 GMT 2021 real 0m11.493s user 0m0.012s sys 0m0.004s -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Executing strace, we can see that all block devices (/sys/devices/virtual/block/<device>) are opened and stat'ed, which takes a lot of time in the end. IMO "systemd --user" needs to be optimized to either not retrieve this information or get it from "systemd --system" upon start. Version-Release number of selected component (if applicable): systemd-239-41.el8_3.2.x86_64 How reproducible: Always on customer site having VxVM volumes. Cannot reproduce locally using either iscsi or loopback devices
> Cannot reproduce locally using either iscsi or loopback devices there is https://github.com/systemd/systemd/issues/9518 in systemd 239 that prevents systemd --user to list every device, which makes it more difficult to reproduce on RHEL 8, but it's easy to reproduce on any other version (eg RHEL 9.2, Fedora Rawhide)