Re: Set ZFS pool ashift=14 for FreeBSD root pools?

Alan Somers <[email protected]> Tue, 12 May 2026 10:33:00 -0600
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <CAOtMX2hPpXrX43A3KKJgw+-nfaUyMFXbnUkQO4FLKYmB54WjtA@mail.gmail.com>
On Tue, May 12, 2026 at 10:15 AM Lionel Cons <[email protected]> wrote:
>
> On Tue, 12 May 2026 at 18:03, Alan Somers <[email protected]> wrote:
> >
> > On Tue, May 12, 2026 at 9:45 AM Lionel Cons <[email protected]> wrote:
> > >
> > > On Tue, 12 May 2026 at 17:36, Alan Somers <[email protected]> wrote:
> > > >
> > > > On Tue, May 12, 2026 at 8:46 AM Lionel Cons <[email protected]> wrote:
> > > > >
> > > > > On Tue, 12 May 2026 at 12:51, vermaden <[email protected]> wrote:
> > > > > >
> > > > > > > How can I set the ZFS pool ashift for root pools
> > > > > > > to a value like 14 (for FreeBSD inside a VM)?
> > > > > > >
> > > > > > > Lionel
> > > > > >
> > > > > >
> > > > > >
> > > > > > This has to be done before ZFS pool creation and it can be set like that:
> > > > > >
> > > > > > # sysctl vfs.zfs.min_auto_ashift=14
> > > > >
> > > > > How can I do this at install time for all root pools?
> > > > >
> > > > > Lionel
> > > >
> > > > I don't know how to do it if you use the vanilla install CD.  Maybe
> > > > you could boot the install CD, exit to a shell, set the sysctl, and
> > > > reenter the TUI.
> > > >
> > > > But if you have lots of machines to install, you might consider
> > > > spinning a custom CD, and if you do that then you can easily set the
> > > > sysctl or set "-o ashift=14" in ZFSBOOT_BOOT_POOL_CREATE_OPTIONS.  See
> > > > the SCRIPTING section of bsdinstall(8) for details.
> > >
> > > Plain ISO image.
> > >
> > > During install I get the question for ZFS options, with noatime being
> > > in the default string (which we remove, because noatime breaks
> > > software...) ... can I put the option in there?
> > >
> > > Lionel
> >
> > Yes you can.  But if you do that, you should also uncheck "Force 4K
> > Sectors", because that will set ashift=12.
>
> Is there a way to autodetect VMware, and then use an ashift balue
> which is double the block size of the parent root device? Because
> setting the ashift to the block size of a VM disk, which uses the
> block size of the parent FS, is a pretty bad idea.
>
> Lionel

I don't know if it's possible to autodetect whether a VM is running in
VMWare.  But even if it were, that would only tell you that VMWare is
the hypervisor.  It wouldn't tell you anything about the storage.
VMWare can be configured to use multiple types of storage.