-
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
Amend Dracut module to export ZFS root on shutdown #2766
Conversation
Make use of Dracut's ability to restore the initramfs on shutdown and pivot to it, allowing for a clean unmount and export of the ZFS root. No need to force-import on every reboot anymore.
Force importing is still required in case of crash, power loss, etc. It seems that being able to force import still has benefits and most users will still want to make force importing the default. It may be better to just import the hostid system so that ZFS will know that importing an unclean pool should be safe. |
We do need to retain the ability to force import the pool, but I don't think this patch prevents that in any way. It just allows for clean exports which is a good thing. Am I missing something? @l1k could you add a reference to this for any known outstanding issue this resolves. I suspect there's at least one. |
Potentially related to #2766. |
Exactly right, the ability to force-import remains untouched. I see that some issues on this were opened by folks using Debian or Ubuntu. There's no zfs-dracut deb package but I've prepared a patch. Will submit a pull request to the pkg-zfs repo tomorrow as it's already night here. Also, the dracut package in Debian fails to install the systemd services. That's another patch I'm working on. Will add the Debian bug number in a comment here once it's submitted. |
"I suspect there's at least one." Famous last words. |
There, I believe I've catched all issues related to this. Just a quick reminder to the Debian/Ubuntu users coming here because I've commented on their issue: Debian generates the initrd with initramfs-tools by default which lacks support for restoring the initrd on shutdown and pivoting into it. If you're using ZFS as your root filesystem, you need to switch to dracut. |
Make use of Dracut's ability to restore the initramfs on shutdown and pivot to it, allowing for a clean unmount and export of the ZFS root. No need to force-import on every reboot anymore. Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#2195 Issue openzfs#2476 Issue openzfs#2498 Issue openzfs#2556 Issue openzfs#2563 Issue openzfs#2575 Issue openzfs#2600 Issue openzfs#2755 Issue openzfs#2766
Awesome, thanks. Debian users: To properly export a ZFS root on shutdown you need to apply both the patch included with Debian bug #764393 as well as the one included with pull request zfsonlinux/pkg-zfs#122, rebuild dracut and pkg-zfs with git-buildpackage and install the resulting dracut and zfs-dracut debs. Works for me on Debian Jessie with systemd. |
Make use of Dracut's ability to restore the initramfs on shutdown and pivot to it, allowing for a clean unmount and export of the ZFS root. No need to force-import on every reboot anymore. Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs#2195 Issue openzfs#2476 Issue openzfs#2498 Issue openzfs#2556 Issue openzfs#2563 Issue openzfs#2575 Issue openzfs#2600 Issue openzfs#2755 Issue openzfs#2766
Make use of Dracut's ability to restore the initramfs on shutdown and pivot to it, allowing for a clean unmount and export of the ZFS root. No need to force-import on every reboot anymore.