From owner-freebsd-doc@FreeBSD.ORG Wed Jan 25 02:18:38 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 7AF6E106566B for ; Wed, 25 Jan 2012 02:18:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id C45BE8FC0A for ; Wed, 25 Jan 2012 02:18:37 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P2ILA9070772; Wed, 25 Jan 2012 11:18:31 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P2IJDV002013; Wed, 25 Jan 2012 11:18:21 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 25 Jan 2012 11:16:25 +0900 (JST) Message-Id: <20120125.111625.2289296443525755896.hrs@allbsd.org> To: wblock@wonkity.com From: Hiroki Sato In-Reply-To: References: X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_25_11_16_25_2012_175)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 25 Jan 2012 11:18:32 +0900 (JST) X-Spam-Status: No, score=-104.4 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, QENCPTR1, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: freebsd-doc@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, 25 Jan 2012 02:18:38 -0000 ----Security_Multipart(Wed_Jan_25_11_16_25_2012_175)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Warren Block wrote in : wb> Multiple users on the forums have reported problems with existing wb> gmirror(8) mirrors being unbootable after upgrading to FreeBSD 9: wb> http://forums.freebsd.org/showthread.php?t=28895 wb> wb> The workaround is to set kern.geom.part.check_integrity="0" in wb> /boot/loader.conf. wb> wb> wb> The example from the RAID1 chapter of the Handbook isn't helping: wb> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html wb> wb> The procedure overrides the safety and uses the last block of a drive, wb> regardless of whether it was already allocated to a partition. During wb> boot, the GEOM system sees the error and stops: wb> wb> GEOM_MIRROR: Device mirror/gm0 launched (2/2). wb> GEOM_PART: partition 1 has end offset beyond last LBA: 1250263727 > wb> 1250263726 wb> GEOM_PART: integrity check failed (mirror/gm0, MBR) wb> wb> To be fair, that example allows (allowed) the user to set up a mirror wb> of their existing disk complete with whatever partitioning existed. wb> And it still ought to work if the last block was not part of a wb> partition. wb> wb> That Handbook chapter could be updated without a huge change by wb> removing the instructions to turn off the safety (so it will error out wb> if the user tries it on an allocated last block). wb> wb> Then add a note or warning along the lines of "The procedure shown can wb> only be used if the last block of the drive has not been already wb> allocated to a partition. If the last block has been included in a wb> partition, back up, repartion leaving at least one unused block at the wb> end of the drive, create the mirror, and restore." 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. -- Hiroki ----Security_Multipart(Wed_Jan_25_11_16_25_2012_175)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8fZfkACgkQTyzT2CeTzy1+egCfcioSyok0uywyDI458JuL2MnL 6dcAoN2XhGZGoEs8J8ztLQh6U82hcTQX =Q1Vo -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_25_11_16_25_2012_175)----