From owner-freebsd-questions@FreeBSD.ORG Wed Aug 22 14:45:13 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01DAB16A418 for ; Wed, 22 Aug 2007 14:45:13 +0000 (UTC) (envelope-from chrcoluk@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id B083E13C483 for ; Wed, 22 Aug 2007 14:45:12 +0000 (UTC) (envelope-from chrcoluk@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so22447anc for ; Wed, 22 Aug 2007 07:45:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DM5woIjt1bUK70zEFc9vuv2xBIszo05uzOJcmTVau85C7rX1hxZJGLnsznyanNNOd2+IxhK+uCz2bKEjA8YXo6fWE09sLSoaLkZD1hPkX6mNkhRUtld6y4BwJFS0IPmaMTqBxJMCscQdw506b6Hus4dd/dbWwkR9tj+rgiqBakY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g3gRadlzKBfCZ8SgMXwwOu0Ec3z6vUFpx6pe7GWz28rD7o5i55p0hy3QfNPTpBFCXgKMk3+oFCIX2gaCC1aBfE40mMcmYf4Rvz8Ke0CcHuIWoxpnI9Z1RsXbdFlpeWQu5nRO6oSWIjHFDBPtsXfRya8SKLpvC1Sz2j3Ec+E3zpw= Received: by 10.142.142.16 with SMTP id p16mr43635wfd.1187792213845; Wed, 22 Aug 2007 07:16:53 -0700 (PDT) Received: by 10.66.238.4 with HTTP; Wed, 22 Aug 2007 07:16:53 -0700 (PDT) Message-ID: <3aaaa3a0708220716m5601bb4ewc8688225291ae7bd@mail.gmail.com> Date: Wed, 22 Aug 2007 15:16:53 +0100 From: Chris To: "Ian Smith" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-questions@freebsd.org, Bill Moran Subject: Re: fsck strangeness X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2007 14:45:13 -0000 On 20/08/07, Ian Smith wrote: > Sorry for the repeat post folks, but I goofed last time, leaving out the > subject line while replying to the digest. Still curious .. Ian > ======= > > On Sat, 18 Aug 2007 21:32:28 +0200 Erik Trulsson wrote: > > On Sat, Aug 18, 2007 at 08:21:42PM +0100, Christopher Key wrote: > > > Hello, > > > > > > I'm having some rather strange behaviour with fsck. > > > > > > When I boot the system, it asserts that all the file systems are clean, but > > > subsequently running an fsck on /dev/ad8s1e (mounted as /var) detects > > > errors. Even if this first check is run whilst the file system is mounted, > > > and is hence run in NO WRITE mode, a second check doesn't find block > > > errors. If I then unmount the file system and check the disk, it's fine, > > > as indeed it is if I unmount, remount, then check. However, if I then > > > reboot, the process repeats, and an fsck immediately after reboot will find > > > errors again. If I bring the system up in single user mode, and run fsck > > > either before or after mounting /var, it finds no errors. > > > > > > I'm running 6.2_RELEASE with a custom kernel based upon generic-smp, but > > > with a lot of unecessary bits removed, and geom_mirror compiled in. I > > > don't think it's the drive that's at fault, all the other partitions in the > > > slice are fine, it's a fairly new drive, and it passes a self test quite > > > happily. Included below is a transcript that attempt to show what's going > > > on in detail, is there anything else relevant? > > > > > > Can anyone suggest what might be going on and how to fix it, or suggest > > > some slightly better diagnostics? Apologies if this is an RTFM issue, I > > > have had a good dig through the handbook, but can't seem to find anything > > > that helps. > > > Running fsck on a file system that has been mounted read/write will almost > > always report spurious errors and can really screw up the disk if it tries > > to 'correct' those errors. > > I'm a bit confused by this. I've been running 'fsck -n' over FreeBSD > systems since 2.2.6, and modulo seeing the at-the-time inconsistencies > on those filesystems in /etc/fstab that are mounted, as Chris reported > and as are expected, I've never had a problem with it, nor seen the sort > of inconsistent results between runs that Chris is reporting. > > > You should normally not run fsck on a mounted filesystem and you should > > *NEVER* run fsck on a filesystem that has been mounted read/write. > > This seems to imply that using the -n switch may have different results > than not using it and having fsck determine 'NO WRITE' itself from the > fact that it's noticed that the fs is mounted? Are you suggesting by > "can really screw up the disk if it tries to 'correct' those errors" > that fsck might WRITE to a mounted fs that it's showing as 'NO WRITE'? > > I've never had any screwups with it, but then I've always specified -n. > > Later Bill Moran said: > > > Don't run fsck on mounted filesystems unless they're mounted read-only. > > > > Although, it's possible I misunderstood your description of the problem. > > so I'm still curious, and am wondering if Chris using SMP kernel and/or > geom_mirror might have anything to do with this? Or whether his use of > 'umount -f' might be (or cause) the problem indicated by his results? > > > > # umount -f /var > > > > > > > > > # mount /var > > Cheers, Ian > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > 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? Chris