dracut_functions.sh: make sure device UUIDs are correct before creating systemd device units - #1918
dracut_functions.sh: make sure device UUIDs are correct before creating systemd device units#1918Cyanoxygen wants to merge 1 commit into
Conversation
df67a3a to
7d5a622
Compare
Sometimes the information read from udev may be outdated, for example a disk has just got repartitioned. We don't know why this happens, but it is better to make sure the unique identifiers are correct before returning from get_persistent_dev(), preventing it from waiting an non-existant device later on. We compare the ID provided by get_persistent_dev() and the probed result from blkid. If they don't match, we use the latter one. This inconsistency is observed during initramfs generation stage of the OS installation. It results in an unbootable OS, stuck at initrd trying to wait a nonexistant UUID. Signed-off-by: Xinhui Yang <cyan@cyano.uk>
7d5a622 to
fda1678
Compare
|
This issue is actually quite weird, sometimes as though U-Dev had some sort of "cache" in place for devices. I ran into this whilst installing AOSC OS, which runs I can confirm that this patch fixes the issue I ran into, but it could also be worth looking into why U-Dev did not refresh the device paths immediately. |
Then we should dive into systemd-udevd then, or should we manually trigger the refresh? |
|
Oh well. A quickly written script showed that I have a whole bunch of broken ones too:
So, reading from udev may be unreliable, we can either add an additional step to make sure they are correct, or switch to using |
|
Is there a bug filed with systemd about this? |
No AFAIK. Do you think we should treat this as an upstream issue? |
First yes, please. |
|
Marking as draft until we get feedback from systemd folks. |

Sometimes the information read from udev may be outdated, for example a disk has just got repartitioned. We don't know why this happens, but it is better to verify the unique identifiers before returning from get_persistent_dev().
We compare the ID provided by get_persistent_dev() and the probed result of blkid. If they don't match, we use the latter one.
This inconsistency is observed during initramfs generation stage of the OS installation, and can not be reproduced reliably, and may be platform dependent. It results in an unbootable OS, stuck at initrd trying to wait a nonexistant UUID.
This pull request adds a verification to confirm the device UUID we are going to wait for during the initramfs actually is correct. @MingcongBai can provide some details on the issue this PR is going to fix.
Changes
dracut-functions.sh: verify device UUID before creating device units for the initramfsChecklist