On Fri, Sep 4, 2020 at 11:10 AM Roger Oberholtzer
On Fri, Sep 4, 2020 at 7:41 AM Andrei Borzenkov
wrote: I see in /tmp/damount.log that the by-path is pointing to a new sdx1 value. But it is some other sdx1 that is mounted.
Using systemd-mount from within udev RUN rule creates race condition - systemd-mount tells systemd to mount this device, but this device becomes known to systemd only after RUN commands has been executed.
I guess. That is why I listed where the by-path was pointing when the RUN command was executing. I suspected that it was not correct yet when the RUN command was executing. But I saw that it was in fact correct.
So if the by-path entry points to the correct sdX1 when the RUN command runs, what else could systemd-mount or it's minions be looking at? Some other information other than the current definition of the device as it is in /dev?
Actually I think I was wrong. systemd-mount passes all parameters directly to systemd which creates a mount unit and queues start job for it. By default mount unit has dependency on its device so start job will wait until device becomes known to systemd. But it also means actual mount happens later. Are you absolutely sure these path names are unique and persistent at every point in time?
You may consider using SYSTEMD_WANTS in your rule instead which points to service template; pass device name as parameter.
I do not know anything about this. I will explore. Thanks for the pointer.
No, I do not think it will change anything.
I do not say it is necessary the reason for your problem, but as you also did not show any real information there is nothing that would allow to guess.
I do not know what other information to provide. I tried to be complete. If you can suggest some other information I will be happy to provide it.
Which is why I usually ask customers to generate supportconfig - because I also do not know in advance what may be relevant :) More serious - show actual mount units, mounted filesystems, device links and udev database before you insert disk. Enable systemd debug (see man systemd, SIGRTMIN+23 IIRC). Insert disk. Collect the same information again to show the difference. Collect full journalctl output (journalctl -b) that includes debug information. Tells what exact disk you have inserted to give something to look for. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org