From owner-freebsd-stable@FreeBSD.ORG Wed Jul 20 03:22:53 2005 Return-Path: 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 B656A16A41F; Wed, 20 Jul 2005 03:22:53 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63B2943D45; Wed, 20 Jul 2005 03:22:53 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id j6K3MfLR042449; Tue, 19 Jul 2005 20:22:45 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200507200322.j6K3MfLR042449@gw.catspoiler.org> Date: Tue, 19 Jul 2005 20:22:41 -0700 (PDT) From: Don Lewis To: oberman@es.net In-Reply-To: <20050714191449.A8A615D07@ptavv.es.net> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Cc: freebsd-stable@FreeBSD.org, freebsd-questions@FreeBSD.org Subject: Re: dangerous situation with shutdown process X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 03:22:53 -0000 On 14 Jul, Kevin Oberman wrote: >> Date: Thu, 14 Jul 2005 20:38:15 +0200 >> From: Anatoliy Dmytriyev >> Sender: owner-freebsd-stable@freebsd.org >> >> Hello, everybody! >> >> I have found unusual and dangerous situation with shutdown process: >> I did a copy of 200 GB data on the 870 GB partition (softupdates is >> enabled) by cp command. >> It took a lot of time when I did umount for this partition exactly after >> cp, but procedure finished correctly. When you unmounted the file system, that should have flushed all the dirty files to the disk. >> In case, if I did “shutdown –h(r)”, also exactly after cp, the shutdown >> procedure waited for “sync” (umounting of the file system) but sync >> process was terminated by timeout, and fsck checked and did correction >> of the file system after boot. Did the timeout occur during the syncer shutdown, or at the "syncing disks ..." step. Did you have any ext2 file systems mounted? These should be manually unmounted before shutdown because they confuse the final sync code. >> System 5.4-stable, RAM 4GB, processor P-IV 3GHz. >> >> How can I fix it on my system? > > SCSI or ATA? If it's ATA, turn off write cache with (atacontrol(8) or > the sysctl. > > The problem is that disks lie about whether they have actually written > data. If the power goes off before the data is in cache, it's lost. That should only make a difference in a power-fail situation, and it only makes a difference if the only unwritten data is in the drive's write cache. > I am not sure if write-cache can be turned off on SCSI, but SCSI drives > seem less likely to lie about when the data is actually flushed to the > drive. Yes it can, and I recommend it. Use the camcontrol modepage command to set the WCE bit to 0.