Dracut is tested and confirmed working on rootfs (and boot) with zfs. I tested with zfs-7.1 and dracut-044-r1 under systemd. The necessary file is /usr/lib64/dracut/modules.d/90zfs/export-zfs.sh - this is installed by sys-fs/zfs. In theory any zfs versions that provide this file should work, though I'm not sure it is really necessary to backport this. Note that this will probably only work under systemd - I don't believe that openrc will pivot back to dracut during shutdown. The functionality to do this has been standard in systemd and dracut for a while. I suppose you could add an && dep on systemd when using dracut, but inadvertently pulling in systemd when installing zfs is undesirable. If using zfs+dracut+systemd the export is completely automatic and requires no configuration (other than rebuilding the initramfs, which anybody using zfs on root will have to do anyway when installing zfs).
(In reply to Richard Freeman from comment #0) > Note that this will probably only work under systemd - I don't believe that > openrc will pivot back to dracut during shutdown. The functionality to do > this has been standard in systemd and dracut for a while. I suppose you > could add an && dep on systemd when using dracut, but inadvertently pulling > in systemd when installing zfs is undesirable. I'm considering switching to dracut because of bug 627320 and I'm interested in what the above means when using OpenRC. Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it result in issues? And what needs to be done to fix it? P.S. I believe this issue is already adressed in https://bugs.gentoo.org/626362#c12 with this as the result https://github.com/gentoo/gentoo/blob/master/sys-fs/zfs/zfs-0.7.1-r1.ebuild#L56
(In reply to Simon from comment #1) > > I'm considering switching to dracut because of bug 627320 and I'm interested > in what the above means when using OpenRC. > Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it > result in issues? > And what needs to be done to fix it? > Honestly, I'm not sure if there are any issues with openrc. If it pivots back then it might work fine. I haven't looked into how openrc works with any of the other apparently-working initramfs solutions. If it doesn't work then the solution would be to enable openrc to pivot back to dracut. That might require changes in either or both. It has been a while since I've run openrc...
(In reply to Richard Freeman from comment #2) > (In reply to Simon from comment #1) > > > > I'm considering switching to dracut because of bug 627320 and I'm interested > > in what the above means when using OpenRC. > > Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it > > result in issues? > > And what needs to be done to fix it? > > > > Honestly, I'm not sure if there are any issues with openrc. If it pivots > back then it might work fine. I haven't looked into how openrc works with > any of the other apparently-working initramfs solutions. > > If it doesn't work then the solution would be to enable openrc to pivot back > to dracut. That might require changes in either or both. > > It has been a while since I've run openrc... OK, thanks for the info! I'll simply give it a try and file a bug to OpenRC if it doesn't work correctly.
From what I understand from ZFS and from my discussions with ryao and some other ZFS people, ZFS users are not suppose to export their zpools if they are keeping the pool on the same system. Only in situations where zpools are going to be moved/migrated to another machine, should they be exported.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdc36a3d1f6fbcf8f1496c6e7887e94061a0aa54 commit fdc36a3d1f6fbcf8f1496c6e7887e94061a0aa54 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2019-08-18 00:46:50 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2019-08-18 01:04:15 +0000 sys-fs/zfs: update live ebuild clarify initramfs support. many people try to use different unsupported or outdated tools, only genkernel and dracut are tested. Bug: https://bugs.gentoo.org/628404 Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-fs/zfs/zfs-9999.ebuild | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
we don't depend on initramfs generator, but mention supported ones in postinst message. closing.