Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

l1k
Copy link
Contributor

@l1k l1k commented Oct 6, 2014

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.

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.
@DeHackEd
Copy link
Contributor

DeHackEd commented Oct 6, 2014

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.

@behlendorf behlendorf added this to the 0.6.4 milestone Oct 6, 2014
@behlendorf
Copy link
Contributor

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.

@behlendorf
Copy link
Contributor

Potentially related to #2766.

@l1k
Copy link
Contributor Author

l1k commented Oct 6, 2014

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.

@l1k
Copy link
Contributor Author

l1k commented Oct 6, 2014

"I suspect there's at least one."

Famous last words.

@l1k
Copy link
Contributor Author

l1k commented Oct 6, 2014

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.

behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 7, 2014
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
@behlendorf
Copy link
Contributor

Thanks @l1k, I've merged this as:

07a3312 Amend Dracut module to export ZFS root on shutdown

@behlendorf behlendorf closed this Oct 7, 2014
@l1k
Copy link
Contributor Author

l1k commented Oct 7, 2014

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.

ryao pushed a commit to ryao/zfs that referenced this pull request Nov 29, 2014
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants