Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2008 00:20:34 +1100
From:      Sean <sean@gothic.net.au>
To:        "Carlos A. M. dos Santos" <unixmania@gmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: How to quickly determine if UFS2 FS is "clean" from command	line?
Message-ID:  <4954DA22.5000904@gothic.net.au>
In-Reply-To: <e71790db0812260331x3c166de2u80db2f6aa7e2f8fa@mail.gmail.com>
References:  <20081226011402.GP4100@albert.catwhisker.org>	<20081226012224.2fbd579a@gluon>	<20081226014956.GR4100@albert.catwhisker.org>	<20081226063542.GA20518@shark.localdomain>	<20081226063946.GX4100@albert.catwhisker.org> <e71790db0812260331x3c166de2u80db2f6aa7e2f8fa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Carlos A. M. dos Santos wrote:
> On Fri, Dec 26, 2008 at 4:39 AM, David Wolfskill <david@catwhisker.org> wrote:
>> On Fri, Dec 26, 2008 at 09:35:42AM +0300, Sergey Zaharchenko wrote:
>>> ...
>>> Some of the stuff you want can be found here:
>>>
>>> root@shark:~# file -s /dev/ufs/home
>>> /dev/ufs/home: Unix Fast File system [v2] (little-endian) last mounted on /home, volume name home, last written at Fri Dec 26 06:33:07 2008, clean flag 0, readonly flag 0, number of blocks 13631488, number of data blocks 13202246, number of cylinder groups 145, block size 16384, fragment size 2048, average file size 16384, average number of files in dir 64, pending blocks to free 4, pending inodes to free 0, system-wide uuid 0, minimum percentage of free blocks 8, TIME optimization
>>>
>>> You probably want the clean flag (which is 0 for me because that device
>>> node is mounted).
>> Very nice; thanks!  Seems that both ffsinfo(8) & file(1) can do the job
>> quickly; dumpfs(8) can do it, but takes around 33 seconds for a 400 GB
>> file system (because it also dumps the cylinder groups).
> 
> Be warned that file(1) resides at /usr/bin and depends on
> /usr/share/misc/magic*, so it may not be available in early boot
> stages, when /usr is not mounted yet. The following combination will
> suffice, and depends only on /sbin and /stand:
> 
>      /sbin/ffsinfo -l 1 /usr/local | /rescue/sed -n 's/^clean *int8_t
> *\(.*\)/\1/p'
> 

Except FreeBSD hasn't had /stand for a long while, and there's no 
/rescue/sed (at least on 6.x and 7.x). Also, /stand was only ever 
populated on install and there's no guarantees it was ever up to date.



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