Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Dec 2008 01:22:24 +0000
From:      Bruce Cran <bruce@cran.org.uk>
To:        David Wolfskill <david@catwhisker.org>
Cc:        hackers@freebsd.org
Subject:   Re: How to quickly determine if UFS2 FS is "clean" from command line?
Message-ID:  <20081226012224.2fbd579a@gluon>
In-Reply-To: <20081226011402.GP4100@albert.catwhisker.org>
References:  <20081226011402.GP4100@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 25 Dec 2008 17:14:02 -0800
David Wolfskill <david@catwhisker.org> wrote:

> At work, we have some machines we're setting up that have a fair
> amount of UFS2 "scratch space."
> 
> While we would prefer to leave the file systems in question intact
> iff they are "clean," we do not want to run fsck(8) against them
> if they are not (because we expect that it would take too long);
> rather, we want to merely recreate them (with newfs(8)).
> 
> While I might be able to hack something together by cribbing
> appropriate bits of fsck_ffs(8), I'm a great deal more comfortable
> cobbling up glue scripts and the like -- I don't fancy myself all
> that much of a C coder.
> 
> 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.

-- 
Bruce Cran



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