How to quickly determine if UFS2 FS is "clean" from command
line?
David Wolfskill
david at catwhisker.org
Thu Dec 25 17:49:56 PST 2008
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?
>
> dumpfs will tell you the status of the 'clean' flag:
>
> dumpfs /dev/ad0s1d | grep clean
>
> That will output a line like:
>
> cgrotor 0 fmod 0 ronly 0 clean 1
>
> 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
--
David H. Wolfskill david at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20081226/438885e4/attachment.pgp
More information about the freebsd-hackers
mailing list