zfs initrd script fails when rootdelay boot option is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zfs-linux (Ubuntu) |
Fix Released
|
Medium
|
Richard Laager |
Bug Description
It looks like that, when booting off zfs (zfs holds /boot) with the rootdelay boot option set, the boot process fails in the initrd fase, asking to manually import the pool using zpool import -f -R / -N. I only had one system with that parameter set, which I seldom reboot.
I did not find an upstream reference of this bug or behavior.
The error is caused by the fact the pool is already imported: "zpool status" executed on the initramfs prompt will correctly list the pool and all devices online. To continue, one has to export the pool, re-import it and exit the initramfs prompt after which regular booting continues. Not exporting and reimporting it leaves the pool readonly leading to boot errors further down the road (systemd units failing).
I noticed zfs_autoimport_
delay=
if [ "$delay" -gt 0 ]
then
# Try to import the pool read-only. If it does not import with
# the ONLINE status, wait and try again. The pool could be
# DEGRADED because a drive is really missing, or it might just
# be slow to be detected.
zfs_test_import
retry_nr=0
while [ "$retry_nr" -lt "$delay" ] && [ "$ZFS_HEALTH" != "ONLINE" ]
do
[ "$quiet" != "y" ] && log_begin_msg "Retrying ZFS read-only import"
/bin/sleep 1
zfs_test_import
retry_nr=$(( $retry_nr + 1 ))
[ "$quiet" != "y" ] && log_end_msg
done
unset retry_nr
unset ZFS_HEALTH
fi
unset delay
Edit: to be clear: I removed the rootdelay parameter, regenerated the initrd, and was able to boot successfully afterwards.
description: | updated |
description: | updated |
Changed in zfs-linux (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in zfs-linux (Ubuntu): | |
importance: | Undecided → Medium |
What did you have rootdelay set to? I just tested again now with "rootdelay=1" as well as the useless "rootdelay=0" and invalid "rootdelay=".
Try adding "set -x" to the top of /usr/share/ initramfs- tools/scripts/ zfs, rebuilding the init script, and rebooting with rootdelay set. Grab a picture of the output so I can see what it's running just before it fails.