From owner-freebsd-stable@FreeBSD.ORG Sat Jul 16 14:42:41 2005 Return-Path: <owner-freebsd-stable@FreeBSD.ORG> X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A9A016A41C for <freebsd-stable@freebsd.org>; Sat, 16 Jul 2005 14:42:41 +0000 (GMT) (envelope-from bv@bilver.wjv.com) Received: from wjv.com (fl-65-40-24-38.sta.sprint-hsd.net [65.40.24.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 841DA43D46 for <freebsd-stable@freebsd.org>; Sat, 16 Jul 2005 14:42:38 +0000 (GMT) (envelope-from bv@bilver.wjv.com) Received: from bilver.wjv.com (localhost.wjv.com [127.0.0.1]) by wjv.com (8.12.11/8.13.1) with ESMTP id j6GEgZDg007579; Sat, 16 Jul 2005 10:42:35 -0400 (EDT) (envelope-from bv@bilver.wjv.com) Received: (from bv@localhost) by bilver.wjv.com (8.12.11/8.13.1/Submit) id j6GEgZ4T007578; Sat, 16 Jul 2005 10:42:35 -0400 (EDT) (envelope-from bv) Date: Sat, 16 Jul 2005 10:42:34 -0400 From: Bill Vermillion <bv@wjv.com> To: Matthias Buelow <mkb@incubus.de> Message-ID: <20050716144234.GA7466@wjv.com> References: <20050715221356.5A5B916A42D@hub.freebsd.org> <20050716140835.GE6192@wjv.com> <20050716142918.GD752@drjekyll.mkbuelow.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050716142918.GD752@drjekyll.mkbuelow.net> Organization: W.J.Vermillion / Orlando - Winter Park ReplyTo: bv@wjv.com User-Agent: Mutt/1.5.6i X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED, J_CHICKENPOX_53 autolearn=failed version=3.0.4 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on bilver.wjv.com Cc: freebsd-stable@freebsd.org Subject: Re: dangerous situation with shutdown process X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bv@wjv.com List-Id: Production branch of FreeBSD source code <freebsd-stable.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-stable>, <mailto:freebsd-stable-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-stable> List-Post: <mailto:freebsd-stable@freebsd.org> List-Help: <mailto:freebsd-stable-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-stable>, <mailto:freebsd-stable-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 16 Jul 2005 14:42:41 -0000 At Sat, Jul 16, 2005 at 16:29 , our malformed and occasionally flatulent friend Matthias Buelow spewed forth this fount of brain juice: > Bill Vermillion wrote: > >You can fsck a mounted file system and fsck will run in read-only > >mode. That way you can check for problems, and if there is > >something wrong you can shutdown and restart. FreeBSD will NOT > >run fsck in anything other than READ ONLY when the file system is > >mounted > I thought fsck on a live (read-write) filesystem almost always > brings up errors (although only of a certain kind, like dangling > inodes) unless the fs has been completely quiescent for a while. > A quick check seems to confirm this: > ** /dev/ad4s3a (NO WRITE) > ** Last Mounted on / > ** Root file system > ** Phase 1 - Check Blocks and Sizes > ** Phase 2 - Check Pathnames > ** Phase 3 - Check Connectivity > ** Phase 4 - Check Reference Counts > UNREF FILE I=94257 OWNER=mkb MODE=100600 > SIZE=2397 MTIME=Jul 16 16:25 2005 > CLEAR? no The 'no' was supplied by the system, was it not. First line sas NO WRITE. > >And in the old days when drives were smaller and slower and > >perfomance needed to be maximized, from about Verision III through > >System V you could run fsck -S <device> from cron!! > >The -S flag was interesting in that it would actually re-write > >the freelist IF AND ONLY IF there was no corruption on the drive. > I'm amazed that this worked.. considering that the fsck would have > to be atomic then (i.e., basically halt all filesystem i/o while > it's running). We'd run it from cron as noted. And this was done overnight - in systems where users were there only in the daytime. It did make a difference in keeping perfomance up longer than without it. Without that you'd basically have to backup the fs, remake the fs, and then reload to get back the originally installed performance. But as I noted this was for the S51 file system. It was really slow. On my first Sys V.3 system, I made one file system with the old S51/Xenix layout, and everthing else was an FFS that was slightly modified from the the original BSD systems. That was probably about 1990. The performance on the S51 ON THE SAME DRIVE - was no better than 30% as fast as the FSS and most of the time it was only 10% as fast. Once all the old customers moved to newer OS versions the old fsck -S [note that it is capital S and not 's' - and you'll have to find a Sys V manual to document the differentce - and I don't have one handy at the moment]. And small businesses were very very reluctant to upgrade unless they were forced too. I did some Y2K patching on OSes that had been installed in the late 1980s. And about the latest anyone would be using a system there would be about 9PM - when the owner stayed late. With current systems, in particular net connected systems with email, you could not hope to find a quiescent system. However the S flag was rewrite the freelist ONLY if the rest of the fsck gave no errors. If there were problems, such as the unrefferenced file you showed in your example, the freelist would not be re-written. That's why it was OK to run it in cron. Anyone who had not worked with Unix systems of 10-25 years ago can't begin to appreciate how good things are today. Bill -- Bill Vermillion - bv @ wjv . com