Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Dec 2008 17:49:56 -0800
From:      David Wolfskill <david@catwhisker.org>
To:        hackers@freebsd.org
Subject:   Re: How to quickly determine if UFS2 FS is "clean" from command line?
Message-ID:  <20081226014956.GR4100@albert.catwhisker.org>
In-Reply-To: <20081226012224.2fbd579a@gluon>
References:  <20081226011402.GP4100@albert.catwhisker.org> <20081226012224.2fbd579a@gluon>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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