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

ZFS (0.6.3) auto mount on startup in Debian #2498

Closed
ksb4ever opened this issue Jul 15, 2014 · 10 comments
Closed

ZFS (0.6.3) auto mount on startup in Debian #2498

ksb4ever opened this issue Jul 15, 2014 · 10 comments
Milestone

Comments

@ksb4ever
Copy link

Hi!
When in /etc/default/zfs ZFS_MOUNT is set to 'yes', no pools are available (and not mounted on startup, of course).

# zfs list
no datasets available
# zpool list
no pools available
# zpool status
no pools available

It is possible to mount zfs pool only after zpool import id/name.
If ZFS_MOUNT is set to 'no', zpools are available to mount.

@FransUrbo
Copy link
Contributor

I don't understand what you're saying...

Are you saying that setting ZFS_MOUNT=yes does NOT import and mount the filesystems and that setting it to 'no' DOES imports it!?

FYI, that setting have nothing to do with the actual import, just the following mount.

@ksb4ever
Copy link
Author

Ok, lets say I have pool mounted.
a) When I set ZFS_MOUNT to yes and reboot the system, pool is not mounted and even it's lost from pools list (look at my 1st post), so I need to import it again.
b) When ZFS_MOUNT stays no, after reboot pool is already mountable (no need to import).

@FransUrbo
Copy link
Contributor

Do you use root on ZFS?

I simply can't see any possibility for what you suggests in the code:

                case "$ZFS_MOUNT" in
                        ([Oo][Ff][Ff]|[Nn][Oo]|'')
                                exit 3
                                ;;
                esac

If (when) it's 'no', it cancels, and if it's not (i.e., 'yes'), it continues...

I have no idea how to debug or to help you here... You might want to take this to the list, maybe someone there could help...

@behlendorf behlendorf added this to the 0.6.4 milestone Jul 17, 2014
@behlendorf behlendorf added the Bug label Jul 17, 2014
@l1k
Copy link
Contributor

l1k commented Oct 6, 2014

Likely fixed by #2766 if Dracut is used.

behlendorf pushed a commit to behlendorf/zfs that referenced this issue 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
ryao pushed a commit to ryao/zfs that referenced this issue 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
@yarikoptic
Copy link

might (since detail is insufficient) be related to #2979 if import by id fails?

@yarikoptic
Copy link

ok -- I have upgraded to dailies (0.6.3-222d9d57jessie) and none of the partitions, nor pool itself got automatically mounted upon reboot. pool got imported though, and zfs mount -a works just fine to mount all the partitions. so it seems just that ZFS_MOUNT=yes is ignored. Also got a bit confused with a new option ZFS_INITRD_ADDITIONAL_DATASETS -- I took it as which partitions to mount in addition, i.e. not replacing the meanning of ZFS_MOUNT, right?

@FransUrbo
Copy link
Contributor

ok -- I have upgraded to dailies (0.6.3-222d9d57jessie) and none of the partitions, nor pool itself got automatically mounted upon reboot.

Any information or message to indicate why (not)?

Try removing any 'quiet' option on the kernel command line. Also, there's a 'zfsdebug=1' you could try.

Both those are only relevant if you boot of ZFS though.

pool got imported though,

'nor pool itself got automatically mounted'… So which is it, is it imported or not? A pool can't be mounted, only imported…

Are you running root on ZFS? Is the scripts /etc/init.d/zfs-{mount,share} run at boot?

Try:

find /etc/rc?.d -name '*zfs-*'

and past the output of it here.

Also got a bit confused with a new option ZFS_INITRD_ADDITIONAL_DATASETS -- I took it as which partitions to mount in addition, i.e. not replacing the meanning of ZFS_MOUNT, right?

'in addition to the root filesystem' yes - as in: used for filesystems such as /usr, /usr/local, /var etc, etc, where / is on ZFS. Otherwise, it isn't used.=

@yarikoptic
Copy link

those debug msgs -- they would be concerned with kernel not rc* bootup verbosity (which is of interest here to investigate init scripts behavior), or am I wrong?

# find /etc/rc?.d -name '*zfs-*'
/etc/rc0.d/K09zfs-mount
/etc/rc0.d/K01zfs-share
/etc/rc1.d/K09zfs-mount
/etc/rc1.d/K01zfs-share
/etc/rc2.d/S02zfs-share
/etc/rc2.d/S01zfs-mount
/etc/rc3.d/S02zfs-share
/etc/rc3.d/S01zfs-mount
/etc/rc4.d/S02zfs-share
/etc/rc4.d/S01zfs-mount
/etc/rc5.d/S02zfs-share
/etc/rc5.d/S01zfs-mount
/etc/rc6.d/K09zfs-mount
/etc/rc6.d/K01zfs-share

as for mounted-vs-imported -- it can be online (thus imported) but not mounted, and that is how it was upon reboot (I will reboot whenever I get a chance to get a clear(er) picture). But I could similarly unmount the entire pool while still keeping it online (i.e. imported):

# zpool status | grep state
 state: ONLINE
# mount | grep 'tank '
tank on /tank type zfs (rw,relatime,xattr,noacl)
# umount /tank
# mount | grep 'tank '
# zpool status | grep state
 state: ONLINE

or I am misunderstanding something?

@yarikoptic
Copy link

confirmed on reboot -- pool is imported (marked ONLINE) while nothing is mounted. issuing zfs mount -a mounted all partitions including the pool itself (/tank)

@behlendorf behlendorf modified the milestones: 0.6.5, 0.6.4 Feb 6, 2015
@behlendorf behlendorf added Bug - Minor and removed Bug labels Feb 6, 2015
@behlendorf
Copy link
Contributor

Closing as out of date due to the overhaul of the init scripts. Please open a new issue if this remains a problem.

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

No branches or pull requests

5 participants