From owner-freebsd-questions@FreeBSD.ORG Wed Jun 15 20:04:45 2011 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 6DF401065675 for ; Wed, 15 Jun 2011 20:04:45 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by mx1.freebsd.org (Postfix) with ESMTP id 55E158FC13 for ; Wed, 15 Jun 2011 20:04:45 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp019.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <0LMU00J30L3BP140@asmtp019.mac.com> for freebsd-questions@FreeBSD.ORG; Wed, 15 Jun 2011 13:04:23 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.148,0.0.0000 definitions=2011-06-15_08:2011-06-15, 2011-06-15, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1106150169 From: Chuck Swiger In-reply-to: <20110615195027.GA1196@thought.org> Date: Wed, 15 Jun 2011 13:04:23 -0700 Message-id: References: <20110615195027.GA1196@thought.org> To: Gary Kline X-Mailer: Apple Mail (2.1084) Cc: FreeBSD Mailing List Subject: Re: how do i fsck my server? 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, 15 Jun 2011 20:04:45 -0000 On Jun 15, 2011, at 12:50 PM, Gary Kline wrote: > can anybody clue me in on why fsck on my server [yes, of course as root] > seem to refuse to WRITE? Bad sectors on the hard drive are a somewhat common cause of this. > we had a power out locally and i caught my UPS at > the last second. i powered off my server to save the battery, etc, and > a few minutes ago when i ran > > # fsck -y /var > > there were unresolved inconsistancies that fsck was not allowed to resolve. Was /var mounted already? You shouldn't be running fsck on a live filesystem; boot single user or from a FreeBSD CD, and run fsck that way. > i tried to boot single use but the server (Dell 530) panicked. so finally, > after deliberately crashing the box three times, fsck_ufs ran. i was able to > ping outside. > > is there any way of scripting fsck *every* time i reboot this box? i just > want to make abs certain that the filesystems are clean. ---didn't fscking > used to be easier? You can set fsck_y_enable="YES" in /etc/rc.conf, but it shouldn't be necessary. The system can figure out for itself whether it shutdown cleanly or whether a fsck is necessary. Regards, -- -Chuck