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

Linux: /etc/fstab and filesystems on ZVOL #1478

Closed
jimsalterjrs opened this issue May 28, 2013 · 8 comments
Closed

Linux: /etc/fstab and filesystems on ZVOL #1478

jimsalterjrs opened this issue May 28, 2013 · 8 comments
Labels
Type: Documentation Indicates a requested change to the documentation
Milestone

Comments

@jimsalterjrs
Copy link

If I do the following:

root@locutus:~# zfs create -V 10G locutus/zvolname
root@locutus:~# mkfs.ext4 /dev/zvol/locutus/zvolname
root@locutus:~# mkdir /mnt/zvolname
root@locutus:~# grep zvolname /etc/fstab
/dev/zvol/locutus/zvolname    /mnt/zvolname    ext4    defaults    0    0
root@locutus:~# mount /mnt/zvolname

So far, everything is fine. But when I restart the system, it attempts to mount /mnt/zvolname before the ZVOL is actually ready, resulting in a hung system.

Can we fix this, so that either ZVOLs are available earlier in the boot process or so that mounting them from fstab will be delayed until they are?

@ryao
Copy link
Contributor

ryao commented May 28, 2013

The patches in pull request #1477 could fix this problem.

@jimsalterjrs
Copy link
Author

I wondered about that, but didn't see that it specifically addressed how early in the boot process zvols were made available. Not being contentious, asking sincerely - what makes you believe that #1477 would help in this case?

Also - what are the odds / timeframe that the patches in #1477 will be added to mainline in the Ubuntu PPA? Sorry for my ignorance here.

@ryao
Copy link
Contributor

ryao commented May 28, 2013

It should guarantee that the zvols appear at pool import. As long as Ubuntu imports the pool before fstab is run, then it should work.

As for the PPA, that depends on a few factors. One is whether you are using the stable or daily PPA. Another is when @behlendorf merges the fix to master. @dajhorn has the ability to apply these fixes to the PPA before @behlendorf commits them to upstream, but that is his decision.

@jimsalterjrs
Copy link
Author

Thank you for the info. I'm currently using stable, but I can certainly switch to daily to evaluate, if these patches wind up in daily.

I could probably build from source if necessary to test, but might need a nudge - I do build things from source from time to time, but I'm not a dev so sometimes what seems blindingly obvious to others isn't, to me. ./configure ; make install is about my speed, at least at the levels of time I can realistically commit right now. =)

(Also, building from source would strictly be to help test - it wouldn't resolve my issue as I can't leave out-of-repo code on production servers.)

@ryao
Copy link
Contributor

ryao commented May 29, 2013

It occurred to me that Gentoo was not running the ZFS OpenRC script before fstab, so I have written a patch fixing that on systems with a ZFS rootfs. It is in pull request #1479. Systems without a ZFS rootfs will still have this problem, although I consider that to be a corner case.

@behlendorf
Copy link
Contributor

@jrssystemsnet This is really a distribution specific issue to stage the bring up properly during boot. As a workaround for now you might try adding the _netdev option to your fstab entry. On most distributions this will defer the mount until after the network is brought up which may be late enough to avoid the issue.

@jimsalterjrs
Copy link
Author

Actually I'd already discovered the _netdev option prior to your post, and yes, it does work. Thank you. =)

@behlendorf
Copy link
Contributor

@jrssystemsnet Great, I'm going to close this issue then since we seem to have a reasonable workaround and there's not much which can be done upstream. The downstream packagers will need to do whatever is right for their distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Indicates a requested change to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants