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

Rewrite dracut zfs module to fix #3875 and #3876 and other issues #3879

Closed
wants to merge 4 commits into from

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Oct 3, 2015

I have tested this against dracut 43 on my workstation. It boots my system just like genkernel's ZFS branch and fixes several issues:

  • No more export of pools on shutdown dirtying the vdev labels or polluting the history file (regression fix)
  • No more coherency issues between the initramfs archive and system in the hostid, zpool.cache and vdev.conf files.
  • No more failed boots from faulted pools when a vdev is added to the root pool.
  • The unnecessary awk command is no longer included. Similarly, the head and hostid utilities have become unnecessary and are no longer included as well.

There are a few behavior changes:

  • We load from the cachefile rather than importing. If an import is required due to an absent cachefile or pool absent from the cachefile, the system will drop to a shell and the user is expected to do it. Instructions are provided in this situation.
  • zfs:AUTO support has been dropped. This was ambiguous in two ways. One is that zfs:AUTO should mean to import a pool named AUTO and mount the root dataset as /. Two is that the behavior is non-deterministic when multiple pools have the bootfs. Users of zfs:AUTO will receive the instructions for a missing cachefile while users of autodetection through zfs and zfs: will receive explicit instructions about putting the dataset name on the commandline. Few, if any users, will be affected by this given that I am continually unable to find users of this functionality. The vast majority of users use GRUB2, which generates the commandline for users with root=ZFS=$BOOTFS.

I need to test against the versions of dracut used in RHEL6 and RHEL7. I intend to bring these changes into Gentoo for the few dracut users there afterward. I also need to improve the commit messages. I opened the pull request in advance of that for feedback.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Support for bootfs autodetection has been removed because there is no
telling which pool with a bootfs set should be used. It seems that few
knew that this was even possible since GRUB2 always specified a rootfs.

Signed-off-by: Richard Yao <ryao@gentoo.org>
@ryao ryao changed the title Rewrite dracut to fix #3875 and #3876 and other issues Rewrite dracut zfs module to fix #3875 and #3876 and other issues Oct 3, 2015
@ryao ryao force-pushed the dracut branch 4 times, most recently from e3533a0 to 2168e04 Compare October 3, 2015 11:38
fi

# Copy important files to /etc/zfs
for i in zpool.cache vdev.conf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note to myself, a udevadm trigger && udevadm settle is needed when vdev.conf is read.

@evolarium
Copy link

As I mentioned in #3605, I don't believe the current dracut scripts work when systemd >=220 is used.

Related bug with dmsquash and systemd 220.

systemd-fstab-generator used to fail gracefully, allowing the dracut-mount hook to mount the zfs root. However, it now will generate a faulty sysroot.mount, stopping the boot before the dracut-mount hook. I think a zfs-generator has to be written to generate the sysroot.mount, rather than doing it in the dracut-mount hook, as was done with the dmsquash.

RHEL 7 uses an older version of systemd, so it won't be an issue there.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
@Rudd-O
Copy link
Contributor

Rudd-O commented May 10, 2016

@evolarium I have fixed the systemd >= 220 issue, take a look at my pull request in this repo.

@ryao I would love to see how these patches of yours look, when rebased on top of that pull request.

@behlendorf behlendorf added the Component: Dracut dracut integration label May 12, 2016
@behlendorf
Copy link
Contributor

@Rudd-O's work has been merged to master. Let's get any additional dracut fixes rebased.

d402c18 A collection of dracut fixes

@ryao ryao force-pushed the dracut branch 2 times, most recently from 8e3036e to 2880435 Compare September 12, 2016 18:02
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryao if you're still interested in working on this can you please rebase it against master so it applys cleanly. @Rudd-O once rebase can you comment on the updated patches and review/test them for Fedora.

@Rudd-O
Copy link
Contributor

Rudd-O commented Sep 18, 2016

I am happy to test with my media center, which is my most complex setup, including but not limited to LUKS below ZFS.

Edit: when this is rebased I will run it against my testing rig. It's easy to do this for me now.

@Rudd-O
Copy link
Contributor

Rudd-O commented Oct 5, 2016

@ryao can you test your changes under Fedora with the following process?

  1. Build RPMs of your code (SPL and ZFS).
  2. Place results in directory .../path/to/rpms.
  3. Clone https://github.com/Rudd-O/zfs-fedora-installer to a local folder.
  4. In that folder, run sudo ./install-fedora-on-zfs --use-prebuilt-rpms=.../path/to/rpms/ --root-password=password --chown=$USER --chgrp=$USER root.img.
  5. Boot the root.img image using QEMU now; you can find information on how to do that online. You want to use qemu-system-x86_64 in accel=kvm mode or else it will be horribly slow.

This will tell us whether your changes work properly against Fedora.

Also, is there any chance you could help us by splicing the different conceptual changes into separate patches against HEAD?

Thank you in advance.

@behlendorf
Copy link
Contributor

Closing as out of date. Commit 7e8a2d0 updates dracut to pass the -F flag on shutdown to zpool export to prevent it from dirtying the labels. We can purse the other ideas proposed here in new PRs.

@behlendorf behlendorf closed this Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Dracut dracut integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants