From owner-freebsd-fs@FreeBSD.ORG Fri Oct 10 12:03:11 2014 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B66C1127 for ; Fri, 10 Oct 2014 12:03:11 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 61E31E55 for ; Fri, 10 Oct 2014 12:03:11 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id s9AC38IM068405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 10 Oct 2014 06:03:08 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id s9AC38f6068402; Fri, 10 Oct 2014 06:03:08 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 10 Oct 2014 06:03:08 -0600 (MDT) From: Warren Block To: Stephan Wehner Subject: Re: fsck / GEOM / Editing files in mirror partitions separately In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Fri, 10 Oct 2014 06:03:08 -0600 (MDT) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2014 12:03:11 -0000 On Thu, 9 Oct 2014, Stephan Wehner wrote: > Hello there, > > I have a FreeBSD 10.0-RELEASE-p7 system with system specifics: > > $ mount > /dev/mirror/gm0s1a on / (ufs, local, journaled soft-updates) > devfs on /dev (devfs, local, multilabel) > /dev/mirror/gm0s1b on /home (ufs, local, journaled soft-updates) > procfs on /proc (procfs, local) > > $ gmirror status > Name Status Components > mirror/gm0 COMPLETE ada0 (ACTIVE) > ada1 (ACTIVE) > > $ gpart show > => 63 3907029104 mirror/gm0 MBR (1.8T) > 63 3907029042 1 freebsd [active] (1.8T) > 3907029105 62 - free - (31K) > > => 0 3907029042 mirror/gm0s1 BSD (1.8T) > 0 2456848384 1 freebsd-ufs (1.1T) > 2456848384 1433600000 2 freebsd-ufs (684G) > 3890448384 16580658 4 freebsd-swap (7.9G) > > Computer was rebooted by simply turning it off. On reboot, I got > message "error aborting boot enter full pathname or shell or return > for /bin/sh" > > First question: Is it normal that the filesystem will not survive a > power loss, so that manual intervention is needed? > I thought UFS would be more robust. fsck is often required when filesystem has been stopped without a clean shutdown. This is to prevent corruption from writing to a non-consistent filesystem. > Now I did something that may have been a bad idea. > > I ran fsck on both partitions of the mirror separately, I think they > were called ad4s1 and ad6s1. For both it reported some problems to > fix, and I did Y until they were declared "CLEAN." Why? A mirror is a single entity. Writes are sent to both drives, and the whole point is that the two drives are identical. Using them individually should be avoided. > Then rebooted, and now the system is running fine. > > Second question. Is that mirror in good shape? Is there a way to test? That's an interesting question. I don't know if there is a way to force gmirror to check the mirror in depth. Normally, I think it just keeps track of whether the drives are synchronized. With the mirror stopped, the contents of both drives should be identical except for the last block, where the gmirror metadata is stored. > Third question. Does one even run fsck on partitions that are then > controlled by geom? Well, yes. But if RAID is involved, go through the RAID geom rather than around it. So fsck the filesystems through the mirror, not on each disk. Let gmirror keep them synchronized. > This shows in dmesg: > > GEOM_MIRROR: Device mirror/gm0 launched (1/2). > GEOM_MIRROR: Device gm0: rebuilding provider ada0. > GEOM_MIRROR: Device gm0: rebuilding provider ada0 finished. > GEOM_MIRROR: Device mirror/gm0 launched (2/2). It found an unsynchronized mirror and rebuilt it, copying one entire drive to another. This can also be forced manually with 'gmirror rebuild'.