NetBSD Problem Report #60938
From zakinko@snowrabbit.org Thu Oct 29 17:17:03 2026
Return-Path: <zakinko@snowrabbit.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A4A721A923B
for <gnats-bugs@gnats.NetBSD.org>; Thu, 29 Oct 2026 17:17:03 +0000 (UTC)
Message-Id: <20261029171700.D5E95C9296@bambi.snowrabbit.org>
Date: Fri, 30 Oct 2026 02:17:00 +0900 (JST)
From: Showta Ishizaki <zakinko@snowrabbit.org>
To: gnats-bugs@NetBSD.org
Cc: zakinko@snowrabbit.org
Subject: makefs -o version=2 makes UFS2ea, unlike newfs -O 2
X-Send-Pr-Version: 3.95
X-From4GNATS: "Showta Ishizaki via gnats" <gnats-admin@NetBSD.org>
>Number: 60938
>Category: bin
>Synopsis: makefs -o version=2 makes UFS2ea, unlike newfs -O 2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 29 17:20:00 +0000 2026
>Originator: Showta Ishizaki
>Release: NetBSD 11.0 and -current (11.99.9)
>Organization:
>Environment:
System: NetBSD 11.0 amd64
Architecture: x86_64
Machine: amd64
>Description:
I noticed this while booting a -current kernel from 2021 on a disk
image made with makefs -t ffs -o version=2: the kernel refused the root
file system with EFTYPE. The image had magic 0x19012038, UFS2ea, and
not plain UFS2.
Since the UFS2ea split of 2022-11-17, newfs -O 2 makes plain UFS2 and
UFS2ea needs -O 2ea. makefs got an extattr option in the same commit,
but its default is 1, so -o version=2 alone gives UFS2ea. makefs(8)
lists the option without saying what the default is.
The 11.0 release images are made this way too.
distrib/amd64/installimage and liveimage set IMGFFSVERSION=2 and pass no
extattr, and the root partitions of NetBSD-11.0-amd64-install.img and
NetBSD-11.0-amd64-live.img both carry magic 0x19012038. They boot fine,
since the 11.0 boot loader knows UFS2ea, but a kernel from before the
split cannot mount them (the 2021 one above gave EFTYPE). alpha's
emuimage and the wii image use version 2 as well.
>How-To-Repeat:
$ mkdir root && echo hello > root/f
$ makefs -t ffs -s 8m -o version=2 a.img root
$ od -A n -t x4 -j 9564 -N 4 a.img
19012038
With -o version=2,extattr=0 the same command gives 19540119.
>Fix:
Make the default 0, so that makefs and newfs agree, and say so in the
manual. -o extattr=1 still gives UFS2ea for anyone who wants it.
I built makefs from -current (ac67e1168) on NetBSD 11.0/amd64 with and
without the diff. With it, -o version=2 gives 19540119; extattr=0,
extattr=1 and version=1 give the same magic as before. fsck_ffs -fn
from 11.0 is clean on every image. The makefs steps of
tests/sbin/fsck_ffs/t_check_quotas.sh, the one test that runs makefs -o
version=2, give the expected quota messages with the new makefs. I did
not mount the images (no root on that machine).
Diff against -current of 2026-10-30:
--- usr.sbin/makefs/ffs.c
+++ usr.sbin/makefs/ffs.c
@@ -205,7 +205,7 @@ ffs_prep_opts(fsinfo_t *fsopts)
ffs_opts->avgfilesize= -1;
ffs_opts->avgfpdir= -1;
ffs_opts->version = 1;
- ffs_opts->extattr = 1;
+ ffs_opts->extattr = 0; /* plain UFS2, as newfs -O 2 */
fsopts->fs_specific = ffs_opts;
fsopts->fs_options = copy_opts(ffs_options);
--- usr.sbin/makefs/makefs.8
+++ usr.sbin/makefs/makefs.8
@@ -374,7 +374,7 @@ Range: 1..2147483647.
.It Cm extattr= Ns Ar num , Cm e= Ns Ar num
UFS2 with extended attributes.
One of:
-0 to disable, or
+0 to disable (default), or
1 to enable.
.It Cm extent= Ns Ar num , Cm x= Ns Ar num
Maximum extent size.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.