Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2010 13:12:47 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        brucec@freebsd.org
Cc:        freebsd-fs@freebsd.org, freebsd-bugs@freebsd.org
Subject:   Re: bin/27687: fsck(8) wrapper is not properly passing options to fsck_<fstype>
Message-ID:  <20100925122853.W839@delplex.bde.org>
In-Reply-To: <201009242052.o8OKqaEk085455@freefall.freebsd.org>
References:  <201009242052.o8OKqaEk085455@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 24 Sep 2010 brucec@freebsd.org wrote:

> Synopsis: fsck(8) wrapper is not properly passing options to fsck_<fstype>
>
> Responsible-Changed-From-To: freebsd-bugs->freebsd-fs
> Responsible-Changed-By: brucec
> Responsible-Changed-When: Fri Sep 24 20:52:17 UTC 2010
> Responsible-Changed-Why:
> Over to maintainer(s).
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=27687

In fact, the description of the problem already shows that it isn't a problem:

% >Description:
% 
% 	If one boots single user and then does
% 		fsck -b 32 /foo
% 	fsck reports:
% 		fsck: illegal option -- b
% 		Usage: fsck [-BFdpvlyn] [-T fstype:fsoptions] [-t fstype] [special|node]...
% 	one must use fsck_ffs directly even though fsck should have every
% 	thing it needs from /etc/fstab to DTRT.

As fsck reports, it has a -T option for passing options.  -Tufs:-b32 seems
to work right.

The man page says more about this, but doesn't say what happens with multiple
-T or -t options.  I think they are concatenated at the fsck level, with the
order preserved, and then filtered when passed.  So
"-T ufs:-b16,-y -Tmsdosfs:-n -Tufs:-b32,-n" passes "-b16 -y -b32 -n" to
fsck_ffs and "-n" to fsck_msdosfs.  The effect of multiple options is
also undocumented in fsck_ffs.  In practice, the last one usually has
precedence, but "-b16 -b32 -b64" causes fsck_ffs to print that it uses
3 alternates (sic) although it actually only uses 1 alternative (sic)
(the last one).  Multiple alternatives are especially useless and
dangerous for -b (especially with multiple special files), but I used
them in these examples and testing because they are good for generating
messages for both errors and success.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100925122853.W839>