FS#78004 - mkinitcpio-35.1-1 boot failed for slow devices like root on USB

Attached to Project: Arch Linux
Opened by Walt Jr. Brake (philliex) - Sunday, 26 March 2023, 16:45 GMT
Last edited by Toolybird (Toolybird) - Sunday, 02 April 2023, 22:30 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
My arch boot failed after recent upgraded, the console show the following message:
```
mount: /new_root: can't find UUID=faa2047d...
You are now being dropped into an emergency shell.
...
[rootfs ]#
```

I tested that upgrade to version 35.1-1 but revert the change of script `init`, boot succeeded.
It seems that step `resolve_device` cannot be skipped for "slow" devices like root on USB.
```
diff --git a/mkinitcpio-35/init b/build/init
old mode 100644
new mode 100755
index a2226db..f371ee6
--- a/mkinitcpio-35/init
+++ b/build/init
@@ -51,15 +51,8 @@ if [ "${break}" = "y" ] || [ "${break}" = "premount" ]; then
launch_interactive_shell
fi

-# If the tag is supported by util-linux mount, pass it as is.
-# Otherwise, use the resolved device path.
-case "$root" in
- 'UUID='* | 'LABEL='* | 'PARTUUID='* | 'PARTLABEL='*) : ;;
- *)
- rootdev="$(resolve_device "$root")" && root="$rootdev"
- unset rootdev
- ;;
-esac
+rootdev=$(resolve_device "$root") && root=$rootdev
+unset rootdev

fsck_root

```

Additional info:
* version 34-2 works, version 35.1-1 or newer doesn't

Steps to reproduce:
0. Install arch, make sure root is on USB device, and the mkinitcpio version is 34-2
1. Upgrade mkinitcpio to 35.1-1 or newer
2. Reboot
This task depends upon

Closed by  Toolybird (Toolybird)
Sunday, 02 April 2023, 22:30 GMT
Reason for closing:  Upstream
Additional comments about closing:  Assuming the fix will appear in a new mkinitcpio release sometime soon.
Comment by nl6720 (nl6720) - Sunday, 26 March 2023, 17:20 GMT
Are you perhaps not using the fsck hook?
Comment by Mark Wagie (yochananmarqos) - Sunday, 26 March 2023, 19:22 GMT
Just to be clear, you are fully up to date and have tested mkinitcpio 35.2-1?
Comment by Walt Jr. Brake (philliex) - Monday, 27 March 2023, 01:06 GMT
@nl6720
Yes I'm removed fsck hook, and version 35.2-1 boot succeeded after add fsck hook back. Maybe it need to check whether the fsck hook enabled or not to skip the "resolve_device" step?

PS: I have a question: What is the benefit to skip "resolve_device" step when "tag is supported by util-linux mount"?

@Mark Wagie
Yes I tested on both version 35.1-1 and 35.2-1, the workaround is same as "revert the change" what I said.
Comment by nl6720 (nl6720) - Monday, 27 March 2023, 05:14 GMT
The advantage of passing tags directly to mount is that the output during boot is a little prettier (e.g. you see UUID=... that you specified instead of the resolved /dev/sd*).

https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/merge_requests/234 should fix this. Please test!
Comment by Walt Jr. Brake (philliex) - Monday, 27 March 2023, 10:05 GMT
Tested and passed. Thank you for the quick fix.

Loading...