Bug 266374 - FreeBSD 13.1:With ZFS installer reports sysctl: unknown oid 'vfs.zfs.min_auto_ashift'
Summary: FreeBSD 13.1:With ZFS installer reports sysctl: unknown oid 'vfs.zfs.min_auto...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
: 289615 (view as bug list)
Depends on:
Blocks: 15.0-metabug
  Show dependency tree / graph
 
Reported: 2022-09-12 06:40 UTC by Hermes T K
Modified: 2025-10-20 16:05 UTC (History)
9 users (show)

See Also:
des: mfc-stable15?
des: mfc-stable14?
des: mfc-stable13?


Attachments
Attaching the error image (26.21 KB, image/png)
2022-09-12 06:40 UTC, Hermes T K
no flags Details
Screenshot: not reproducible (57.24 KB, image/png)
2022-09-15 16:27 UTC, devnull
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hermes T K 2022-09-12 06:40:51 UTC
Created attachment 236510 [details]
Attaching the error image

When ZFS is chosen in the installer, the installation fails with 

installer reports sysctl: unknown oid 'vfs.zfs.min_auto_ashift'.
Comment 1 devnull freebsd_committer freebsd_triage 2022-09-14 05:31:06 UTC
(In reply to Hermes T K from comment #0)

That seems peculiar. I don't recall that when I last used the installer for 13.1.

Here, with an _installed_ 14.0-CURRENT: 

% sysctl vfs.zfs.min_auto_ashift
vfs.zfs.min_auto_ashift: 12
% freebsd-version ; uname -KU
14.0-CURRENT
1400066 1400066
% 

Does the checksum for your downloaded copy of the installer match the published checksum?
Comment 2 Hermes T K 2022-09-14 10:14:13 UTC
(In reply to Graham Perrin from comment #1)
Please find the below information with  13.1 installed

root@13_1:~ # uname -KU
1301000 1301000
root@13_1:~ # uname -r
13.1-RELEASE
root@13_1:~ # sysctl vfs.zfs.min_auto_ashift
sysctl: unknown oid 'vfs.zfs.min_auto_ashift'

Regards
Hermes T K
Comment 3 devnull freebsd_committer freebsd_triage 2022-09-15 16:27:10 UTC
Created attachment 236571 [details]
Screenshot: not reproducible

Installed using: 

FreeBSD-13.1-RELEASE-amd64-disc1.iso
Comment 4 Jose Luis Duran freebsd_committer freebsd_triage 2022-09-30 06:47:54 UTC
Granted vfs.zfs.min_auto_ashift is a legacy sysctl, it should *just work TM*.

With the migration to OpenZFS it is now vfs.zfs.vdev.min_auto_ashift.

    # sysctl -d vfs.zfs.min_auto_ashift
    vfs.zfs.min_auto_ashift: Min ashift used when creating new top-level vdev. (LEGACY)

    # sysctl -d vfs.zfs.vdev.min_auto_ashift
    vfs.zfs.vdev.min_auto_ashift: Minimum ashift used when creating new top-level vdevs
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-09-19 16:04:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=87a7b35f04b60956e9aa192680ae80773ec38f14

commit 87a7b35f04b60956e9aa192680ae80773ec38f14
Author:     Siva Mahadevan <me@svmhdvn.name>
AuthorDate: 2025-07-15 16:45:24 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-09-19 16:02:57 +0000

    bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid

    Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
    PR: 266374
    Pull request: https://github.com/freebsd/freebsd-src/pull/1851
    Reviewed by: emaste
    Sponsored by: The FreeBSD Foundation

 usr.sbin/bsdinstall/scripts/zfsboot | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Comment 6 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2025-09-19 16:26:16 UTC
*** Bug 289615 has been marked as a duplicate of this bug. ***
Comment 7 Ed Maste freebsd_committer freebsd_triage 2025-09-19 16:33:59 UTC
Backwards compat aliases were removed in:

commit ced72fdd69f27b54cf592351a36660cd9fd7dbd3
Author:     Rob Norris <robn@despairlabs.com>
AuthorDate: Tue Sep 9 03:03:01 2025 +1000
Commit:     GitHub <noreply@github.com>
CommitDate: Mon Sep 8 10:03:01 2025 -0700
 
    tunables: remove legacy FreeBSD aliases
    
    These are old pre-OpenZFS tunable names that have long been
    available via either conventional ZFS_MODULE_PARAM tunables or through
    kstats. There's no point doubling up anymore, so delete them.
    
    Sponsored-by: https://despairlabs.com/sponsor/
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
    Signed-off-by: Rob Norris <robn@despairlabs.com>
    Closes #17375

We should probably revert this (at least min_auto_ashift) for 15
Comment 8 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-09-19 17:08:38 UTC
There is 'vfs.zfs.min_auto_ashift=12' in /etc/sysctl.conf of exsting zfs-root systems. And it causes the error when they are upgraded to FreeBSD 16. So should removal of the tunable and how to fix the error be documented in UPDATEING?
Comment 9 Yasuhiro Kimura freebsd_committer freebsd_triage 2025-09-21 18:01:00 UTC
(In reply to Yasuhiro Kimura from comment #8)

I make following review D52665 to add entry about the issue to UPDATING.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-09-25 07:11:57 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=093f3f26e95198bf1db082763e915d7a53c6ba82

commit 093f3f26e95198bf1db082763e915d7a53c6ba82
Author:     Siva Mahadevan <me@svmhdvn.name>
AuthorDate: 2025-07-15 16:45:24 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-09-25 07:10:42 +0000

    bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid

    Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
    PR: 266374
    Pull request: https://github.com/freebsd/freebsd-src/pull/1851
    Reviewed by: emaste
    Sponsored by: The FreeBSD Foundation

    (cherry picked from commit 87a7b35f04b60956e9aa192680ae80773ec38f14)

 usr.sbin/bsdinstall/scripts/zfsboot | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-09-25 07:28:00 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f7dded412516d35e538ed05524d2a14870e62b0

commit 8f7dded412516d35e538ed05524d2a14870e62b0
Author:     Siva Mahadevan <me@svmhdvn.name>
AuthorDate: 2025-07-15 16:45:24 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-09-25 07:26:55 +0000

    bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid

    Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
    PR: 266374
    Pull request: https://github.com/freebsd/freebsd-src/pull/1851
    Reviewed by: emaste
    Sponsored by: The FreeBSD Foundation

    (cherry picked from commit 87a7b35f04b60956e9aa192680ae80773ec38f14)
    (cherry picked from commit 093f3f26e95198bf1db082763e915d7a53c6ba82)

 usr.sbin/bsdinstall/scripts/zfsboot | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Comment 12 Ed Maste freebsd_committer freebsd_triage 2025-09-25 14:39:07 UTC
> I make following review D52665 to add entry about the issue to UPDATING.

Yes, I think we will need an entry in UPDATING (and in fact it should have been in 13.0). But I think we should plan to revert the removal of the legacy names for now. My potential steps:

- Add UPDATING entry
- Revert legacy name removal
- Have the kernel emit a warning when a legacy name is used
- Remove legacy names again for (e.g.) 16
Comment 13 commit-hook freebsd_committer freebsd_triage 2025-09-25 14:42:59 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7e42cedae894c8910d95cefa2490235628243b2c

commit 7e42cedae894c8910d95cefa2490235628243b2c
Author:     Siva Mahadevan <me@svmhdvn.name>
AuthorDate: 2025-07-15 16:45:24 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-09-25 14:41:33 +0000

    bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid

    Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
    PR: 266374
    Pull request: https://github.com/freebsd/freebsd-src/pull/1851
    Reviewed by: emaste
    Sponsored by: The FreeBSD Foundation

    (cherry picked from commit 87a7b35f04b60956e9aa192680ae80773ec38f14)
    (cherry picked from commit 093f3f26e95198bf1db082763e915d7a53c6ba82)
    (cherry picked from commit 8f7dded412516d35e538ed05524d2a14870e62b0)

 usr.sbin/bsdinstall/scripts/zfsboot | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2025-10-09 14:47:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a28b44ddc3484fcf02420543a223053404a2bfce

commit a28b44ddc3484fcf02420543a223053404a2bfce
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-09-21 14:46:22 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-10-09 14:43:03 +0000

    zfs: Revert "tunables: remove legacy FreeBSD aliases"

    As of commit 87a7b35f04b6 ("bsdinstall: fix vfs.zfs.vdev.min_auto_ashift
    oid") the installer uses the current vfs.zfs.vdev.min_auto_ashift sysctl
    name, but there are many systems with configurations referring to the
    legacy vfs.zfs.min_auto_ashift sysctl.  For now, restore the aliases.

    This reverts commit ced72fdd69f27b54cf592351a36660cd9fd7dbd3.

    PR:             266374
    Reviewed by:    mm
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D52660

 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      | 244 +++++++++++++++++++++
 sys/contrib/openzfs/module/zfs/arc.c               |  32 +--
 sys/contrib/openzfs/module/zfs/dmu_zfetch.c        |  10 +-
 sys/contrib/openzfs/module/zfs/vdev.c              |   2 +-
 sys/contrib/openzfs/module/zfs/vdev_queue.c        |   2 +-
 sys/contrib/openzfs/module/zfs/vdev_removal.c      |   4 +-
 .../openzfs/tests/zfs-tests/include/tunables.cfg   |   4 +-
 7 files changed, 271 insertions(+), 27 deletions(-)
Comment 15 Ed Maste freebsd_committer freebsd_triage 2025-10-09 15:35:05 UTC
UPDATING being discussed in https://reviews.freebsd.org/D52665
Comment 16 Ed Maste freebsd_committer freebsd_triage 2025-10-10 21:57:05 UTC
Warning on use of legacy sysctls in review: https://reviews.freebsd.org/D53033
Comment 17 commit-hook freebsd_committer freebsd_triage 2025-10-16 16:34:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=654a3aa9a1de176648eec00b3c201c33b10bd325

commit 654a3aa9a1de176648eec00b3c201c33b10bd325
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-10-09 15:57:14 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-10-16 16:34:15 +0000

    zfs: Emit warning upon use of legacy sysctls

    The introduction of OpenZFS moved some sysctls, and legacy compat shims
    were added.  For example:

    Old (legacy) name: vfs.zfs.min_auto_ashift
    New name:          vfs.zfs.vdev.min_auto_ashift

    Upstream OpenZFS removed these, but we've temporarily restored them in
    FreeBSD.

    Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
    and thus cannot trivially have warnings added, so they are not handled.

    PR:             266374
    Reviewed by:    jlduran
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D53033

 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      | 41 +++++++++++++++++-----
 1 file changed, 33 insertions(+), 8 deletions(-)
Comment 18 commit-hook freebsd_committer freebsd_triage 2025-10-16 16:59:58 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0033878b92e1a00120fec4edf590715f7c4ecbc

commit f0033878b92e1a00120fec4edf590715f7c4ecbc
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-10-09 15:57:14 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-10-16 16:59:33 +0000

    zfs: Emit warning upon use of legacy sysctls

    The introduction of OpenZFS moved some sysctls, and legacy compat shims
    were added.  For example:

    Old (legacy) name: vfs.zfs.min_auto_ashift
    New name:          vfs.zfs.vdev.min_auto_ashift

    Upstream OpenZFS removed these, but we've temporarily restored them in
    FreeBSD.

    Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
    and thus cannot trivially have warnings added, so they are not handled.

    PR:             266374
    Reviewed by:    jlduran
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D53033

    (cherry picked from commit 654a3aa9a1de176648eec00b3c201c33b10bd325)

 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      | 41 +++++++++++++++++-----
 1 file changed, 33 insertions(+), 8 deletions(-)
Comment 19 commit-hook freebsd_committer freebsd_triage 2025-10-16 18:19:12 UTC
A commit in branch releng/15.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=53eda63d6de675b8a89bc036bc4a0a64b3c5e0c5

commit 53eda63d6de675b8a89bc036bc4a0a64b3c5e0c5
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-10-09 15:57:14 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-10-16 18:15:49 +0000

    zfs: Emit warning upon use of legacy sysctls

    The introduction of OpenZFS moved some sysctls, and legacy compat shims
    were added.  For example:

    Old (legacy) name: vfs.zfs.min_auto_ashift
    New name:          vfs.zfs.vdev.min_auto_ashift

    Upstream OpenZFS removed these, but we've temporarily restored them in
    FreeBSD.

    Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
    and thus cannot trivially have warnings added, so they are not handled.

    Approved by:    re (cperciva)
    PR:             266374
    Reviewed by:    jlduran
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D53033

    (cherry picked from commit 654a3aa9a1de176648eec00b3c201c33b10bd325)
    (cherry picked from commit f0033878b92e1a00120fec4edf590715f7c4ecbc)

 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      | 41 +++++++++++++++++-----
 1 file changed, 33 insertions(+), 8 deletions(-)
Comment 20 Colin Percival freebsd_committer freebsd_triage 2025-10-20 05:15:38 UTC
Ed, can this PR now be closed?
Comment 21 Ed Maste freebsd_committer freebsd_triage 2025-10-20 13:42:54 UTC
(In reply to Colin Percival from comment #20)
For the warning MFC to stable/14 is still outstanding; I'll close once my build/test finishes.
Comment 22 Colin Percival freebsd_committer freebsd_triage 2025-10-20 15:47:28 UTC
(In reply to Ed Maste from comment #21)
Ah thanks, I hadn't noticed that it wasn't on 14 yet.  It was still showing up in the 15.0 metabug so I was worried there was something else which needed to land there.
Comment 23 commit-hook freebsd_committer freebsd_triage 2025-10-20 16:04:13 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=fdf8dc1a01a603cbd1f9349068e43c7d8c609969

commit fdf8dc1a01a603cbd1f9349068e43c7d8c609969
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-10-09 15:57:14 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-10-20 13:40:06 +0000

    zfs: Emit warning upon use of legacy sysctls

    The introduction of OpenZFS moved some sysctls, and legacy compat shims
    were added.  For example:

    Old (legacy) name: vfs.zfs.min_auto_ashift
    New name:          vfs.zfs.vdev.min_auto_ashift

    Upstream OpenZFS removed these, but we've temporarily restored them in
    FreeBSD.

    Note that l2arc sysctls use generic sysctl functions (e.g. SYSCTL_UQUAD)
    and thus cannot trivially have warnings added, so they are not handled.

    PR:             266374
    Reviewed by:    jlduran
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D53033

    (cherry picked from commit 654a3aa9a1de176648eec00b3c201c33b10bd325)
    (cherry picked from commit f0033878b92e1a00120fec4edf590715f7c4ecbc)

 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      | 41 +++++++++++++++++-----
 1 file changed, 33 insertions(+), 8 deletions(-)