Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2007 11:25:41 +0200
From:      Karol Kwiatkowski <karol.kwiat@gmail.com>
To:        Ian Smith <smithi@nimnet.asn.au>
Cc:        Chris <chrcoluk@gmail.com>, freebsd-questions@freebsd.org, Bill Moran <wmoran@potentialtech.com>
Subject:   Re: fsck strangeness
Message-ID:  <46CD5295.4050406@gmail.com>
In-Reply-To: <Pine.BSF.3.96.1070823183408.26941D-100000@gaia.nimnet.asn.au>
References:  <Pine.BSF.3.96.1070823183408.26941D-100000@gaia.nimnet.asn.au>

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

[-- Attachment #1 --]
Ian Smith wrote:
> On Thu, 23 Aug 2007, Karol Kwiatkowski wrote:
>  > Ian Smith wrote:
>  > > On Wed, 22 Aug 2007, Chris wrote:
>  > >  > If its bad to run fsck on a mounted read,write then why does
>  > >  > background fsck do it? or you talking about foreground fsck only?
>  > > 
>  > > Well I was referring to foreground fsck, and I still don't know why
>  > > running it on a mounted fs is 'bad' when fsck runs in 'NO WRITE' mode
>  > > anyway when it finds a fs is mounted, hence my query above.
>  > 
>  > Here's my understanding:
>  > 
>  > Mounted fs (rw) isn't in stable state, there may be some writes to it -
>  > daemons, buffers flushes, etc. In this condition fsck can report
>  > inconsistency. And fsck running in 'NO WRITE' won't help anyway :)
> 
> a) Absolutely.
> 
> b) Indeed it usually does, fairly consistently, especially on /var.
> 
> c) No it won't help (except where it can help locate problems in a real 
> mess like bad blocks), but the assertion in question was, can it hurt?

Ah sorry, I missed that. With 'NO WRITE' one can suppose it shouldn't
hurt anything except performance ;)

I made a quick scan through the source and it looks like it won't:

- in src/sbin/fsck_ffs/setup.c
if fs is mounted rw fswritefd is set to -1

- in src/sbin/fsck_ffs/fsutil.c
blwrite(), flush() and ckfini() won't write anything if fswritefd<0

Unless, of course, I'm missing something.

Cheers,

Karol

-- 
Karol Kwiatkowski   <karol.kwiat at gmail dot com>
OpenPGP 0x06E09309


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRs1SnQhgT0HIecD5AQiABggAn8CojkhT5LsKG9B7rf4wgO1/Qk61mKR3
q9ZPPZcVzv2/UOS3ysDeBbkybc5+hTkD+b8Zpxe3e0Mlv8bqcJ3bdGRld2skuNls
7QamVHg68ZyQj0AZoXlRTZ4PjPfFCnabqevBRlxW/o04xr/DcqKeH1+C7Mb1h/QJ
OatYAxIbZg94gocz0Io9E513qLQZfx/RUM2mU7FRoJVkw20hAIyKdtMOiTqcl7av
J3G3QF0/ND0qu9C6q3EdjU0/t31i/wxS0vs/pHzBVvIhmslYPwpWaF1m7QwxIBYN
oZls1ogToPgf4onpyq2wjnRiUICylOjggeUcQWepGTJjoBbO/aPftw==
=/J53
-----END PGP SIGNATURE-----
help

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