From phk@critter.freebsd.dk  Sun Jun  4 13:41:14 2000
Return-Path: <phk@critter.freebsd.dk>
Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131])
	by hub.freebsd.org (Postfix) with ESMTP id 6739337B623
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Jun 2000 13:41:12 -0700 (PDT)
	(envelope-from phk@critter.freebsd.dk)
Received: (from phk@localhost)
	by critter.freebsd.dk (8.9.3/8.9.3) id WAA13902;
	Sun, 4 Jun 2000 22:41:09 +0200 (CEST)
	(envelope-from phk)
Message-Id: <200006042041.WAA13902@critter.freebsd.dk>
Date: Sun, 4 Jun 2000 22:41:09 +0200 (CEST)
From: Poul-Henning Kamp <phk@critter.freebsd.dk>
Reply-To: phk@critter.freebsd.dk
To: FreeBSD-gnats-submit@freebsd.org
Subject: Delayed fsck + mount of insignificant filesystems.
X-Send-Pr-Version: 3.2

>Number:         19001
>Category:       conf
>Synopsis:       Delayed fsck + mount of insignificant filesystems.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 04 13:50:00 PDT 2000
>Closed-Date:    Thu Aug 15 01:59:58 PDT 2002
>Last-Modified:  Thu Aug 15 01:59:58 PDT 2002
>Originator:     Poul-Henning Kamp
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Fregatten Jylland som Barn.
>Environment:

	All versions of FreeBSD

>Description:

	Many of the machines I administer have large but relatively
	inconsequential filesystems.

	It would be nice if they could be marked in /etc/fstab for
	"later fsck + mount" so that a lengthy fsck of these
	filesysetms does not hold up the rest of the boot process.

	If a small script were provided, along with a freeform string
	tag in /etc/fstab, one could fsck/mount the squid cache partitions
	right before squid is started with:
		/etc/rc.mount squid
	and news partitions right before inn with
		/etc/rc.mount news

	Further to this it should be possible to specify a "not important"
	flag so that if the fsck/mount doesn't succeed we just continue
	without the filesystem, rather than drop into single-user.


>How-To-Repeat:

	

>Fix:

	


>Release-Note:
>Audit-Trail:

From: Chris Dillon <cdillon@wolves.k12.mo.us>
To: Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/19001: Delayed fsck + mount of insignificant filesystems.
Date: Sun, 4 Jun 2000 17:59:32 -0500 (CDT)

 On Sun, 4 Jun 2000, Poul-Henning Kamp wrote:
 
 > >Description:
 > 
 > 	Many of the machines I administer have large but relatively
 > 	inconsequential filesystems.
 > 
 > 	It would be nice if they could be marked in /etc/fstab for
 > 	"later fsck + mount" so that a lengthy fsck of these
 > 	filesysetms does not hold up the rest of the boot process.
 
 I agree, this would be very helpful, especially if said system also
 performed other important functions that would otherwise take much
 longer to resume if these large filesystems had to be fsck'd
 first.  This of course will become moot once our filesystems no longer
 need to be fsck'd.
 
 > 	If a small script were provided, along with a freeform string
 > 	tag in /etc/fstab, one could fsck/mount the squid cache partitions
 > 	right before squid is started with:
 > 		/etc/rc.mount squid
 > 	and news partitions right before inn with
 > 		/etc/rc.mount news
 
 I think this could be done with absolutely no changes to the fstab
 format or any of the existing utilities.  You could simply add the
 'noauto' option and a pass number of 0 to keep them from being fsck'd
 and mounted at boot time, and then add a comment to the end of the
 line tagging them so that a script could fsck and mount them later.
 
 /dev/da0s1g             /cache.0        ufs     rw,noatime,noauto 0 0 #squid
 /dev/da1s1g             /cache.1        ufs     rw,noatime,noauto 0 0 #squid
 /dev/da2s1g             /cache.2        ufs     rw,noatime,noauto 0 0 #squid
 
 And the script could look something like this:
 
 #!/bin/sh
 for arg in $*; do
         filesystems=`grep "#${arg}" /etc/fstab | awk -F ' ' '{ print $2; }' | xargs echo`
         for filesystem in $filesystems; do
                 fsck -p $filesystem && mount $filesystem
         done
 
 I'm sure it could be done more elegantly, but I whipped that up
 quickly.
 
 > 	Further to this it should be possible to specify a "not important"
 > 	flag so that if the fsck/mount doesn't succeed we just continue
 > 	without the filesystem, rather than drop into single-user.
 
 This would be accomplished with what I have above, since 'noauto'
 assumes as much.  You could add a way to log a fsck or mount failure
 in the script via logger(1) or something like that.
 
 
 -- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net
    FreeBSD: The fastest and most stable server OS on the planet.
    For Intel x86 and Alpha architectures. ( http://www.freebsd.org )
 
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: ashp 
State-Changed-When: Sat Feb 9 11:33:18 PST 2002 
State-Changed-Why:  
Recently background fscks were introduced in -CURRENT.  Does 
this potentially help with this problem?  While I'm not sure 
that they will get merged back into STABLE, they will be 
available in FreeBSD 5.0+. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=19001 
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: schweikh 
Responsible-Changed-When: Tue Aug 13 14:10:28 PDT 2002 
Responsible-Changed-Why:  
Poul-Henning: if any of the proposed solutions do the trick for you, 
please feel free to close this PR. I don't want to timeout you :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19001 
State-Changed-From-To: feedback->closed 
State-Changed-By: phk 
State-Changed-When: Thu Aug 15 01:59:03 PDT 2002 
State-Changed-Why:  
OBE:  background FSCK is good enough for me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19001 
>Unformatted:
