From nobody Sat Nov 21 01:10:13 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jWYz93Q7Zz71Rly for ; Sat, 21 Nov 2026 01:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jWYz92HVvz4stv for ; Sat, 21 Nov 2026 01:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795223413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3YaeQPQxnta59HavGrmE5LPHB91emprAaUvS6eAQ6h0=; b=elT2p/uuTww8UGwcDcJ6+TcEdUZ6Poxe+dVSZr3f+RrdLLoYwX36L/lLN8yvX/ovDFYLo5 VakGD/RyDpUs5YX+scXmxsslGIaVKdwkp2YgufnDWymC0zr+TCXSpsoOCFLkOQrbJFIDaJ WSqxMLV2TvxioOjMtlJ8xWrgztHIR0hEh1U9K2cooeHidb2YMtUryEl4IWPC6DhO+EXH4n FLe0HbEH4+BUAl/v0rqR1xOwFWf8CCRAbYCxmqEvE91yOziuZgteXOYJ6dj3Nt1VwtFjIM /JjnhJq9mscotl0mKb4EfIuu4JfgcuWL7dPvLD347ajYjSf3EphQqREg0Ev3+w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795223413; b=XWxYMOdbXIAxqIhlhFD/TIM+IicAJIFlEI6rvkUa1DmqoCGLWehwa7KXGY7HahEoyvs7T7 zGYfu3FunSNGL24uSlBN17wf37rB5rwDu6i7f+qbTv3Gsrh35H/YffOh+OYRriyqRRp3HE S7jdU/uipKA8Fj4ahtgsRMoIZ/iZjCdkXc13w8epgQK1ADvS9q0K6qZLdMATw6Afd5E6MY 49JlW8zVhv7AjmE+d7vB5NUQPTq2gs9Dx2lieDh31+OACXdYh5ONq4Sh417frgKMFCEdCI tYwWh346nFTOxqtB02TparLX4A2UZpy3g6hlSG7CovKfut2mKEu0mqheFgDuqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795223413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3YaeQPQxnta59HavGrmE5LPHB91emprAaUvS6eAQ6h0=; b=l9CsYBi/8U/HXgxoapvVBmg7ehsuMh3+Gbu3+yYqqXi3KD6S2/FmcSXnp3SaP5zgobQ1VZ C6KYd8EqNhenJ/pwSUSDynuWU60aBrhPy0THmxl40DpuNTgOH3G6LqonWMTPOC17sO3P8W ASjEsxLXd//LnkfIrSR7K6OypruhOioTWQyNOnlC82Mh0wdp/+FyL3eFUmpFfWkHINKoer UtLbGNWk3CAedY87wP5WEColEQy7arRUiRrBztUfCGN5MlfUZENKwuxA+aLzUiwh0lk15N cqoOzJHiZmLRHYNGLVZ0YAft30sfROevAbYEwqngbHxznZ8hehqiajDFbpdKPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jWYz91C4Vz1C18 for ; Sat, 21 Nov 2026 01:10:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ea71 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 21 Nov 2026 01:10:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 6dc19a71f70c - main - Add a -b option to fsck(8) to specify an alternative superblock. List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dc19a71f70c99b36e4384aff75b3d71033e71c5 Auto-Submitted: auto-generated Date: Sat, 21 Nov 2026 01:10:13 +0000 Message-Id: <6b00ef75.ea71.55efcde8@gitrepo.freebsd.org> The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=6dc19a71f70c99b36e4384aff75b3d71033e71c5 commit 6dc19a71f70c99b36e4384aff75b3d71033e71c5 Author: Kirk McKusick AuthorDate: 2026-11-21 01:09:15 +0000 Commit: Kirk McKusick CommitDate: 2026-11-21 01:09:15 +0000 Add a -b option to fsck(8) to specify an alternative superblock. Pass the -b flag from the wrapper to the underlying filesystem checker. This allows users to specify superblock directly without the need to invoke the underlying checker manually. Reported by: Aadya Chinubhai PR: 27687 (from May 2001) MFC after: 1 week --- sbin/fsck/fsck.8 | 5 +++++ sbin/fsck/fsck.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sbin/fsck/fsck.8 b/sbin/fsck/fsck.8 index 271ac2843cd3..33c3f1e99513 100644 --- a/sbin/fsck/fsck.8 +++ b/sbin/fsck/fsck.8 @@ -37,6 +37,7 @@ .Nm .Op Fl Cdfnpvy .Op Fl B | F +.Op Fl b Ar block .Op Fl T Ar fstype : Ns Ar fsoptions .Op Fl t Ar fstype .Op Fl c Ar fstab @@ -123,6 +124,10 @@ to fail with a message that the partition has an unknown file system type. .Pp The options are as follows: .Bl -tag -width indent +.It Fl b Ar block +Use the block number +.Ar block +as the super block for the file system. .It Fl C Check if the .Dq clean diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 4c24cc9813e1..8293f2876c88 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -98,7 +98,7 @@ main(int argc, char *argv[]) struct fstab *fs; int i, rval = 0; const char *vfstype = NULL; - char globopt[3]; + char globopt[3], bopt[80]; const char *etc_fstab; globopt[0] = '-'; @@ -108,7 +108,7 @@ main(int argc, char *argv[]) TAILQ_INIT(&opthead); etc_fstab = NULL; - while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:c:")) != -1) + while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:c:b:")) != -1) switch (i) { case 'B': if (flags & CHECK_BACKGRD) @@ -169,6 +169,11 @@ main(int argc, char *argv[]) etc_fstab = optarg; break; + case 'b': + snprintf(bopt, sizeof(bopt), "-b=%s", optarg); + catopt(&options, bopt); + break; + case '?': default: usage();