From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 26 01:49:56 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C49631065677 for ; Fri, 26 Dec 2008 01:49:56 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 780FD8FC24 for ; Fri, 26 Dec 2008 01:49:56 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.3/8.14.3) with ESMTP id mBQ1nufW071966 for ; Thu, 25 Dec 2008 17:49:56 -0800 (PST) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.3/8.14.3/Submit) id mBQ1nuou071965 for hackers@freebsd.org; Thu, 25 Dec 2008 17:49:56 -0800 (PST) (envelope-from david) Date: Thu, 25 Dec 2008 17:49:56 -0800 From: David Wolfskill To: hackers@freebsd.org Message-ID: <20081226014956.GR4100@albert.catwhisker.org> References: <20081226011402.GP4100@albert.catwhisker.org> <20081226012224.2fbd579a@gluon> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mCdhXfk5CmamXiy1" Content-Disposition: inline In-Reply-To: <20081226012224.2fbd579a@gluon> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: How to quickly determine if UFS2 FS is "clean" from command line? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Dec 2008 01:49:56 -0000 --mCdhXfk5CmamXiy1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 26, 2008 at 01:22:24AM +0000, Bruce Cran wrote: > ... > > Anyone know of a reasonable way to quickly determine whether or not > > a UFS2 file system is clean from the command line? >=20 > dumpfs will tell you the status of the 'clean' flag: >=20 > dumpfs /dev/ad0s1d | grep clean >=20 > That will output a line like: >=20 > cgrotor 0 fmod 0 ronly 0 clean 1 >=20 > Just like with fsck you can also tell dumpfs the previous mountpoint > too and it'll use the right device. So this is quite useful. A reality check later, I find that for the file systems in question, dumpfs(8) produces the wanted information (and quite a bit more) nearly instantly, then spends about 33 seconds dumping cylinder group information that I have no interest in. While I admitted not being much of a C coder, I have been known to hack a bit.... :-} I also see that the dumpfs(8) code has been fairly static in the last couple of years. Would anyone else be interested in a hack to dumpfs(8) in the form of a command line flag (e.g., "-s" -- as in "short" or "super block only") to tell it to just spit out the FS super block information and skip the cylinder group stuff? (The command presently has but one command line flag; it is "-m" and is optional; if present, it causes the program to spit out a newfs(8) invocation to re-create the file system in question.) I'd be willing to cobble it up, test it, and submit a PR.... Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --mCdhXfk5CmamXiy1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAklUOEMACgkQmprOCmdXAD2DfwCfT/c3m/R/MmXRMO3FvJTgWQXv gc8AnAw7YSz/NKmI+xcuMyBkCL0YM81e =hmw8 -----END PGP SIGNATURE----- --mCdhXfk5CmamXiy1--