Set "zfs=" or "root=zfs=" or "root=ZFS=" depending on system initramfs build tool or make it user configurable instead of basing it on distro #572
Replies: 3 comments
-
this is already user-overridable with the zfs property |
Beta Was this translation helpful? Give feedback.
-
Sorry, I did not see the relevant entry in the documentation, I am closing the issue. I have seen other reports with the same problem, hopefully the keywords in this issue might be helpful. Edit: is there a way to confirm the rootprefix used in the zfsbootmenu initramfs after setting the relevant zfs property? |
Beta Was this translation helpful? Give feedback.
-
by attempting to boot, I guess |
Beta Was this translation helpful? Give feedback.
-
ZFSBootMenu build source
Local build, dracut
ZFSBootMenu version
2.2.2
Boot environment distribution
Arch Linux
Problem description
I am using dracut as my initramfs build tool on Arch instead of mkinitcpio for my system images on all my computers.
zfsbootmenu-core.sh at line 977 sets the "zfs=" or "rootfs=" kernel parameters based on the distribution. In my case, it was setting it to "zfs=zroot/enc/ROOT" instead of "root=ZFS=zroot/enc/ROOT" since I am on Arch.
This seems to somehow work on my desktop but it failed to work on my server.
The server is running:
I wanted to switch from GRUB to ZBM before updating because updating broke GRUB on my desktop and I had to fix it on an unbootable system.
It seems like dracut-created initramfs images expect "root=" to be set in order for sysroot.mount to be properly set by zfs-generator and in my case it was not being set correctly. That meant dracut-mount was falling back to the mount-zfs.sh script. This in turn must have caused a race condition between dracut-mount and zfs-import-cache.service, with zfs-import-cache.service importing the root pool and dracut-mount trying to import it again via mount-zfs.sh and failing with:
This condition should maybe be filed as a bug on the OpenZFS repo.
After much troubleshooting, I finally edited zfsbootmenu-core.sh manually and changed "zfs=" to "root=ZFS=" on line 984, run generate-zbm again and booted to a perfectly working system. This problem might be attributed to the old kernel and tools versions installed on the server since it did not happen on my updated desktop system.
I think having an option to manually set the relevant commandline parameter would be very helpful for troubleshooting and general usage.
Here are the relevant entries from /run/initramfs/rdsosreport.txt when boot was failing:
Steps to reproduce
Build zfsbootmenu on Arch with kernel 5.15.82-1-lts, dracut 056, zfs-linux-lts 2.1.7_5.15.82.1-1, zfsbootmenu 2.2.2-1.
Build system initramfs with dracut instead of mkinitcpio. Add debug to org.zfsbootmenu:commandline.
Watch boot fail with:
Beta Was this translation helpful? Give feedback.
All reactions