-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition in dracut-zfs (90zfs/zfs-load-key.sh) for keylocation on USB dongle #12065
Comments
PS: happy to contribute pull-request with above workaround if people think it's acceptable. |
Does |
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Oh, actually, can you try the fourth patch from #12108 (also referenced above here)? It's mostly a logical extension of your proposed update. |
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Patch tested OK, thank you very much! To answer your earlier question, it looks like And one suggestion: perhaps |
Also reduce password retries to 3 to match i-t Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Also reduce password retries to 3 to match i-t Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Great news, thanks for testing! Just settling being insufficient is odd, but not necessarily unexpected, it'd seem from other reports. Sure, updated the PR to split the 10 seconds into half-second intervals. |
Also reduce password retries to 3 to match i-t Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065
Also reduce password retries to 3 to match i-t Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065 Closes openzfs#12108
Also reduce password retries to 3 to match i-t Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065 Closes openzfs#12108
Also reduce password retries to 3 to match i-t Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065 Closes openzfs#12108
Also reduce password retries to 3 to match i-t Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes openzfs#12065 Closes openzfs#12108
System information
Describe the problem you're observing
After upgrading Ubuntu 20.10 to 21.04 (OpenZFS 0.8.x to 2.0.x), a server consistently fails to boot with the following displayed on the console:
This server loads its decryption key for its ZFS root filesystem from a removable USB dongle (
keylocation=file:///dev/disk/by-partlabel/xxxxxx
).Note that this is a pure root on ZFS deployment (with
/boot
collocated with the rest of the root filesystem), booted from ZFSbootmenu rather thangrub
. I also usedracut
rather thaninitramfs-tools
(the latter is more common on Ubuntu deployments) for ease ofZFSbootmenu
mgmt. I don't think any of this has a bearing on the issue here but I include the info in order to avoid any confusion.Describe how to reproduce the problem
Attempt to boot a system with
keylocation
on a USB dongle as shown above (following this method). This used to work fine with the previous Ubuntu release but it may just have been luck as there were no major changes in90zfs/zfs-load-key.sh
and the issue appears to be a race-condition per below.Investigations
Typically, just exiting the emergency shell a few seconds after the failure (typing CTRL-D at the prompt) successfully boots the system. Instrumentation of
90zfs/zfs-load-key.sh
(a simplels /dev/disk/by-partlabel/
beforezfs load-key "${ENCRYPTIONROOT}"
fails withNo such file or directory
), suggesting a race condition with udev.Workaround
Wrap
zfs load-key "${ENCRYPTIONROOT}"
within a loop; similar to what's done with the interactive password prompt case, eg:This successfully boots my system (headlessly) at the 2nd attempt (ie: a 0.5s delay).
Other notes
Shouldn't this script fail with an exit code in case of failure with
zfs load-key
(whatever the reason)?The text was updated successfully, but these errors were encountered: