Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450758 - When ZFS is the rootfs, the zfs script attempts to unmount / during shutdown before localmount has the opportunity to run.
Summary: When ZFS is the rootfs, the zfs script attempts to unmount / during shutdown ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Lowest trivial (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords: Bug, LATER
Depends on:
Blocks:
 
Reported: 2013-01-07 20:42 UTC by Richard Yao (RETIRED)
Modified: 2013-05-29 00:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to OpenRC script (zfs-0.6.1-gentoo-openrc-script.patch,563 bytes, patch)
2013-05-28 23:56 UTC, Richard Yao (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2013-01-07 20:42:09 UTC
Gentoo Linux systems using ZFS as their root filesystem will print messages about being unable to unmount datasets during system shutdown.

What happens during shutdwn is that OpenRC will invoke RC/init scripts' shutdown() functions in reverse order of dependencies. This means that zfs is called before localmount. When the rootfs is ZFS, zfs will naturally try to unmount it, but localmount has other stuff on top, which prevents that, causing information about the failure to unmount ZFS to be printed.

That is a cosmetic issue. I plan to address it in the future, but it is a low priority.
Comment 1 Uwe Sauter 2013-01-07 20:48:36 UTC
I don't know if the following is a bad idea. But in my understanding, you need an initramfs for ZFS to work as root. Within you mount your ZFS root FS and then execute the init from that FS.

Why can't the zfs init script not run before localmount is executed? This would reverse the current order of the init scripts and prevent the issue from happening...
Comment 2 Richard Yao (RETIRED) gentoo-dev 2013-02-06 02:07:29 UTC
(In reply to comment #1)
> I don't know if the following is a bad idea. But in my understanding, you
> need an initramfs for ZFS to work as root. Within you mount your ZFS root FS
> and then execute the init from that FS.
> 
> Why can't the zfs init script not run before localmount is executed? This
> would reverse the current order of the init scripts and prevent the issue
> from happening...

This has been on my mind, although I haven't had a chance to do proper testing yet.
Comment 3 Richard Yao (RETIRED) gentoo-dev 2013-05-28 23:56:34 UTC
Created attachment 349512 [details, diff]
Patch to OpenRC script

All major issues in the ZFS kernel code that acted as stabilization blockers are no resolved, so I am beginning to look at lower priorities issues, such as this one. The attached patch should fix it. It is a work in progress as I evaluate other cases that I might want to handle in the same ebuild revision.
Comment 4 Richard Yao (RETIRED) gentoo-dev 2013-05-28 23:57:08 UTC
(In reply to Richard Yao from comment #3)
> Created attachment 349512 [details, diff] [details, diff]
> Patch to OpenRC script
> 
> All major issues in the ZFS kernel code that acted as stabilization blockers
> are no resolved, so I am beginning to look at lower priorities issues, such
> as this one. The attached patch should fix it. It is a work in progress as I
> evaluate other cases that I might want to handle in the same ebuild revision.

That should be "now resolved", not "no resolved".
Comment 5 Richard Yao (RETIRED) gentoo-dev 2013-05-29 00:43:19 UTC
I have committed sys-fs/zfs-0.6.1-r1 with a variation of this patch.