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-mount ignores noauto for zvols in fstab #7374

Closed
gyakovlev opened this issue Mar 31, 2018 · 3 comments
Closed

zfs-mount ignores noauto for zvols in fstab #7374

gyakovlev opened this issue Mar 31, 2018 · 3 comments
Labels
Status: Stale No recent activity for issue

Comments

@gyakovlev
Copy link
Contributor

System information

Type Version/Name
Distribution Name gentoo
Distribution Version current
Linux Kernel 4.15.14-gentoo
Architecture x86_64
ZFS Version 0.7.7-r0-gentoo
SPL Version 0.7.7-r0-gentoo

Describe the problem you're observing

zfs-mount initscript ignores noauto mount option for zvols

At this point I'm unsure why zfs-mount tries to handle zvols? Is there any kind of use-case I'm missing?
As it seems pretty much every distro out there should have their own subset of scripts/tools what handle regular block device fstab mounts.

I see 2 ways of dealing with the situation:

  1. Remove zvol handling altogether. It's just regular block device and should be handled by existing toolset. It was around for decades and should handle all edge cases by now.
  2. add an additional check for noauto field in fstab.

@loli10K mind if I ask for any comments on how will redhat6 handle it if we remove zvol handling from zfs-mount? will something else mount those volumes? my guess is yes, just want to confirm.

@everyoneelse any comments for other linux distros that use provided sysvinit scripts?

I only use gentoo, it will handle it just fine.

sidenote:
systemd services are fine atm.
every zvol fstab entry get's it's own service created by systemd-fstab-generator, and zfs-mount does not touch zvols at all.

Describe how to reproduce the problem

User has the following line in /etc/fstab

 # cat /etc/fstab
/dev/zvol/noauto/fs /noautofs any defaults,noauto 0 0	# should be filtered out but it's not

zfs-mount will mount it anyway

fsck "$dev" && mount "$mntpt"

All it takes to mount a filesystem marked with noauto is explicit mount call, exactly what initscript does.

Include any warning/errors/backtraces from the system logs

 # cat /etc/fstab
/dev/zvol/noauto/fs /noautofs any ro,noauto 0 0	# should be filtered out but it's not
/dev/zd1 /noautofs any ro,noauto 0 0	# should be filtered out but it's not

 # set -x
 # read_fstab "^/dev/(zd|zvol)" #that's how zfs-mount runs it
+ read_fstab '^/dev/(zd|zvol)'
+ local 'match=^/dev/(zd|zvol)'
+ local i var TMPFILE
++ env
++ grep --colour=auto '^FSTAB_'
++ sed 's,=.*,,'
+ unset
+ i=0
+ read -r fs mntpnt fstype opts
+ egrep --colour=auto -qE '^#|^$'
+ echo /dev/zvol/noauto/fs
+ echo /noautofs
+ egrep --colour=auto -qE '^none|^swap'
+ egrep --colour=auto -qE '^swap'
+ echo any
+ grep --colour=auto -qE '^/dev/(zd|zvol)'
+ echo '/dev/zvol/noauto/fs /noautofs any ro,noauto 0 0	# should be filtered out but it'\''s not'
+ eval export FSTAB_dev_0=/dev/zvol/noauto/fs
++ export FSTAB_dev_0=/dev/zvol/noauto/fs
++ FSTAB_dev_0=/dev/zvol/noauto/fs
++ printf '%b\n' /dev/zvol/noauto/fs
++ sed s,/,_,g
+ fs=_dev_zvol_noauto_fs
+ eval export FSTAB_0=/noautofs
++ export FSTAB_0=/noautofs
++ FSTAB_0=/noautofs
+ i=1
+ read -r fs mntpnt fstype opts
+ egrep --colour=auto -qE '^#|^$'
+ echo /dev/zd1
+ egrep --colour=auto -qE '^none|^swap'
+ echo /noautofs
+ egrep --colour=auto -qE '^swap'
+ echo any
+ grep --colour=auto -qE '^/dev/(zd|zvol)'
+ echo '/dev/zd1 /noautofs any defaults,noauto 0 0	# should be filtered out but it'\''s not'
+ eval export FSTAB_dev_1=/dev/zd1
++ export FSTAB_dev_1=/dev/zd1
++ FSTAB_dev_1=/dev/zd1
++ printf '%b\n' /dev/zd1
++ sed s,/,_,g
+ fs=_dev_zd1
+ eval export FSTAB_1=/noautofs
++ export FSTAB_1=/noautofs
++ FSTAB_1=/noautofs
+ i=2
+ read -r fs mntpnt fstype opts

 # env | grep FSTAB
FSTAB_1=/noautofs
FSTAB_0=/noautofs
FSTAB_dev_1=/dev/zd1
FSTAB_dev_0=/dev/zvol/noauto/fs
@gyakovlev
Copy link
Contributor Author

gyakovlev commented Mar 31, 2018

taking closer look it seems that there are even more issues:

  1. mountpoint=legacy datasets are mounted regardless of canmount=noauto property
  2. mountpoint=legacy datasets are mounted regardless of fstab noauto
  3. fsck being run for zvols regardless of fstab settings.

@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@stale stale bot closed this as completed Nov 24, 2020
@omnivagant
Copy link
Contributor

Still a number of issues here. I found that zfs-mount doesn't respect the sixth field in fstab entries being 0 or empty (which defaults to 0) and runs fsck anyway.

algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 14, 2022
Update upstream URL, source and pkgdesc.  By 2.0.0 ZoL became OpenZFS
and is a common effort with FreeBSD developers.

Enable on armhf and armv7.

Let OS handle fsck, mount & umount of fstab entries.  I've been running
with this patch since November last year.  Context:

  openzfs/zfs#12780
  openzfs/zfs#7374
behlendorf pushed a commit that referenced this issue Apr 15, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue #7374
Closes #12780
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
nicman23 pushed a commit to nicman23/zfs that referenced this issue Aug 22, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Sep 2, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
beren12 pushed a commit to beren12/zfs that referenced this issue Sep 19, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Sep 23, 2022
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
Signed-off-by: omni <omni+vagant@hack.org>
Issue openzfs#7374
Closes openzfs#12780
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale No recent activity for issue
Projects
None yet
Development

No branches or pull requests

2 participants