From owner-freebsd-fs@FreeBSD.ORG Tue Mar 14 16:29:35 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A14816A41F for ; Tue, 14 Mar 2006 16:29:35 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBD8A43D46 for ; Tue, 14 Mar 2006 16:29:34 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k2EGTXFI075153; Tue, 14 Mar 2006 10:29:33 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <4416EF6A.3020201@centtech.com> Date: Tue, 14 Mar 2006 10:29:30 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: Ensel Sharon References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1329/Mon Mar 13 18:22:03 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: please help - explanation for odd fsck times/behavior needed X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2006 16:29:35 -0000 Ensel Sharon wrote: > System is FreeBSD 6.0-RELEASE with a 400gig data partition, mounted at > /data. I am using snapshots on that partition. > > Whenever the system crashes, it comes up very quickly, and launches a > background fsck of /data. Since this would take a long time, and I don't > want people using the system at a decreased performance, I always kill the > background fsck, comment out the filesystem in /etc/fstab, reboot the > system, and when it comes up fsck it in the foreground. It always takes 2 > hours. Always. > > So I decide that instead of doing the little boot, kill bg_fsck, comment > out, reboot dance, I will just set background_fsck="NO" in rc.conf, and > now I will just fsck in the foreground immediately after crashes. But it > is not working that way. > > Now what I see is: > > - system takes 20-30 minutes to come up > - when system does come up, /data is _mounted_ > - /data is in fact dirty > - if I unmount /data and fsck it, it only takes 15 minutes to fsck > > So I really don't get it - especially the last two items. Why would the > system mount /data dirty if it had no plans to background fsck it ? > > The only theory I have is this: > > - the boot takes a lot longer because it is fscking / and /var, NOT in the > background, and it has to wait to boot until that is finished. > > - the foreground fsck of /data always took two hours before, because it > was also fsck'ing / and /var at the same time > > - now that / and /var get fsck'd in the foreground before going > multi-user, it only takes 15 minutes to fsck /data > > > Is this ^^^ correct ? I still don't get the logic behind mounting /data > dirty though ... is there any way to specify "fsck / and /var. and go > multi-user, but don't mount any other partitions unless they are clean" ? First, this is how I have a system set up with similar characteristics as yours. I have these options in rc.conf: background_fsck="NO" fsck_y_enable="YES" and my fstab looks like: /dev/devicename /mntpoint ufs rw,otheroptions 0 2 So, when my system goes down unclean, and I boot back up, all the filesystems will be fsck'ed, starting with root, then var, then my other mount points, in order of the pass number in the fstab (above, mine is set to 2). You should have root 1, then var 2, and other partitions 3,4, etc probably. If you are using softupdates with UFS2, which presumably you are, then you can do background fsck's, and mount the dirty partition and begin using the filesystem before fsck's start. This works by mounting the filesystem, then 60 seconds later (configurable), beginning a bgfsck. Before the background fsck can start, it must take a snapshot of the filesystem to run against. That alone can take 1-2 hours, depending on filesystem size and how full it is, and how busy it is. Because of that time delay, I prefer to do foreground fsck's. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------