From owner-freebsd-doc@FreeBSD.ORG Wed Mar 28 06:07:55 2012 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E436106564A; Wed, 28 Mar 2012 06:07:55 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCCE8FC08; Wed, 28 Mar 2012 06:07:54 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q2S5n9j2042064; Tue, 27 Mar 2012 23:49:09 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q2S5n9Ns042061; Tue, 27 Mar 2012 23:49:09 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 27 Mar 2012 23:49:08 -0600 (MDT) From: Warren Block To: Daniel Gerzo In-Reply-To: <7e043215e6cd0f2da324d6599c921fec@rulez.sk> Message-ID: References: <20120125.111625.2289296443525755896.hrs@allbsd.org> <7e043215e6cd0f2da324d6599c921fec@rulez.sk> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Tue, 27 Mar 2012 23:49:09 -0600 (MDT) Cc: freebsd-doc@freebsd.org, pjd@freebsd.org Subject: Re: Handbook RAID1 example X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2012 06:07:55 -0000 On Fri, 27 Jan 2012, Daniel Gerzo wrote: >> I think we should rewrite this section not to create a malformed >> partition table by configuring gmirror in some way. If all of >> partitions are UFS, the following procedure should be safe: >> >> 1. gmirror label gm0 /dev/da1, and edit /boot/loader.conf to load >> the kernel module. >> >> 2. Reboot and check if gm0 is recognized even after that (just in >> case). >> >> 3. Create partitions in /dev/mirror/gm0 based on ones in /dev/da0. >> If capacity of /dev/da0 and /dev/da1 is the same as each other >> gm0 should be slightly smaller by the last sector. >> >> 4. Dump & restore each partition from /dev/da0* to /dev/mirror/gm0*. >> Install a boot block if necessary. >> >> 5. mount /dev/mirror/gm0s1a /mnt, and edit /mnt/etc/fstab to mount >> gm0. Also, apply the same change to /etc/fstab in /dev/da0. >> >> 6. Reboot and check if gm0 is mounted as the root partition. >> >> 7. gmirror add gm0 /dev/da0, and wait for the rebuild. >> >> The primary difference between the above and one in the handbook is >> to use /dev/da1 for gm0 first. By doing this, both making a backup >> of /dev/da0 and repartitioning before setting up the mirror >> configuration can be done virtually. The step 3 may be complex in >> some cases, but I personally think partitioning /dev/mirror/gm0 by >> gpart based on the existing /dev/da0 is not so difficult. > > Basing on my previous discussion with pjd@ I believe that this is the correct > way of setting up gmirror. Pawel, could you confirm please? It's been a while, but finally several factors converged and I have a first pass at a rewrite of the Handbook geom mirror RAID1 "convert your old disk to a mirror in-place" section. Procedure tested on both 9.0-RELEASE and 8.2-RELEASE. It could stand more testing. High points * does not mention kern.geom.debugflags * does not create improper partition tables (boots on 9.0) * uses gpart backup/restore to copy partition tables * uses glabels, so the mirror still works even if the drives are moved around (tested) * briefly explains the GPT/gmirror conflict Potential problems * 'gmirror clear'/'glabel clear' give confusing error messages when no metadata exists * dump can hang when used on a 9.0-RELEASE SU+J filesystem Samples HTML: http://www.wonkity.com/~wblock/gmirror/geom-mirror.html Diff: http://www.wonkity.com/~wblock/gmirror/geom.diff Feedback welcome on both the procedure and the text.